2006 Jan 18 3:43 PM
Hi guys
Im working on batch input program. I have record and then pass my internal table. In a net shell its working fine. Id like to know what else we can put in batch input program from LOG stand point. For example I have put the one sub routine showed error log and other sub routine send an email to recipient.
What else could be the beneficial, or what is the normal practice. I just want that BDC program should give sensible information from user stand point.
Please give your suggestion.
Thanks
2006 Jan 18 3:48 PM
Hi Suleman,
Additional things you can do to you BDC program is
1) to do a call transaction for all the uploaded records.
2) For error records,by checking sy-subrc value for call transaction, you can do a BDC session method.
3) Process the BDC session so that the user can have a very useful Error log and that too in SAP provided format(SM35).
4) If you don't want steps 2 nad 3, you can use
FORMAT_MESSAGE function module to create meaningful messages out of messhage variables and display as a report.
5) As you have mentioned, you can mail the erroneous records to the User using SO_NEW_DOCUMENT_SEND_API1 FM.
REgards,
Ravi
Hi!
You can also include BDCRECX1 into your report and let all the message handling and error map creation do the standard code.
Regards,
Christian
2006 Jan 18 3:47 PM
Usually when programming a BDC, I will throw an ALV grid after all processing which shows all of the transactions and the status of the transaction( Successfully or Error). If there is an Error, I will give the first error message which was encountered during processing of that transaction.
Regards,
Rich Heilman
2006 Jan 18 3:48 PM
Hi Suleman,
Additional things you can do to you BDC program is
1) to do a call transaction for all the uploaded records.
2) For error records,by checking sy-subrc value for call transaction, you can do a BDC session method.
3) Process the BDC session so that the user can have a very useful Error log and that too in SAP provided format(SM35).
4) If you don't want steps 2 nad 3, you can use
FORMAT_MESSAGE function module to create meaningful messages out of messhage variables and display as a report.
5) As you have mentioned, you can mail the erroneous records to the User using SO_NEW_DOCUMENT_SEND_API1 FM.
REgards,
Ravi
2006 Jan 18 3:52 PM
Hi Suleman,
You can use the collection of messages which are populated during the message run.
This can be achieved like
DATA: BDCDATA TYPE TABLE OF BDCDATA.
DATA: ITAB TYPE TABLE OF BDCMSGCOLL.
CALL TRANSACTION 'SE38' USING BDCDATA MODE 'N'
MESSAGES INTO ITAB.
Now you can use the messages in your itab to put it as a log or send it as a content of a mail during the BDC run.
Cheers
JK
PS: Award points if this helps you.
2006 Jan 18 4:34 PM
Hi!
You can also include BDCRECX1 into your report and let all the message handling and error map creation do the standard code.
Regards,
Christian
2006 Jan 18 5:07 PM
Can you guys also tell me how can I bulid error ,Warning and message in my BDC program ..The wasy SM35 showed it . I mean What emplyee has error .. etc ...
Thank you all for your inputs.
Bye
Message was edited by: Suleman Javed
2006 Jan 26 4:22 PM
Hi ,
You can use FM FORMAT_MESSAGE to format your message & display them as report.
After call transaction check for Sy-subrc & move the message into one internal table accordingly checking for the message type('E','W', 'I' etc) & formating with the FM mentioned & then write them as report.
2006 Jan 26 4:47 PM
That`s I know .. I mean to say .. when we process session in SM35 and when we get error log ..it shows as the recored number and log , where , how , where it fails .. so we can go to that screen block and re-process our REC...
I want to show these kind of messages in my BDC log ...
Thanks
2006 Jan 26 4:50 PM
Hi,
Record no.,you can get from SY-TABIX & save it in the internal table. & the rest of the log you can get from the message internal table.
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |