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

BAPI_SALESORDER_CREATEFROMDAT2

Former Member
0 Likes
814

Hi,

i am using BAPI_SALESORDER_CREATEFROMDAT2 to create an order with ref(Quotation number).

and i am passing

bapi_head-DOC_TYPE = 'ZORD'.

bapi_head-sales_org = '1000'.

bapi_head-distr_chan = '10'.

bapi_head-division = '20'.

bapi_head-REF_DOC = '0020000002'.

bapi_head-REFDOC_cat = 'B'.

bapi_item-material = 'T0001' .

bapi_item-TARGET_QTY = '20.000'.

bapi_item-REF_DOC = '0020000002'.

bapi_item-REF_DOC_IT = '000020'.

bapi_item-ref_doc_ca = 'B'.

append bapi_item.

bapi_ordpart-partn_role = 'AG'.

bapi_ordpart-partn_numb = '0000000011'.

append bapi_ordpart.

it is created successfully..but quantity is not stored in the table, as well in the transaction.

Can anybody help me...?

7 REPLIES 7
Read only

Former Member
0 Likes
758

Hi Mr.A,

after that bapi call BAPI_TRANSACTION_COMMIT.

it will work

Regards,

Chinna

Read only

Former Member
0 Likes
758

Are you filiiing ITEMX structure of BAPI and passing the same to BAPI.

Pass both below tables in bapi:

ORDER_ITEMS_IN STRUCTURE BAPISDITM OPTIONAL

ORDER_ITEMS_INX STRUCTURE BAPISDITMX OPTIONAL

Read only

Former Member
0 Likes
758

Pass the item number (posnr ) and quantity in ORDER_SCHEDULES_IN ( ITM_NUMBER and REQ_QTY fileds). then quantity will reflect in ur tansaction.

regards,

aswin.

Read only

0 Likes
758

Hi aswin,

But how do i get line item numbers prior to the execution of BAPI,

Read only

0 Likes
758

Try this way

Get the details of the Quotation using BAPI BAPISDORDER_GETDETAILEDLIST

Give Importing Parameter I_BAPI_VIEW = 'X' ( for all views )

In Table Parameters SALES_DOCUMENTS = QUOTATION NUMBER

This will return all the quotation details. Use this details to pass to FM BAPI_SALESORDER_CREATEFROMDAT2 to create Sales order

Hope this helps...

Read only

Former Member
0 Likes
758

hi ,

Did you missed append bapi_head.

check if useful.

Aditya Shrivastava

Read only

Former Member
0 Likes
758

Hi ,

Do fill the table ORDER_ITEMS_INX

Thanks,

Shailaja Ainala.