08-05-2006 12:23 PM
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..
o Number of records in input file (including title, first line)
o Number of records successfully updated
o Number of records in error
Number of records in input file (incl. first line) 4
Number of records successfully updated: 3
Number of records in error:
08-05-2006 12:38 PM
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