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

how to capture the errors BDC

In Call transaction method, how to capture the errors ?

How to load data from MS Excel sheet to SAP by using BDC method ?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2007 at 09:09 AM

    capture error in call transaction -


    >>>>>>

    IN CALL TRANSACTION TO CAPTURE THE ERRORS WE SHOULD PERFORM THE FOLLOWING.

    FIRST ME MUST DECLARE AN INTERNAL TABLE WITH THE STRUCTURE OF BDCMSGCOLL TABLE.

    THEN WHILE WRITING THE CALL TRANSACTION STATEMENT WE SHOULD PUT THE 'E' MODE FOR CAPTURING ALL THE ERRORS.

    THEN FINALLY THE CAPTURED ERRORS MUST TO SENT TO THE INTERNAL TABLE WHICH WE DECLARED IN THE BEGINNING WITH BDCMSGCOLL BY USING THE FUNCTION MODULE "FORMAT_MESSAGE"

    AND THUS THE ERROR MESSAGES WILL BE SENT TO THE INTERNAL TABLE WHICH WE DECLARED AT THE BEGINNING

    for uploading Ms Excel Sheet use fm -


    >

    KCD_EXCEL_OLE_TO_INT_CONVERT

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member
      • Add values to internal table

      SORT t_cells BY row col.

      LOOP AT t_cells INTO wa_cells.

      MOVE : wa_cells-col TO l_index.

      ASSIGN COMPONENT l_index OF STRUCTURE itab TO <f_value>.

      MOVE : wa_cells-value TO <f_value>.

      AT END OF row.

      APPEND itab

      CLEAR itab.

      ENDAT.

      ENDLOOP.

  • author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2007 at 09:09 AM

    In Call transaction method, how to capture the errors ?

    CALL TRANSACTION 'FK01' USING IT_BDCDATA MODE 'A'

    UPDATE 'S'

    MESSAGES INTO IT_MESSAGES.

    WRITe:/ SY-SUBRC.

    PERFORM FORMAT_MESSAGES.

    CLEAR IT_BDCDATA.

    REFRESH IT_BDCDATA.

    form FORMAT_MESSAGES .

    DATA: L_MSG(100).

    LOOP AT IT_MESSAGES.

    CALL FUNCTION 'FORMAT_MESSAGE'

    EXPORTING

    ID = IT_MESSAGES-MSGID

    LANG = SY-LANGU

    NO = IT_MESSAGES-MSGNR

    V1 = IT_MESSAGES-MSGV1

    V2 = IT_MESSAGES-MSGV2

    V3 = IT_MESSAGES-MSGV3

    V4 = IT_MESSAGES-MSGV4

    IMPORTING

    MSG = L_MSG

    EXCEPTIONS

    NOT_FOUND = 1

    OTHERS = 2

    .

    write:/ l_msg.

    endloop.

    How to load data from MS Excel sheet to SAP by using BDC method ?

    use the FM ALSM_EXCEL_TO_INTERNAL_TABLE.

    Regards,

    priya.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 12, 2007 at 11:04 AM

    hI..

    1. To Capture errors in Call transaction:

    Using BDCMSGCOLL Structure we have to declare an itab.

    DATA : IT_MSG LIKE TABLE OF BDCMSGCOLL .

    Then We can catch the messages using:

    CALL TRANSACTION 'MK01'

    USING IT_BDCDATA

    MODE 'N'

    MESSAGES INTO IT_MSG.

    IF sy-subrc ne 0.

    LOOP AT IT_MSG INTO WA_MSG

    WHERE MSGTYP = 'E' OR MSGTYP = 'A'..

    << call the FM FORMAT_MESSAGE to get the Message text and display.>>

    ENDLOOP.

    2) To upload data from Excel:

    use the FM GUI_UPLOAD.

    <b>reward if Helpful</b>

    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.