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
918

Hi All,

can anybody help me out...??? my problem is i am creating sales order by using BAPI_SALESORDER_CREATEFROMDAT2 function module.

in that i am using function module BAPISDORDER_GETDETAILEDLIST to get ORDER_CFGS_CUVALS_OUT.

and i am getting this error: " <b>A BS 001 No status object is available for SDI 0</b>"

Thanks.

Salil.

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
630

This sample program works very well for me. Maybe it will give you some hints.



report zrich_0003 .

data: view type order_view.

data: sd_docs type table of   sales_key with header line.
data: cuvals  type table of  bapicuvalm with header line.
parameters: p_vbeln type vbak-vbeln.

view-header = 'X'.
view-configure = 'X'.


sd_docs-vbeln = p_vbeln.
append sd_docs.



call function 'BAPISDORDER_GETDETAILEDLIST'
  exporting
    i_bapi_view                   = view
*   I_MEMORY_READ                 =
  tables
    sales_documents               = sd_docs
*   ORDER_HEADERS_OUT             =
*   ORDER_ITEMS_OUT               =
*   ORDER_SCHEDULES_OUT           =
*   ORDER_BUSINESS_OUT            =
*   ORDER_PARTNERS_OUT            =
*   ORDER_ADDRESS_OUT             =
*   ORDER_STATUSHEADERS_OUT       =
*   ORDER_STATUSITEMS_OUT         =
*   ORDER_CONDITIONS_OUT          =
*   ORDER_COND_HEAD               =
*   ORDER_COND_ITEM               =
*   ORDER_COND_QTY_SCALE          =
*   ORDER_COND_VAL_SCALE          =
*   ORDER_CONTRACTS_OUT           =
*   ORDER_TEXTHEADERS_OUT         =
*   ORDER_TEXTLINES_OUT           =
*   ORDER_FLOWS_OUT               =
*   ORDER_CFGS_CUREFS_OUT         =
*   ORDER_CFGS_CUCFGS_OUT         =
*   ORDER_CFGS_CUINS_OUT          =
*   ORDER_CFGS_CUPRTS_OUT         =
    order_cfgs_cuvals_out         = cuvals
*   ORDER_CFGS_CUBLBS_OUT         =
*   ORDER_CFGS_CUVKS_OUT          =
*   ORDER_BILLINGPLANS_OUT        =
*   ORDER_BILLINGDATES_OUT        =
*   ORDER_CREDITCARDS_OUT         =
*   EXTENSIONOUT                  =
          .

check sy-subrc = 0.

Regards,

Rich Heilman

Read only

0 Likes
630

Hey rich,

its working... but my problem is i need to create sales order using BAPI_SALESORDER_CREATEFROMDAT2 and in this if i am assigning this table then its not populating in sales order.

Suggest something...

Thanks.

Salil.

Read only

Former Member
0 Likes
630

Hi salil,

I Think the problem is that the Sales order is not created in the function module BAPI_SALESORDER_CREATEFROMDAT2.

You have to call the bapi BAPI_TRANSACTION_COMMIT after the first bapi is succesful or BAPI_TRANSACTION_ROLLBACK for not success.

Once you commit the transaction, then the sales doc is created and the subsequest call to the bapi BAPISDORDER_GETDETAILEDLIST, works without error.

REgards,

Ravi

Read only

0 Likes
630

Hi Ravi,

I am using BAPI_TRANSACTION_COMMIT. In this case my sales order has been created but i am not able to populate item configuration data.

Thanks.