Skip to Content
0
Former Member
Dec 18, 2017 at 01:19 PM

Sales Order header conditions

1131 Views Last edit Dec 19, 2017 at 08:45 AM 2 rev

Hi Experts,

I am simulating a price calculation of a sales order using SD_SALESDOCUMENT_CREATE with flag test_run = true. This is working fine, however I don't get the pricing conditions of the sales order head. Result table conditions_ex only contains order position conditions and manually added header conditions. The net price is calculated (field NET_VAL_HD) as well.

Is there any way to get the header conditions for an unsaved sales order?

This is how I call the function module:

ls_logic_switch-pricing = ' '.
ls_logic_switch-cond_handl = 'X'.

CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
  EXPORTING
    sales_header_in     = ls_order
    testrun             = abap_true
    logic_switch        = ls_logic_switch
  importing
     sales_header_out = sales_header_out
  TABLES
     return              = lt_bapiret2
     sales_items_in      = lt_orderitems
     sales_schedules_in  = lt_schedules
     sales_conditions_in = lt_conditions
     sales_partners      = lt_partners
     partneraddresses    = lt_addresses
     items_ex            = lt_orderitems_out
     conditions_ex       = lt_conditions_out
     conditions_konv_ex  = lt_konv_out.

Thanks for your help,

Gerry