Skip to Content
author's profile photo Former Member
Former Member

BDC Error Catching

Hi Friends,

I am trying to catch errors in BDC by using following code.

FORM F9100_CALL_TRANSACTION USING VALUE(P_TCODE).

CALL TRANSACTION P_TCODE USING BDC_DATA MODE 'A' UPDATE 'A' MESSAGES INTO BDC_ERR.

IF SY-SUBRC NE 0.

LOOP AT BDC_ERR. WHERE MSGTYP EQ 'E'.

CALL FUNCTION 'MESSAGE_TEXT_BUILD'

EXPORTING

MSGID = BDC_ERR-MSGID

MSGNR = BDC_ERR-MSGNR

MSGV1 = BDC_ERR-MSGV1

MSGV2 = BDC_ERR-MSGV2

MSGV3 = BDC_ERR-MSGV3

MSGV4 = BDC_ERR-MSGV4

IMPORTING

MESSAGE_TEXT_OUTPUT = W_TEXTOUT.

  • Build error table ready for output

IT_ERROR-AUFNR = I_HEADER-AUFNR.

IT_ERROR-TEXTOUT = W_TEXTOUT.

APPEND IT_ERROR.

ENDLOOP.

ENDIF.

ENDFORM. " F9100_CALL_TRANSACTION

But it is not catching all errors . what will be the problem,

Can you please help me on this.

Thanks,

Murali Krishna K

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 04:53 AM

    Try using Update mode 'S'.

    FORM F9100_CALL_TRANSACTION USING VALUE(P_TCODE).

    CALL TRANSACTION P_TCODE USING BDC_DATA MODE 'A' UPDATE 'S' MESSAGES INTO BDC_ERR.

    IF SY-SUBRC NE 0.

    LOOP AT BDC_ERR.

    CALL FUNCTION 'MESSAGE_TEXT_BUILD'

    EXPORTING

    MSGID = BDC_ERR-MSGID

    MSGNR = BDC_ERR-MSGNR

    MSGV1 = BDC_ERR-MSGV1

    MSGV2 = BDC_ERR-MSGV2

    MSGV3 = BDC_ERR-MSGV3

    MSGV4 = BDC_ERR-MSGV4

    IMPORTING

    MESSAGE_TEXT_OUTPUT = W_TEXTOUT.

    • Build error table ready for output

    IT_ERROR-AUFNR = I_HEADER-AUFNR.

    IT_ERROR-TEXTOUT = W_TEXTOUT.

    APPEND IT_ERROR.

    ENDLOOP.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.