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: 

SO creation

Former Member
0 Kudos
54

Hi all,

I am trying to create a sales order using 'BAPI_SALESORDER_CREATEFROMDAT2'.

i am passing the following values to the bapi.

- - -

- - -

lw_hd1-doc_type = 'TA'.

lw_hd1-sales_org = '1030'.

lw_hd1-distr_chan = '10'.

lw_hd1-division = '10'.

lw_hd1-purch_no_s = '1234'.

lw_hd1-po_dat_s = sy-datum.

lw_hd1x-updateflag = 'I'.

lw_hd1x-doc_type = 'X'.

lw_hd1x-sales_org = 'X'.

lw_hd1x-distr_chan = 'X'.

lw_hd1x-division = 'X'.

lw_hd1-purch_no_s = 'X'.

lw_hd1-po_dat_s = 'X'.

*populating the partner data.

lt_pr-partn_role = 'AG'.

lt_pr-partn_numb = '0000008000'.

APPEND lt_pr.

lt_itm-material = 'L0873'.

lt_itm-plant = '2502'.

lt_itm-val_type = '0304'.

lt_itm-target_qty = 10.

APPEND lt_itm.

lt_itmx-updateflag = 'I'.

lt_itmx-material = 'X'.

lt_itmx-plant = 'X'.

lt_itmx-val_type = 'X'.

lt_itmx-target_qty = 'X'.

APPEND lt_itmx.

*calling the bapi.

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

- - -

-- - -

By passing the same values in VA01 tcode i am able to create a sales order .

but when i try to create it using bapi its throwing following messages.

SALES_HEADER_IN has been processed successfully

SALES_ITEM_IN has been processed successfully

The sales document is not yet complete: Edit data

can any body pls tell me what is the data am missing ...

Thanks & Regards,

sandeep.

1 REPLY 1

Former Member
0 Kudos
32

Hi ,

You also have to fill the tables and structures .

ORDER_HEADER_INX

ORDER_ITEMS_INX

Also partners tables .

Please reward if useful.