Skip to Content
0
May 21, 2018 at 08:14 AM

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

802 Views Last edit May 22, 2018 at 10:57 AM 4 rev

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.
ENDIF.
ENDLOOP.

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.
IF lv_field NE 'LS_COND_INX-ITM_NUMBER' AND lv_field NE 'LS_COND_INX-COND_ST_NO'
AND lv_field NE 'LS_COND_INX-COND_COUNT' AND lv_field NE 'LS_COND_INX-COND_TYPE'.
ASSIGN (lv_field) TO <fs>.
<fs> = 'X'.
ENDIF.
ENDLOOP.

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

ls_header-updateflag = 'U'. " update
ls_logic_switch-cond_handl = 'X'.
ls_logic_switch-pricing = 'C'.
CALL FUNCTION 'BAPI_CUSTOMERQUOTATION_CHANGE'
EXPORTING
salesdocument = p_doc
quotation_header_inx = ls_header
logic_switch = ls_logic_switch
TABLES
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,

Andreea

Attachments

capture.jpg (65.7 kB)