08-12-2007 7:19 AM
Hi, every one
I have to create a itab for session error
log
I want put all error in one itab.
how to creat a internal table for sesion log error
08-12-2007 4:24 PM
use itab of structure BDCMSGCOLL and use that itab in the CALL TRANSACTION[T-CODE] -
MESSAGES INTO [ITAB of Structure BDCSGCOLL].
if useful reward.
08-12-2007 5:34 PM
Hi Sandy,
please have a look at function group SBAL. It is used to store, read, delete and (optional) save mesages permanent in the application log.
For every error, use the MESSAGE command with addition INTO <field>. This will set the SY-MSG.. fields. You can adapt this form fot the transfer of messages to the log:
*&---------------------------------------------------------------------*
*& Form log_symsg
*&---------------------------------------------------------------------*
* append message from system fields to aplication log
*----------------------------------------------------------------------*
form log_symsg using pr_sbal type ref to /well/u_cl_sbal.
data:
ls_balmsg type bal_s_msg.
ls_balmsg-msgid = sy-msgid.
ls_balmsg-msgno = sy-msgno.
ls_balmsg-msgty = sy-msgty.
ls_balmsg-msgv1 = sy-msgv1.
ls_balmsg-msgv2 = sy-msgv2.
ls_balmsg-msgv3 = sy-msgv3.
ls_balmsg-msgv4 = sy-msgv4.
case sy-msgty.
when 'E'. ls_balmsg-probclass = '1'.
when 'S'. ls_balmsg-probclass = '2'.
when 'W'. ls_balmsg-probclass = '3'.
when 'I'. ls_balmsg-probclass = '4'.
endcase." sy-msgty
call method pr_sbal->msg_add
exporting
i_s_msg = ls_balmsg
exceptions
msg_not_stored = 1
no_handle = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " log_symsg
Note: The "call method pr_sbal->msg_add" can only beused if an appropriate class exists. I created one hiduing the use of FUNCTION 'BAL_LOG_MSG_ADD'.
Regards,
Clemens