Application Development and Automation 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: 
Read only

regarding BDC

Former Member
0 Likes
833

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?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
817

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

8 REPLIES 8
Read only

Former Member
0 Likes
817

For error records use BDC , and then handle using the SM35 transaction.

Read only

0 Likes
817

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?

Read only

0 Likes
817

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.

Read only

0 Likes
817

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

Read only

0 Likes
817

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..........

Read only

0 Likes
817

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

Read only

Former Member
0 Likes
817

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

Read only

Former Member
0 Likes
818

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