Skip to Content
avatar image
Former Member

Sales Order header conditions

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'.

    sales_header_in     = ls_order
    testrun             = abap_true
    logic_switch        = ls_logic_switch
     sales_header_out = sales_header_out
     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,


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 19, 2017 at 11:05 AM

    I am not sure that I understand the question - I made a quick test in SE37 with this bapi (just added HA00 and HB00, the rest was automatically determined). In conditions_ex I have HA00 and HB00 both at header and at item level (in my case it is just a single item) plus whatever conditions were determined automatically on item level.

    I suppose that by header conditions you mean item totals (described in 876617 - FAQ: Header conditions/header condition screen), because real header conditions are always manual.

    The same note explains that item totals are generated dynamically after summation when you display the header conditions screen and are not saved to the database, which probably means that you won't find a suitable bapi that is not dialog-based which can get you exactly the same outcome.

    It is possible that I am wrong, because I do not work as a developer. :)

    Add comment
    10|10000 characters needed characters exceeded