‎2009 May 04 7:13 AM
Hello friends,
I need to capture error in BDC in No-Screen mode. But in this mode i am not able to capture errors during BDC. I need to run my BDC in no-screen mode and need to capture errors to generate error file.
Please help.
Kumar.
‎2009 May 04 7:19 AM
Hi Kumar,
CALL TRANSACTION v_tcode
USING i_bdc_tbl
MODE c_n
UPDATE c_s
MESSAGES INTO i_msg.
The error will be captured in internal table i_msg.
Regards,
Mawi
‎2009 May 04 7:16 AM
You can fill the message table BDCMSGCOLL and then log the messages
‎2009 May 04 7:20 AM
I am filling the message table friend. but i am getting only on emessage ' No batch input data ' . when i saw in documentation it was mentioned like we will get this message all the times. but i need error file. please suggest if there is any other way
Kumar
‎2009 May 04 7:26 AM
Well in this please make sure that you are really filling the table with error messages .
‎2009 May 04 7:31 AM
call transaction 'MM01' using itab_bdcdata MODE 'N' messages into itab_message.
This is my code. Please help.
‎2009 May 04 7:41 AM
Hi,
Check this code...
CALL TRANSACTION c_pa30 USING i_bdc_data MODE 'N'
MESSAGES INTO i_msg_tab.
IF sy-subrc NE 0.
* Process as error if message type is E or A. if it is type S, it is
* only an error if it is 347, 348, 344"No batch input data for screen
LOOP AT i_msg_tab INTO i_msg_tab_line
WHERE msgtyp = c_e OR msgtyp = c_a
OR ( msgtyp = 'S' AND msgid = '00' AND msgnr = '347' )
OR ( msgtyp = 'S' AND msgid = '00' AND msgnr = '348' )
OR ( msgtyp = 'S' AND msgid = '00' AND msgnr = '344' ).
CALL FUNCTION 'MASS_MESSAGE_GET'
EXPORTING
sprsl = sy-langu
arbgb = i_msg_tab_line-msgid
msgnr = i_msg_tab_line-msgnr
msgv1 = i_msg_tab_line-msgv1
msgv2 = i_msg_tab_line-msgv2
msgv3 = i_msg_tab_line-msgv3
msgv4 = i_msg_tab_line-msgv4
IMPORTING
msgtext = l_errormsg
EXCEPTIONS
message_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0. "#EC NEEDED
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
MOVE p_emp_details TO e_error_line.
MOVE l_errormsg TO e_error_line-errmsg.
APPEND e_error_line TO e_error.
EXIT.
ENDLOOP.
ENDIF.
‎2009 May 04 7:50 AM
Friend i need to get actucal error. but with the solution u have provided i am getting the same error 'No batch input exist'. Please suggest other way.
Kumar
‎2009 May 04 8:15 AM
hi,
check this
CALL TRANSACTION 'SE11' USING T_BDCDATA MODE 'N' MESSAGES INTO T_MSG.LOOP AT T_MSG INTO MSG.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = MSG-MSGID
LANG = 'EN'
NO = MSG-MSGNR
V1 = MSG-MSGV1
V2 = MSG-MSGV2
V3 = MSG-MSGV3
V4 = MSG-MSGV4
IMPORTING
MSG = MESSAGE
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.IF sy-subrc EQ 0.
WRITE / MESSAGE.
ENDIF.ENDLOOP.
regards
priya
‎2009 May 04 7:19 AM
Hi Kumar,
CALL TRANSACTION v_tcode
USING i_bdc_tbl
MODE c_n
UPDATE c_s
MESSAGES INTO i_msg.
The error will be captured in internal table i_msg.
Regards,
Mawi
‎2009 May 04 7:19 AM
hi,
Run the BDC with the additions
call transaction....mode 'N'...messages into t_messages.
where t_messge type table of BDCMSGCOLL.
Download the contents of this internal table t_messages to a file for errors during the BDC.
Regards
Sharath