2007 May 09 3:34 PM
Hi,
In BDC'S I have to Display the separatly error records and Successful records .
what is the code and concept.
Hi,
In BDC'S I have to Display the separatly error records and Successful records .
what is the code and concept.
2007 May 09 5:00 PM
Try this
Post using call transaction method**********************************
CALL TRANSACTION 'FB01' USING bdcdata MODE l_type
UPDATE 'S' MESSAGES INTO tl_messg.
***Commit the asynchronous transaction********************************
COMMIT WORK AND WAIT.
***Check if the transaction is sucessful******************************
READ TABLE tl_messg WITH KEY msgtyp = c_s.
2007 May 09 5:30 PM
Hi,
this will help you , after calling the call transaction
put the loop at BDCMSGCOLL TABLE.
IF SY-SUBRC NE 0.
LOOP AT BDCMSGCOLL WHERE MSGTYPE = 'E'
MOVE CURRENT RECORD TO ERROR TABLE.
ENDLOOP.
ELSE.
MOVE CURRENT RECORD TO SUCCESSTABLE.
ENDIF.
CALL TRANSACTION 'FB01' USING bdcdata MODE l_type
UPDATE 'S' MESSAGES INTO BDCMSGCOLL
if sy-subrc ne 0.
loop at BDCMSGCOLL where mestype = e.
move records itab to err_tab.
else.
move records itab to succ_tab.
endif.
2007 May 09 6:08 PM
Hi,
Using function module 'FORMAT_MESSAGE' you can capture the messages.
Here is a sample of the program code for that:
LOOP AT it_messtab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = it_messtab-msgid
lang = it_messtab-msgspra
no = it_messtab-msgnr
v1 = it_messtab-msgv1
v2 = it_messtab-msgv2
IMPORTING
msg = g_msg
EXCEPTIONS
OTHERS = 0.
IF it_messtab-msgtyp = 'S'.
it_sucess-sucess_rec = g_msg.
it_sucess-lifnr = it_header-lifnr." Based on your field
it_sucess-tabix = v_lines.
APPEND it_sucess.
ELSEIF it_messtab-msgtyp = 'E'.
it_error-error_rec = g_msg.
it_error-lifnr = it_header-lifnr.
it_error-tabix = v_lines.
APPEND it_error.
ELSE.
it_info-info_rec = g_msg.
it_info-lifnr = it_header-lifnr.
it_info-tabix = v_lines.
APPEND it_info.
ENDIF.
ENDLOOP.
Regards,
Bhaskar
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |