02-11-2010 7:18 AM
Hi ,
I have written on BDC where I am creating the sale orders, bu I would like to konw how to get the sale orders created.
belos is sample code.
Loop itab.
BDC processing.
Call transaction va01.
***here I need to get the created order number above.
endloop.
Regards,
vinesh
02-11-2010 7:24 AM
Hello Vinesh,
Simulate the VA01 trxn once & when the order is successfully created a success message is generated. Capture the success message number.
Call transaction va01 MESSAGES INTO it_msg.
From this table it_msg, get the message which is generated from VA01 & from there you will get the Order Number.
BR,
Suhas
02-11-2010 7:20 AM
Hi,
Check the Structure SYST or you can also capture succes message in Retirn table of BDC.
PS: Prefer BAPI/FM to create Sales order than BDC
Cheers,
Nag
02-11-2010 7:24 AM
Hello Vinesh,
Simulate the VA01 trxn once & when the order is successfully created a success message is generated. Capture the success message number.
Call transaction va01 MESSAGES INTO it_msg.
From this table it_msg, get the message which is generated from VA01 & from there you will get the Order Number.
BR,
Suhas
02-11-2010 8:47 AM
try to done it by BAPI..instead of BDC..
for BDC trap all messages and read message type S there you will get no.
02-11-2010 10:24 AM
Hi,
After completion of BDC execution, write a select statement on VBAK
to get VBELN where ERDAT = sy-datum and ERNAM = sy-uname.
May be in this way you can get the desired output.
Regards.
Sarbajit.
02-11-2010 10:43 AM
data: it_msg type standard table og bdcmsgcoll,
lf_msg type string.
loop at it_msg into wa_msg.
call function format_message
exporting
id = wa_msg-msgid
lang = sy-langu
no = wa_msg-msgnr
v1 = wa_msg-msgv1
v2 = qa_msg-msgv2
v3 = wa_msg-msgv3
v4 = wa_msg-msgv4
importing .
msg = lf_msg.
try with this peace of code.
Regards,
Raji
02-11-2010 10:49 AM
call transaction va01 messages into it_msg. " internal table to capture the messages.
2 messages will be created.
capture the one with msgtype 'S'.
and capture the variabel msgv1.
call function format_message
exporting
id = wa_msg-msgid
lang = sy-langu
no = wa_msg-msgnr
v1 = wa_msg-msgv1
v2 = qa_msg-msgv2
v3 = wa_msg-msgv3
v4 = wa_msg-msgv4
importing .
msg = lf_msg.
regards,
sakshi