2013 Apr 09 5:17 PM
How can i create my own logs(as a result of checks performed inside my program) similar to the logs in SLG1 tcodes?? Or is it possible to have these errors logged in SLG1 itself?
2013 Apr 10 9:26 AM
Yes, You can have these logs created in SLG1 itsself.
Example
w_s_log-object = 'YXXXXXX' Any name
w_s_log-subobject = 'Y.......' Any name
w_s_log-aldate = sy-datum .
w_s_log-altime = sy-uzeit.
w_s_log-aluser = sy-uname.
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
i_s_log = w_s_log
IMPORTING
e_log_handle = w_log_handle.
* Add message to log file
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
i_log_handle = w_log_handle
i_s_msg = w_s_msg.
APPEND w_log_handle TO i_log.
CALL FUNCTION 'BAL_DB_SAVE'
EXPORTING
i_t_log_handle = i_log.
CALL FUNCTION 'BAL_LOG_REFRESH'
EXPORTING
i_log_handle = w_log_handle.
Data will be
w_log_handle TYPE balloghndl,
w_s_log TYPE bal_s_log,
w_s_msg TYPE bal_s_msg.
How can i create my own logs(as a result of checks performed inside my program) similar to the logs in SLG1 tcodes?? Or is it possible to have these errors logged in SLG1 itself?
2013 Apr 10 9:26 AM
Yes, You can have these logs created in SLG1 itsself.
Example
w_s_log-object = 'YXXXXXX' Any name
w_s_log-subobject = 'Y.......' Any name
w_s_log-aldate = sy-datum .
w_s_log-altime = sy-uzeit.
w_s_log-aluser = sy-uname.
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
i_s_log = w_s_log
IMPORTING
e_log_handle = w_log_handle.
* Add message to log file
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
i_log_handle = w_log_handle
i_s_msg = w_s_msg.
APPEND w_log_handle TO i_log.
CALL FUNCTION 'BAL_DB_SAVE'
EXPORTING
i_t_log_handle = i_log.
CALL FUNCTION 'BAL_LOG_REFRESH'
EXPORTING
i_log_handle = w_log_handle.
Data will be
w_log_handle TYPE balloghndl,
w_s_log TYPE bal_s_log,
w_s_msg TYPE bal_s_msg.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |