on 10-13-2006 4:57 PM
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:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guys,
Perhaps I should have told you that there's already a start routine there. It seems like records are being copied to another field and that includes Curtype field. I added a code in there but it didn't do anything.
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.
<b>if itab-/BIC/ZCurtype = '10' and itab-CS_ITEM = 'HEADCO'.
<b>delete DATA_PACKAGE.</b> Endif.</b>
append itab. "Add additional records
endloop.
refresh DATA_PACKAGE.
DATA_PACKAGE[] = itab[].
Can you please let me know if this routine is causing the problem? ( I mean when want to delete or not update Quantity where curtype is '10' and CS_ITEM = 'HEADCO', it's not allowing me. I am a novice in ABAP and your help is much appreciated. Thanks and looking forward for your response.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.