‎2006 Mar 09 6:56 PM
Hi experts,
I'm facing a interesting problem using bapi BAPI_SALESORDER_CREATEFROMDAT2.
I'm creating a sales order with reference using this bapi, but, the document flow is not being mainteined...
Someone know why it happen ?
Alexandre Nogueira
‎2006 Mar 09 7:27 PM
In the Item table being passed into the BAPI...
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
ORDER_HEADER_IN = hdr
convert = 'X'
IMPORTING
SALESDOCUMENT = salesdoc
TABLES
return = ret_tbl
ORDER_ITEMS_IN = itm
ORDER_PARTNERS = prtnr
ORDER_ITEMS_inx = itmx
ORDER_CONDITIONS_IN = conds
ORDER_CONDITIONS_INX = condsx
order_schedules_in = schd_lin.
Make sure that you fill in:
Assigning ref doc to create line item entries in VBFA.
itm-REF_DOC = i_vakgu-vbeln. "ref doc
itm-REF_DOC_IT = i_vbap-posnr. "line item of ref doc
itm-REF_DOC_CA = 'B'. "doc type of ref doc
Reward points accordingly.
‎2006 Mar 09 7:24 PM
Hi,
Check out <a href="https://websmp202.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700008751302001">OSS Note 370988</a>.
CAUTION! Apparently the above referenced OSS Note is not completely correct. Creating with reference using this BAPI seems to work just fine as long as you include the ref doc as shown below.
I'm glad it worked for you.
Regards,
James G.
Message was edited by: James Gaddis
‎2006 Mar 09 7:27 PM
In the Item table being passed into the BAPI...
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
ORDER_HEADER_IN = hdr
convert = 'X'
IMPORTING
SALESDOCUMENT = salesdoc
TABLES
return = ret_tbl
ORDER_ITEMS_IN = itm
ORDER_PARTNERS = prtnr
ORDER_ITEMS_inx = itmx
ORDER_CONDITIONS_IN = conds
ORDER_CONDITIONS_INX = condsx
order_schedules_in = schd_lin.
Make sure that you fill in:
Assigning ref doc to create line item entries in VBFA.
itm-REF_DOC = i_vakgu-vbeln. "ref doc
itm-REF_DOC_IT = i_vbap-posnr. "line item of ref doc
itm-REF_DOC_CA = 'B'. "doc type of ref doc
Reward points accordingly.
‎2006 Mar 09 7:33 PM