Skip to Content
0
Former Member
May 20, 2014 at 11:16 PM

RV_CONDITION_COPY FOR CHANGE MODE

2769 Views

Hi All,

I am not able to use RV_CONDITION_COPY to change existing quantity scale and amount. When I use it generates new condition record number ( KNUMH ) and don't update existing condition record number though I am passing existing condition record number ( KNUMH ).

Can anyone please tell how to handle change condition record using RV_CONDITION_COPY. What parameters needed to be passed.

I am using below code

DATA: cr LIKE TABLE OF komv WITH HEADER LINE,

nr,

key_fields LIKE TABLE OF komg WITH HEADER LINE,

komk LIKE TABLE OF komk WITH HEADER LINE,

komp LIKE TABLE OF komp WITH HEADER LINE,

i_kona TYPE kona.

lv_knona TYPE knuma VALUE '0000001475'.

DATA: copy_staffel LIKE TABLE OF condscale WITH HEADER LINE.


SELECT SINGLE *

FROM kona

INTO i_kona

WHERE knuma = lv_knona.


key_fields-field1 = '123'.

key_fields-field2 = 'ABC'.


cr-kappl = 'V'.


cr-kschl = 'ZR13'.

cr-krech = 'A'.

cr-waers = '%'.

cr-kopos = 1.

cr-kzbzg = 'C'.

cr-konms = 'EA'.

cr-stfkz = 'A'.

cr-knumh = '0002218831'.

APPEND cr.

* - Fill Scales

*- Scale Item 1

copy_staffel-klfn1 = '0001'.

copy_staffel-kopos = '01'.

copy_staffel-kstbm = '13'.

copy_staffel-kbetr = '26'. " Scale Price

copy_staffel-kzbzg = 'C'.

copy_staffel-rv13akonwa = 'EUR'.

copy_staffel-konpkmein = 'EA'.

copy_staffel-konpkonms = 'EA'.

APPEND copy_staffel.



*- Scales item 2

copy_staffel-klfn1 = '0004'.

copy_staffel-kopos = '01'.

copy_staffel-kstbm = '15'.

copy_staffel-kbetr = '30'. " Scale Price

copy_staffel-kzbzg = 'C'.

copy_staffel-rv13akonwa = 'EUR'.

copy_staffel-konpkmein = 'EA'.

copy_staffel-konpkonms = 'EA'.

APPEND copy_staffel.

 

MOVE-CORRESPONDING key_fields TO komk.

komk-mandt = sy-mandt.

*- Fill KOMP

MOVE-CORRESPONDING key_fields TO komp.

komp-kposn = '000001'.



 


CALL FUNCTION 'RV_CONDITION_COPY'


EXPORTING


application = 'V'


condition_table = '853'


condition_type = 'ZR13'


date_from = '20140501'


date_to = '20140531'


enqueue = 'X'


i_komk = komk


i_komp = komp


key_fields = key_fields


maintain_mode = 'A'


no_authority_check = 'X'


keep_old_records = 'X'


used_by_idoc = 'X'


i_kona = i_kona


overlap_confirmed = 'X'


IMPORTING


e_komk = komk


e_komp = komp


new_record = nr


TABLES


copy_records = cr


copy_staffel = copy_staffel


EXCEPTIONS


enqueue_on_record = 01


invalid_application = 02


invalid_condition_number = 03


invalid_condition_type = 04


no_authority_ekorg = 05


no_authority_kschl = 06


no_authority_vkorg = 07


no_selection = 08


table_not_valid = 09.


 


CALL FUNCTION 'RV_CONDITION_SAVE'


COMMIT WORK AND WAIT.



CALL FUNCTION 'RV_CONDITION_RESET'.