Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

In BDC,capturing total number of records

In a BDC ,

Is it feasible to capture the total number of sucess records

total number of failure records,total number of records

and the correspoding error info.

Is there any simple way to obtain the above desired results

Thanks in advance

Former Member
Former Member replied

hii

With the BDC u can capture the error message or success messages with this code:

data: i_msg type standard table of bdcmsgcoll with header line.


  LOOP AT I_MSG.

    CALL FUNCTION 'FORMAT_MESSAGE'
     EXPORTING
       ID              = I_MSG-MSGID
       LANG            = SY-LANGU
       NO              = I_MSG-MSGNR
       V1              = I_MSG-MSGV1
       V2              = I_MSG-MSGV2
       V3              = I_MSG-MSGV3
       V4              = I_MSG-MSGV4
     IMPORTING
       MSG             = W_STR
*  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.

    WRITE:/ i_msg-msgnr,w_str.




  endloop.

Regards,

Vishwa.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question