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: 

Error log in call Transaction C202

Former Member
0 Kudos

Hi friends,

I am working on BDC call transaction

C202

but my cleint asks me he dont want error log in BDCMSGCOLL by using BDC_OPEN_GROUP..

he wants one error log file for all the input file validations and BDC errors and he also needs Statastical report for all the errors and he is asking the error file in.XLS format.can u send me the sample code for this output.


like this:

· After execution of the batch input program, the following analysis regarding execution will be shown:


o Number of records in input file (including title, first line)

o Number of records successfully updated

o Number of records in error



Example:

Number of records in input file (incl. first line) 4

Number of records successfully updated: 3

Number of records in error:

0

1 REPLY 1

Former Member
0 Kudos

1)<b>Number of records in input file</b>

Once you get the data in an Internal Table say <i>it_data</i> using <b>GUI_UPLOAD</b>.

Ex:


DATA : it_data TYPE STANDARD TABLE OF mara WITH HEADER LINE,
       cnt TYPE i.

<b>DESCRIBE TABLE it_data LINES cnt.</b>


This variable <b>cnt</b> will give you the no of records.

2)<b>Number of records successfully updated:</b> and

<b>Number of records in error:</b>

*--Declare two variable

  DATA : errcnt  TYPE i,
         corrcnt TYPE i.

  CALL TRANSACTION c202
  USING    bdcdata
  MESSAGES INTO bdcmsgcoll.

*--After this read the table for any error messages

  READ TABLE bdcmsgcoll WITH KEY msgtyp = 'E'.  "Error

  IF sy-subrc EQ 0.

 
    errcnt  = errcnt  + 1.   "Error Count

  ELSE.

    corrcnt =     corrcnt + 1. "Correct Count 
    
  ENDIF.
  
*--Dont forget to clear and refresh the contents of Internal tables and <b>bdcmsgcoll</b> and <b>bdcdata</b> for every call transaction.

*--Then dispaly the results at the end

Regards,

<b>AS</b>

Message was edited by: Arun Sambargi