BAL_LOG_CREATE --> Create log with header data
BAL_LOG_MSG_ADD --> Put message in log
BAL_DB_SAVE --> Save logs in the database
Transaction Codes:
SLG0: Creation of Object and Sub object
SLG1: Display Application Logs
SAMPLE CODE
data: ls_log TYPE bal_s_log,
ls_log_handle TYPE balloghndl,
ls_log_handle TYPE balloghndl,
ls_msg TYPE bal_s_msg,
lt_new_lognumbers TYPE bal_t_lgnm.
clear: ls_log, ls_log_handle.
ls_log-aluser = sy-uname.
ls_log-alprog = sy-repid.
ls_log-object =
ls_log-altcode = sy-tcode.
ls_log-subobject =
ls_log-extnumber =
ls_log-aldate = sy-datum.
ls_log-altime = sy-uzeit.
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
i_s_log = ls_log
IMPORTING
e_log_handle = ls_log_handle
EXCEPTIONS
log_header_inconsistent = 1
OTHERS = 2.
ls_msg-msgty =
ls_msg-msgid =
ls_msg-msgno =
ls_msg-msgv1 =
ls_msg-msgv2 =
ls_msg-msgv3 =
ls_msg-msgv4 =
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
i_log_handle = ls_log_handle
i_s_msg = ls_msg
EXCEPTIONS
log_not_found = 1
msg_inconsistent = 2
log_is_full = 3
OTHERS = 4.
CALL FUNCTION 'BAL_DB_SAVE'
EXPORTING
i_t_log_handle = lt_log_handle
IMPORTING
e_new_lognumbers = lt_new_lognumbers
EXCEPTIONS
log_not_found = 1
save_not_allowed = 2
numbering_error = 3
OTHERS = 4.
Hiç yorum yok:
Yorum Gönder