2007 Dec 05 1:49 PM
2007 Dec 05 2:00 PM
Hello
After calling transaction use the message table to get all the bdc´s log.
IE:
CALL TRANSACTION 'XXXX' USING batch_bdc MODE bmode UPDATE 'S'
MESSAGES INTO tbl_msg.
loop at TBL_MSG
ENDLOOP.
Hope this helps
Gabriel P.
2007 Dec 06 4:58 AM
Hi uday,
for <b>Call transaction method:</b>
*Delcaring the structure for storing error messages in call transaction
Data: BDCMSG like BDCMSGCOLL occurs 0 with header line.
data:i_bdcdata like bdcdata occurs 0 with header line.
tcode = can be any tcode ex: 'MM01' etc.
i_mode = mode are 3 types 'A' = all sceen N = no screen and E = Error screen.
Upd_n = update 'S' = Synchronous , 'A' = Asynchronous.
use this code
CALL TRANSACTION <tcode> USING i_bdcdata MODE l_mode
UPDATE upd_n MESSAGES INTO err_data.
*
IF NOT err_data[] IS INITIAL.
LOOP AT err_data WHERE msgtyp EQ 'S' OR msgtyp EQ 'E'.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = err_data-msgid
lang = 'E'
no = err_data-msgnr
v1 = err_data-msgv1
v2 = err_data-msgv2
v3 = err_data-msgv3
v4 = err_data-msgv4
IMPORTING
msg = v_text
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
IN Sesssion method:
Session method will create error log file in SM35.
Go to t-code<b> SM35P</b> or table <b>APQL</b> to see the log details.
<b>reward if useful</b>.
Regards,
sunil kairam.
2007 Dec 06 7:25 PM
declare an internal table to hold the messages with type bdcmsgcoll.
data: gt_messtab TYPE STANDARD TABLE OF bdcmsgcoll.
DATA: lv_text(125) TYPE c.
Call transaction statemet should be with Message field.
CALL TRANSACTION 'TCODE' USING bdcdata MODE 'A/N/E'
UPDATE 'A/S'
MESSAGES INTO gt_messtab. """"""""'
if not gt_messtab is initial.
READ TABLE gt_messtab WITH KEY msgtyp = 'E'.
if sy-subrc = 0.
LOOP AT gt_messtab WHERE msgtyp EQ 'E'.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = gt_messtab-msgid
no = gt_messtab-msgnr
v1 = gt_messtab-msgv1
v2 = gt_messtab-msgv2
v3 = gt_messtab-msgv3
v4 = gt_messtab-msgv4
IMPORTING
msg = lv_text.
gt_error-text = lv_text.
append gt_error.
ENDLOOP.
refresh gt_messtab[].
endif.
endif.
IT gt_error contains all error records in it.
and use FM: GUI_DOWNLOAD to down load error records into desktop.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = gv_filename
filetype = 'ASC'
TABLES
data_tab = gt_error
it downloads all error records in specified path of presentation server