cancel
Showing results for 
Search instead for 
Did you mean: 

delete SD pricing Condition

Abie
Explorer
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member562530
Active Participant
0 Kudos

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.

Abie
Explorer
0 Kudos

Hi Gabriel,

Thanks for the reply.

My aim is to set the field LOEVM_KO (deletion indicator) of table KONP to 'X' using some function modules so that the status of condition record number(KNUMH) will be deleted.

Is there any way to do the same.

Regards,

Abie

arunprakash_karuppanan
Active Contributor
0 Kudos

Hi,

Are you talking about the R/3 system? If so, you could have posted this in the Sales and Dist forum.

In CRM, you can use the FM, "CRMXIF_COND_REC_SLIM_SAVE".

For R/3, there's an useful thread here.

[]

Reg,

Arun Prakash

former_member562530
Active Participant
0 Kudos

Hi Abie,

The ABAP Team did not find any function in order to change this field.

Did you try to create a new function to set this value?

Regards,

Gabriel Santana

Abie
Explorer
0 Kudos

Hi Gabriel,

I didnt find any specific FM for deletion.I am trying the option of batch input.

Regards,

Abie