Application Development 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: 

In BDC,capturing total number of records

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I you are using Session method you can use the log, if you are using Call transaction you can declare a structure of type BDCMSGCOL and move the error message in the structure.

e.g. Call transaction VA01.. .messages into IT_BDCMSGCOL. With the internal table you can then create a report.

Regards,

Prashant

Edited by: Prashant Kumar Upadhyay on Oct 7, 2008 12:32 PM

3 REPLIES 3

Former Member
0 Kudos

Hi,

I you are using Session method you can use the log, if you are using Call transaction you can declare a structure of type BDCMSGCOL and move the error message in the structure.

e.g. Call transaction VA01.. .messages into IT_BDCMSGCOL. With the internal table you can then create a report.

Regards,

Prashant

Edited by: Prashant Kumar Upadhyay on Oct 7, 2008 12:32 PM

0 Kudos

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.

Former Member
0 Kudos

Hello,

After the FORMAT_MESSAGE FM is called, you can seggregate the Success & Failure Records with the Help of MSGTYP field. If it is 'E', then it is a Failure and populate the Table with Failure Records and Vice versa.

Thanks and Regards,

Venkat Phani Prasad Konduri