cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_CUSTOMERQUOTATION_CHANGE not updating conditions

bhavya_sri3
Participant
0 Kudos
1,104

Hello All,

I need to update the condition value of the item through the BAPI BAPI_CUSTOMERQUOTATION_CHANGE.

I have executed using Test Sequence of SE37 and called this BAPI & BAPI_TRANSACTION_COMMIT in a sequence and it is updating the vale correctly.

But though my method of the class, it is not updating the DB. But it is showing that conditions are updated successfully in lt_retuen.

I even tried calling SET UPDATE TASK LOCAL before the BAPI call but of no use.

Please suggest what else I'm missing here.

Thanks,

Bhavyasri M

Accepted Solutions (0)

Answers (3)

Answers (3)

bhavya_sri3
Participant
0 Kudos

Anymore suggestions please..

bhavya_sri3
Participant
0 Kudos

I am passing the below values for these two structures from the application.

ls_cond-itm_number = <Itm Number>
ls_cond-cond_st_no = '005'.
ls_cond-cond_count = '01'.
ls_cond-cond_type = 'ZOPP'.
ls_cond-cond_value = <amount>
ls_cond-currency = <currency>
APPEND ls_cond TO lt_cond.

ls_condx-itm_number = <Itm Number>

ls_condx-cond_st_no = '005'.

ls_condx-cond_count = '01'.
ls_condx-cond_type = 'ZOPP'.
ls_condx-updateflag = 'U'.
ls_condx-cond_value = 'X'.
ls_condx-currency = abap_true.
APPEND ls_condx TO lt_condx.

ls_cond-itm_number = <Itm Number>

ls_cond-cond_st_no = '006'.
ls_cond-cond_count = '01'.
ls_cond-cond_type = 'ZAOP'.
ls_cond-cond_value = <amount>

ls_cond-currency = <currency>

APPEND ls_cond TO lt_cond.

ls_condx-itm_number = <Itm Number>

ls_condx-cond_st_no = '006'.
ls_condx-cond_count = '01'.
ls_condx-cond_type = 'ZAOP'.
ls_condx-updateflag = 'U'.
ls_condx-cond_value = 'X'.
ls_condx-currency = abap_true.
APPEND ls_condx TO lt_condx.

SET UPDATE TASK LOCAL.
CALL FUNCTION 'BAPI_CUSTOMERQUOTATION_CHANGE'
EXPORTING
salesdocument = me->ms_data-id
quotation_header_inx = ls_flag_fields
logic_switch = ls_cond_switch
TABLES
return = lt_return
quotation_item_in = lt_item
quotation_item_inx = lt_itemx
conditions_in = lt_cond
conditions_inx = lt_condx
schedule_lines = lt_sched
schedule_linesx = lt_schedx
* quotation_text = lt_text
* quotation_cfgs_ref = lt_bapicucfg
* quotation_cfgs_refinst = lt_bapicuref
* quotation_cfgs_inst = lt_bapicuins
* quotation_cfgs_value = lt_bapicuval
extensionin = lt_extended_in
.

READ TABLE lt_return
WITH KEY type = 'E'
ASSIGNING <fs_return>.
IF NOT sy-subrc EQ 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true.

But when I am calling these from SE37 and they are working fine and updating the conditions.

kasralikarpratik
Explorer
0 Kudos

Are you passing both CONDITIONS_IN and CONDITIONS_INX? try passing all fields in CONDITIONS_IN table as much as you can.