Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDC Recording

Former Member
0 Likes
601

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".

3 REPLIES 3
Read only

Former Member
0 Likes
536

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

Read only

Former Member
0 Likes
536

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

Read only

Former Member
0 Likes
536

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