01-19-2010 5:49 AM
HI,
I am working on RFC's. I need to create a sales order from one system to other.
I created a BDC using SHDB transaction and created a function module for it. i able to create a sales order but i should be able to retrieve the sales order number too so that i can make use of it in RFC Program.
Can anyone tell me how to find out the sales order number using a function module??
regards
Ramakanth
01-19-2010 5:56 AM
hi
In bdc you can get the messages from this
l_tab_messtab TYPE TABLE OF bdcmsgcoll,
PERFORM bdc_transaction TABLES lt_messtab USING 'VA01' g_ctu g_mode g_update
CALL FUNCTION 'CONVERT_BDCMSGCOLL_TO_BAPIRET2'
TABLES
imt_bdcmsgcoll = l_tab_messtab
ext_return = et_message_return.
BAPI_SALESORDER_GETLIST for get the SO based on the Customer
01-19-2010 6:14 AM
Hi,
You can populate your return messages from BDC using this FM 'MESSAGE_TEXT_BUILD'.
Here, the parameter MSGV2 will return the sales order number that is created
01-19-2010 12:15 PM
Hi ,
Use This BAPI To Create Sales Order.Goto se37 and enter this BAPI & check it will work.BAPI is RFC Enabled Function Module.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN =
ORDER_HEADER_IN = bapi_head
ORDER_HEADER_INX = bapi_headx
IMPORTING
SALESDOCUMENT = SALESDOCUMENT
TABLES
RETURN = it_ret1
ORDER_ITEMS_IN = it_item
ORDER_ITEMS_INX = it_itemx
ORDER_PARTNERS = it_parnr
ORDER_SCHEDULES_IN = it_sched
ORDER_SCHEDULES_INX = it_schedx
EXTENSIONIN = it_extensionin
.
Regards,
Manesh.R
01-19-2010 12:54 PM
Hi,
As suggested; do not use a BDC, use the BAPI instead.
Regards,
Ankur Parab
01-19-2010 1:16 PM
Hi ,
It is better to use th BAPI BAPI_SALESORDER_CREATEFROMDAT2 instead of going for FM.
Read the documentation before using this.
Regards,
Bharani
01-25-2010 2:12 PM
Hi,
You can use BAPI_SALESORDER_SIMULATE , BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2.
It will work fine.
Regards