Hi Everyone,
I have a keyfigure called " <b>Quantity</b> " and I would like to not update the quantity if my Characteristic CS_ITEM has a value "HEADCO" and Characteristic CURTYPE has a value "10". Can you please suggest some abap code in either update rule or start routine to skip or not update records if these values are present mentioned above.
Thanks
Asad
Hi:
write in start routine. its better.
Its very easy.
delete data_package where CS_ITEM = 'HEADCO' and
CURTYPE = '10'.
Message was edited by: Ram Chamarthy
Hi Asad,
do you just have one KF or more of them, and do you want this condition only for the Quanitity KF or all of them...reason to ask is that if you code in the Start Routine, it will apply to all the KF.
Hi:
Like bhanu asked, the COde will skip/delete records as you suggested.
If you only want to make Quantity = 0 and leave therest of the record as it is, then write this code in start routine.
loop at data_package where CS_ITEM = 'HEADCO' and
CURTYPE = '10'.
data_package-quantity = '0'.
modify data_package.
endloop.
Also, in my previos post, dont use " use singel quotes (')in ABAP Code as shown in this code.
Ram C.
Hi:
THe COde should still work. Don't mix this COde with old COde. Write after the old COde is finished.
<i>data : itab like DATA_PACKAGE occurs 1 with header line.
itab[] = DATA_PACKAGE[]. "copy all records to itab"
loop at DATA_PACKAGE into itab.
itab-/BIC/ZBALANCE = itab-BALANCE.
itab-/BIC/ZCURRENCY = itab-CURRENCY.
itab-/BIC/ZCurtype = itab-curtype.
append itab. "Add additional records
endloop.
refresh DATA_PACKAGE.
DATA_PACKAGE[] = itab[].</i>
Code-1:
delete data_package where CS_ITEM = 'HEADCO' and
CURTYPE = '10'.
OR
Code-2:
delete data_package where CS_ITEM = 'HEADCO' and
ZCURTYPE = '10'.
Try both these and tell me.
NOTE: Don't write both the Codes. Try Code-1 first. If it doesn't work, try COde-2.
Ram C.
Message was edited by: Ram Chamarthy
Add a comment