Monday, June 3, 2013

Application Log Creation in ABAP

LS_LOG-OBJECT = 'SALESORD'.
LS_LOG-SUBOBJECT = 'SALESITEM'.
CALL FUNCTION 'BAL_LOG_CREATE'
  EXPORTING
    I_S_LOG = LS_LOG
  IMPORTING
    E_LOG_HANDLE = L_LOGHAND
  EXCEPTIONS
    LOG_HEADER_INCONSISTENT = 1
    OTHERS = 2.
L_MSG-MSGTY = 'E'.
L_MSG-MSGID = 'B1'.
L_MSG-MSGNO = '999'.
L_MSG-MSGV1 = 'Update failed for'.
L_MSG-MSGV2 = LV_WI_ID.
CALL FUNCTION 'BAL_LOG_MSG_ADD'
  EXPORTING
    I_LOG_HANDLE = L_LOGHAND
    I_S_MSG = L_MSG
  IMPORTING
    E_MSG_WAS_LOGGED = B_LOG
    E_MSG_WAS_DISPLAYED = B_DISP
  EXCEPTIONS
    LOG_NOT_FOUND = 1
    MSG_INCONSISTENT = 2
    LOG_IS_FULL = 3
    OTHERS = 4.
* save logs


CALL FUNCTION 'BAL_DB_SAVE'
  EXPORTING
    I_SAVE_ALL = 'X'
  EXCEPTIONS
    OTHERS = 1.

1 comment:

  1. SAP ABAP training is provided in CHENNAI.

    THE CREATING EXPERTS is one of the leading trainer in SAP who provides real time training

    http://thecreatingexperts.com/sap-abap-training-in-chennai/

    contact 8122241286

    ReplyDelete