‎2008 May 07 3:10 PM
Hi,
I am using BDC (Batch Input Method) for updating one transaction from a file.I need to know, how will I get the error log once the session is processed? I need to get a count of the records successfully loaded, records rejected and time of load.I need to get them into an internal table.
( I want to use batch input itself and not call transaction method)
All inputs are valuable for me as this is very urgent.
Thanks in advance
Aparna Venugopal
‎2008 May 07 3:16 PM
Hi,
Goto Transaction code SM35 and select a session and click log button on the application tool bar. Aafter that again select session and click display button.
‎2008 May 07 3:21 PM
Hi
But I need to do this from the report itself.I should get the details of errors, for sending an error notification.
Thanks
Aparna
‎2008 May 07 3:23 PM
While using session method, you cannot get error messages into internal table.
But you can goto SM35 transaction, select the session and click on logs. Display the logs and dowmload into excel for furthur analysis.
Rewards if useful.
‎2008 May 07 3:31 PM
Hi ,
There is one alternative method for getting the success records or error records into internal tables.
Before you fill the BDCDATA structure, validate each and every madatory field and then populate the error or success internal tables and download later.
Suppose XK01 is the transaction . then
after uploading data from flat file to internal table, then each field is to be validated and if it fails then write the error to the error internal file.
eg: For a field LIFNR:
LOOP AT I_XK01 INTO WA_XK01.
TRANSLATE WA_XK01-LIFNR TO UPPER CASE.
READ TABLE I_LIFNR INTO WA_LIFNR WITH KEY LIFNR = WA_XK01-LIFNR.
IF SY-SUBRC = 0 .
CONCATENATE WA_MESG-MESG TEXT-100 WA_XK01-LIFNR TEXT-101 ' , ' INTO WA_MESG-MESG.
ENDIF.
ENDLOOP.
APPEND WA_MESG TO ERR_FILE.
here I_LIFNR is the internal table which was filled in initialization using "select lifnr from LFA1". so i am checking whether the LIFNR previously exists or not. if exists then sy-subrc value will be >1 then write the message "VENDOR NUMBER ALREADY EXISTS" into the error internal table
In this way, in the loop you will populate the error messages for all the mandatory fields into an error internal table.Put a condition that if the session was successfully processed then only the error internal table is downloaded to flat file.
Hope you got an idea.
Reward point if helpful.
Thanks and regards,
Narayana.
‎2008 May 07 3:39 PM
Narayana,
That is, you are simulating/expecting the error in a particular record. If we know a record going to fail , then we could correct it early. We don't know their input data and checking conditions.
I think this is not the right way to proceed.
‎2008 May 07 4:06 PM
Ravishanker is right, we cannot handle the errors in transaction.
If you need get that from report, best option is use Call transaction instead of session....