‎2008 Jul 03 10:45 AM
if i want to upload more no of data, which method is preferred?...whether session method or call transaction?...if call transaction i choose, how can i face the error if occurs?
‎2008 Jul 03 11:07 AM
Hi,
In BDC Call Transaction method to handle the errors we are declaring a internal table like
DATA : IT_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
CALL TRANSACTION 'MM01' USING IT_BDCDATA MODE 'N' UPDATE 'S'
MESSAGES INTO IT_MESSAGES.
IF SY-SUBRC 0.
Using the FM 'FORMAT_MESSAGE' by passing the message no, and message id we can change the error message into a text format.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = SY-MSGID
LANG = '-D'
IMPORTING
MSG = V_MESG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
LOOP AT IT_MESSAGES WHERE MSGTYP = 'E'.
WRITE : / 'Message :'(I06) ,V_MESG.
CLEAR IT_MESSAGES.
ENDLOOP.
ENDFORM. " ERROR_MESSAGES
Hope this helps you.
Reward points if helpfull.
Thanks & Regards,
Y.R.Prem Kumar
‎2008 Jul 03 10:47 AM
For error records use BDC , and then handle using the SM35 transaction.
‎2008 Jul 03 10:53 AM
Hi,
my question is, to upload more no of data, which methid is best? and while any error occurs during the uploading how do we know that in call transaction method?
‎2008 Jul 03 10:56 AM
you can go for combination
if any error occurs add the error record to session, else process the record using call transaction method.
you can find the successfull ness of the call transaction using sy-subrc accordingly you can code.
‎2008 Jul 03 10:58 AM
hi subhash...
The combination is always termed as best.
And regarding error handling in call transaction... i guess you posted another thread ... just go through that... you will get your answer
regards
padma
‎2008 Jul 03 11:01 AM
Hi
In Call Transaction we have handle the errors explicitly.
means put messages into BDCMSGCOLL and call the function FORMAT_MESSAGE
pass the messages int table in the function module.
Then LOOP the Int table, using case when MSGTYP = 'E',
we can print the errors.
Hope this will help u lot..........
‎2008 Jul 03 12:09 PM
Hi ,
I have more no of data in my excel sheet like 10000 data...now how to upload it into SAP...I have to decide BDC or LSMW method..if its BDC, which method would be preferable ie.,Session method or call transaction method? and the reason behind that
‎2008 Jul 03 10:52 AM
Hi subhash.
Go with session method if you have huge amount of data... regarding errors you can check in sm35 in session method and in call transaction you have structure bdcmsgcoll
regards
padma
‎2008 Jul 03 11:07 AM
Hi,
In BDC Call Transaction method to handle the errors we are declaring a internal table like
DATA : IT_MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
CALL TRANSACTION 'MM01' USING IT_BDCDATA MODE 'N' UPDATE 'S'
MESSAGES INTO IT_MESSAGES.
IF SY-SUBRC 0.
Using the FM 'FORMAT_MESSAGE' by passing the message no, and message id we can change the error message into a text format.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = SY-MSGID
LANG = '-D'
IMPORTING
MSG = V_MESG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
LOOP AT IT_MESSAGES WHERE MSGTYP = 'E'.
WRITE : / 'Message :'(I06) ,V_MESG.
CLEAR IT_MESSAGES.
ENDLOOP.
ENDFORM. " ERROR_MESSAGES
Hope this helps you.
Reward points if helpfull.
Thanks & Regards,
Y.R.Prem Kumar