‎2008 Mar 27 2:30 AM
hi
can any one tell me how to handle the error in bdc session method.
i know we can see the error log in sm35... i want to write the error log once the seesion completed...
in which table the error log are stored...
is there any function module available...
plz its urgent...
‎2008 Mar 27 2:52 AM
Hi,
If you want to show the errors then what is the benefit of session method? Better use call transaction.
Regards,
Atish
‎2008 Mar 27 2:52 AM
Hi,
If you want to show the errors then what is the benefit of session method? Better use call transaction.
Regards,
Atish
‎2008 Mar 27 6:30 AM
hi,
If there are any error records in session, all those error records will get poulated in log .and after the session is completed , u can see error records which can be corrected and reprocessed again
We have the structures BDCLD and BDCLM, which will capture the log details inthe session. Firstly, sesssion should be processed. After that log will be created. Then caputure the information into an internal table using BDCLM and BDCLD.
and refer the link.
regards
raji
reward if helpful
‎2008 Mar 27 9:01 AM
hi,
It is better to use CALL TRANSCATION if u want to display the error message.
Plz find below a sample code .
table gt_report contains the fields and messages to be displayed for error.
data: gt_bdcmsgcoll type bdcmsgcoll.
*to update throuh BDC
CALL TRANSACTION 'CO02' USING gt_bdctab
MODE 'A'
UPDATE 'S'
MESSAGES INTO gt_bdcmsgcoll.
IF sy-subrc EQ 0.
CONCATENATE text-t01 gwa_afko-aufnr text-t07 INTO lf_message SEPARATED BY space.
gwa_report-aufnr = gwa_afko-aufnr.
gwa_report-status = text-t11.
gwa_report-msgdes = lf_message.
APPEND gwa_report TO gt_report .
ELSE.
LOOP AT gt_bdcmsgcoll INTO gwa_bdcmsgcoll WHERE msgtyp = 'E'.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = gwa_bdcmsgcoll-msgid
lang = 'E'
no = gwa_bdcmsgcoll-msgnr
v1 = gwa_bdcmsgcoll-msgv1
v2 = gwa_bdcmsgcoll-msgv2
v3 = gwa_bdcmsgcoll-msgv3
v4 = gwa_bdcmsgcoll-msgv4
IMPORTING
msg = lf_string
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDLOOP.
gwa_report-aufnr = gwa_bdcmsgcoll-msgv1.
gwa_report-status = text-t08.
gwa_report-msgdes = lf_message.
APPEND gwa_report TO gt_report.
ENDIF.
CLEAR : gwa_bdcmsgcoll, gwa_afko.
ENDLOOP.
reward points if useful.
regards
sandhya
‎2010 Nov 17 6:38 PM
Hi,
You have to use the function modules like
BDC_PROTOCOL_SELECT_QID
RSTS_OPEN_RLC
RSTS_READ
You can refer this wiki posted by Sandra
[Get log of batch input session|http://wiki.sdn.sap.com/wiki/display/ABAP/Getlogofbatchinput+session]