2006 Sep 28 6:52 AM
I have a question, for each record that fails i would like to get the error message and save it into internal table i_error. My code goes like this...
Data: i_error TYPE STANDARD TABLE OF BDCMSGCOLL,
CALL TRANSACTION 'IL02'
USING i_bdc_tab
MODE c_n
MESSAGES INTO i_error.
I debugged and the fields & contents of i_error are...
Component Name Contents
1. TCODE IL02
2. DYNAME SAPMIL00
3. DYNUMB 1110
4. MSGTYP S
5. MSGSPRA E
6. MSGID 00
7. MSGNR 343
8. MSGV1 IFLO-TPLNR
9. MSGV2 .
10. MSGV3 SAPMIL00
11. MSGV4 1110
12. ENV CTU
13. FLDNAME
My problem is what field does the internal table i_error store the error message?
Sample output error message...
Blocked by user "xxxx".
I have a question, for each record that fails i would like to get the error message and save it into internal table i_error. My code goes like this...
Data: i_error TYPE STANDARD TABLE OF BDCMSGCOLL,
CALL TRANSACTION 'IL02'
USING i_bdc_tab
MODE c_n
MESSAGES INTO i_error.
I debugged and the fields & contents of i_error are...
Component Name Contents
1. TCODE IL02
2. DYNAME SAPMIL00
3. DYNUMB 1110
4. MSGTYP S
5. MSGSPRA E
6. MSGID 00
7. MSGNR 343
8. MSGV1 IFLO-TPLNR
9. MSGV2 .
10. MSGV3 SAPMIL00
11. MSGV4 1110
12. ENV CTU
13. FLDNAME
My problem is what field does the internal table i_error store the error message?
Sample output error message...
Blocked by user "xxxx".
2006 Sep 28 6:55 AM
before calling any Document in Change mode , first u have to ENQUEUE the document then only u have to change.
search ENQUEUE* in se37
Regards
prabhu
2006 Sep 28 6:56 AM
Hi,
The error message is store in table : T100.
Here the sample code:
FORM BDC_TRANSACTION USING TCODE.
DATA: L_MSTRING(480).
DATA: L_SUBRC LIKE SY-SUBRC.
REFRESH MESSTAB.
CALL TRANSACTION TCODE USING BDCDATA
MODE CTUMODE
UPDATE CUPDATE
MESSAGES INTO MESSTAB.
REFRESH BDCDATA.
IF MESSTAB[] IS NOT INITIAL.
READ TABLE MESSTAB INDEX 1.
PERFORM GET_ERRTXT
USING MESSTAB-MSGSPRA MESSTAB-MSGID MESSTAB-MSGNR.
REPLACE '&4' IN ERR_TXT WITH MESSTAB-MSGV4.
REPLACE '&1' IN ERR_TXT WITH MESSTAB-MSGV1.
REPLACE '&2' IN ERR_TXT WITH MESSTAB-MSGV2.
REPLACE '&3' IN ERR_TXT WITH MESSTAB-MSGV3.
REPLACE '&' IN ERR_TXT WITH MESSTAB-MSGV1.
ENDIF.
ENDFORM.
FORM GET_ERRTXT USING LANG AREA NMBR.
SELECT SINGLE TEXT INTO ERR_TXT
FROM T100
WHERE SPRSL EQ LANG
AND ARBGB EQ AREA
AND MSGNR EQ NMBR.
ENDFORM.
Regards,
Message was edited by: Jatra Riwayanto
2006 Sep 28 7:14 AM
Hi Marc,
<b><b>Read table I_ERROR into wa_error with key MSGTYP = `E`.</b></b>
if sy-subrc eq 0.
bdc call had an error.. do the processing here
endif.
Best regards,
Prashant
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |