on 05-20-2010 1:24 PM
Hi Friends,
How can I delete a SD pricing condition record using function modules? Is there any standard Function modules available for the same?
I just got a hint that It is possible using Function module RV_CONDITIONS_COPY .Is this the correct option?
Regards,
Abie
Hi Abie,
You can try to delete same conditions in an order sale with BAPI BAPI_SALESORDER_CHANGE with the next code:
select single knumv
into vbak-knumv
from vbak
where vbeln = p_vbeln_n.
if sy-subrc = 0.
select kposn zaehk stunr
appending corresponding fields of table it_condiciones
from konv
where kschl = 'ZDF'
and knumv = vbak-knumv.
clear iorder_cond_in.
refresh iorder_cond_in.
clear iorder_cond_inx.
refresh iorder_cond_inx.
clear iorder_hdr_inx.
refresh iorder_hdr_inx.
clear ilogic_switch.
refresh ilogic_switch.
clear ireturn.
refresh ireturn.
loop at it_condiciones.
clear iorder_cond_in.
iorder_cond_in-itm_number = it_condiciones-kposn.
iorder_cond_in-COND_ST_NO = it_condiciones-stunr.
iorder_cond_in-cond_count = it_condiciones-zaehk.
iorder_cond_in-cond_type = 'ZDF'.
append iorder_cond_in.
clear iorder_cond_inx.
iorder_cond_inx-itm_number = it_condiciones-kposn.
iorder_cond_inx-COND_ST_NO = it_condiciones-stunr.
iorder_cond_inx-cond_count = it_condiciones-zaehk.
iorder_cond_inx-cond_type = 'ZDF'.
iorder_cond_inx-updateflag = 'D'.
append iorder_cond_inx.
endloop.
clear iorder_hdr_inx.
iorder_hdr_inx-updateflag = 'U'.
append iorder_hdr_inx.
clear ilogic_switch.
ilogic_switch-cond_handl = 'X'.
append ilogic_switch.
call function 'BAPI_SALESORDER_CHANGE'
exporting
salesdocument = p_vbeln_n
order_header_inx = iorder_hdr_inx
logic_switch = ilogic_switch
tables
return = ireturn
conditions_in = iorder_cond_in
conditions_inx = iorder_cond_inx.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.