Skip to Content

How to fill Net Price and Net Value at Quotation - Item Level with BAPI_CUSTOMERQUOTATION_CHANGE ?

Hello guys,

Could you please tell me why when I am using BAPI_CUSTOMERQUOTATION_CHANGE for creating quotation items and I want maintaining the net price and net value for a customer specific material using importing structures CONDITIONS_IN and CONDITIONS_INX , the bapi neither does not fill out the columns (the values remains zero), nor it's returning error below ?

LOOP AT lt_cond INTO ls_cond WHERE sd_doc = ls_items_info-doc_number AND itm_number = ls_items_info-itm_number.
IF ls_cond-cond_type IS NOT INITIAL.
MOVE-CORRESPONDING ls_cond TO ls_cond_in.
* CLEAR ls_cond_in-cond_count.
APPEND ls_cond_in TO lt_cond_in.

lr_descr ?= cl_abap_typedescr=>describe_by_data( ls_cond_inx ).
lt_details[] = lr_descr->components[].
LOOP AT lt_cond_in INTO ls_cond_in.
CLEAR ls_cond_inx.
LOOP AT lt_details INTO ls_comp.
CONCATENATE 'LS_COND_INX' '-' ls_comp-name INTO lv_field.
ASSIGN (lv_field) TO <fs>.
<fs> = 'X'.

ls_cond_inx-itm_number = ls_cond_in-itm_number.
ls_cond_inx-cond_st_no = ls_cond_in-cond_st_no.
ls_cond_inx-cond_count = ls_cond_in-cond_count.
ls_cond_inx-cond_type = ls_cond_in-cond_type.
ls_cond_inx-updateflag = 'U'. " insert
APPEND ls_cond_inx TO lt_cond_inx.

ls_header-updateflag = 'U'. " update
ls_logic_switch-cond_handl = 'X'.
ls_logic_switch-pricing = 'C'.
salesdocument = p_doc
quotation_header_inx = ls_header
logic_switch = ls_logic_switch
return = lt_return
quotation_item_in = lt_item_in
quotation_item_inx = lt_item_inx
conditions_in = lt_cond_in
conditions_inx = lt_cond_inx
schedule_lines = lt_sched_l
schedule_linesx = lt_sched_lx
quotation_text = lt_texts
extensionex = lt_ext_in.

The error is triggered when the field PRICING from structure LOGIC_SWITCH is not filled, but when I set it with C (- Copy manual pricing elements and redetermine the others ), item is created but the net value and net price is still zero ( not filled ).

Any opinion on this topic is highly appreciated !

Kind regards,


capture.jpg (65.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 22, 2018 at 07:23 PM

    "the bapi neither does not fill out the columns (the values remains zero), nor it's returning error below ?"

    If BAPI is not returning an error then where did you get the error messages in the screenshot? I'm confused...

    Assuming it's a case of "lost in translation" and you meant to say that the errors were returned by BAPI, I'd suggest to check if there is a long text for that "counter" message. Also if it says "counter must not be filled in" then maybe just don't fill it in your code? That would be ls_cond_inx-cond_count field.

    Otherwise you could probably set a watchpoint for this message in debugger and then see where exactly it occurs. I'm assuming here you've already read the documentation for BAPI and checked if there are any SAP notes for it.

    I'm also assuming that this is a valid scenario, i.e. pricing can be changed in the transaction VA22. Because BAPI cannot do something that is not possible in the transaction itself.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Jelena,

      I appreciate your answer. Indeed, the transaction VA22 has the behavior to not fill the Net Price and Net Value for this type of customer material I am using for my tests and therefore the user goes to fill it manually. But the option "Copy with reference" from VA21 is copying the values, so I assumed that this BAPI will fill out it too. But I can be mistaken, and this BAPI can do only what the VA22 can do, and not considering the "Copy with reference" scenario.

      Thanks a lot,