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

problem with BAPI_SALESORDER_CREATEFROMDAT2

Former Member
0 Likes
528

Hi All

I'm trying to create a sales order using BAPI_SALESORDER_CREATEFROMDAT2 but the return message is giving as follow

FB call: insufficient parameters I has fill all mandatory fields.

Please find my below code and suggest if any thing is missing.

wa_order_partners-partn_role = 'AG'.

wa_order_partners-partn_numb = '0003101888'.

**wa_order_partners-itm_number = '000000'.

*

append wa_order_partners to it_order_partners.

clear : wa_order_partners,kna1,adrc.

wa_order_items_in-material = 'DFX-7100'.

wa_order_items_inx-material = 'X'.

wa_order_items_in-itm_number = '000010'.

wa_order_items_inx-itm_number = '000010'.

wa_order_items_in-plant = 'MWMU'.

wa_order_items_inx-plant = 'X'.

wa_order_items_in-target_qty = '1'.

wa_order_items_inx-target_qty = 'X'.

wa_order_items_in-sales_unit = 'EA'.

wa_order_items_inx-sales_unit = 'X'.

wa_order_items_inx-updateflag = 'I'.

append wa_order_items_in to it_order_items_in.

append wa_order_items_inx to it_order_items_inx.

*----


  • Build Schedule lines... Order Quantity

*----


clear: l_order_schedules_in,

l_order_schedules_inx.

l_order_schedules_in-itm_number = '000010'.

l_order_schedules_inx-itm_number = '000010'.

l_order_schedules_in-req_qty = '1'.

l_order_schedules_inx-req_qty = 'X'.

l_order_schedules_inx-updateflag = 'X'.

append l_order_schedules_in .

append l_order_schedules_inx.

*----


  • Build Conditions

*----


clear: l_order_conditions_in,

l_order_conditions_inx.

l_order_conditions_in-itm_number = '000010'.

l_order_conditions_in-cond_count = '01'.

l_order_conditions_in-cond_type = 'ZMTS'.

l_order_conditions_in-cond_value = '11'.

l_order_conditions_inx-updateflag = 'U'.

l_order_conditions_inx-itm_number = '000010'.

l_order_conditions_inx-cond_count = '01'.

l_order_conditions_inx-cond_type = 'ZMTS'.

l_order_conditions_inx-updateflag = 'X'.

l_order_conditions_inx-cond_value = 'X'.

append l_order_conditions_in .

append l_order_conditions_inx .

Rest of all condition come through pricing prcedure.

call function 'BAPI_SALESORDER_CREATEFROMDAT2'

exporting

  • SALESDOCUMENTIN =

order_header_in = wa_order_header_in

order_header_inx = wa_order_header_inx

  • SENDER =

  • BINARY_RELATIONSHIPTYPE =

  • INT_NUMBER_ASSIGNMENT =

  • BEHAVE_WHEN_ERROR =

logic_switch = wa_logic_switch

  • TESTRUN =

  • CONVERT = ' '

importing

salesdocument = lv_vbeln

tables

return = lv_ret

order_items_in = it_order_items_in

order_items_inx = it_order_items_inx

order_partners = it_order_partners

order_schedules_in = l_order_schedules_in[]

order_schedules_inx = l_order_schedules_inx[]

order_conditions_in = l_order_conditions_in[]

order_conditions_inx = l_order_conditions_inx[]

  • ORDER_CFGS_REF =

  • ORDER_CFGS_INST =

  • ORDER_CFGS_PART_OF =

  • ORDER_CFGS_VALUE =

  • ORDER_CFGS_BLOB =

  • ORDER_CFGS_VK =

  • ORDER_CFGS_REFINST =

  • ORDER_CCARD =

  • ORDER_TEXT =

  • ORDER_KEYS =

  • EXTENSIONIN =

  • PARTNERADDRESSES =

.

Thanks and Regards,

Nagu

Edited by: emax nagu on Feb 1, 2012 5:38 PM

1 REPLY 1
Read only

Former Member
0 Likes
378

Hi Nagu,

I looked over your code very quickly and noticed one thing. 'X' is not a valid value for the updateflag.

l_order_schedules_inx-updateflag = 'X'.

Regards,

Brenda