Application Development 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: 

BAPI_SALESORDER_CREATEFROMDAT2

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

3 REPLIES 3

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

Thanks John,

You solved my problem.

Alexandre Nogueira