on 06-07-2007 11:01 PM
Hi Gurus,
I have limited knowledge with ABAP.
i need to write a code at update rules start routine level.
my code is as follows .
LOOP AT DATA_PACKAGE.
case DATA_PACKAGE-COSTCENTER.
when'204'.
Delete : DATA_PACKAGE where COSTELMNT GE 611000 and COSTELMNT LE
613999.
WHEN '205'.
Delete : DATA_PACKAGE where COSTELMNT GE 611000 and COSTELMNT LE
613999.
when'206'.
Delete : DATA_PACKAGE where COSTELMNT GE 611000 and COSTELMNT LE
613999.
WHEN '217'.
Delete : DATA_PACKAGE where COSTELMNT GE 611000 and COSTELMNT LE
613999.
endcase.
endloop.
i am not sure i went wrong. i debugged the code at update rules using simulate update . when costcenter = 204 then it should perform the delete statement. but it's comming out. can any one give me que on this
Thanks
Roopa
You don't need a loop. Just use one delete statement similar to the following.
Delete DATA_PACKAGE where COSTELMNT GE '611000' and COSTELMNT LE
'613999' and ( costcenter = '204' or costcenter = '206' or ... ).
...
Message was edited by:
Rick Chau
Message was edited by:
Rick Chau
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
solved , thanks one and all
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi roopa ,
here is a samplre code with case statment
CASE SY-TCODE.
WHEN 'RSD1' OR 'ZODS'.
I_S_DIAL_PARAM-IOBJTP = RSD_C_OBJTP-CHARACT.
CALL DIALOG 'RSDG_TRAN_IOBJ_MAINTAIN'
WHEN 'RSD2'.
I_S_DIAL_PARAM-IOBJTP = RSD_C_OBJTP-KEYFIGURE.
CALL DIALOG 'RSDG_TRAN_IOBJ_MAINTAIN'
ENDCASE.
If possible take the value of DATA_PACKAGE-COSTCENTER in a separate variable and use that variable in the case statment.
eg:- var1 = DATA_PACKAGE-COSTCENTER.
case var1.
when ..........
.......
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dash,
As per my first post in this thread
There are not syntax errors. i have debugged the code at update rules level.
when data_package = 204
As per code it must to next line and delete datapackage as per condition.
but i could see cursor go to endloop.
so it's not working. if you have any code which suits my criteria . can you please paste code so that it is very helpfull.
Thanks
Roopa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i did simulate update and checked at that particular point ravi.
may be something fishy is going with that code .
thanks
roops
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Activatw the update rules and load data. Lets see.
Ravi Thothadri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ravi
That simple code is not working . i have debugged that it's not recognising . there are no syntax errors.
Thanks
Roopa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok. Lets do this.
Comment all other lines. Lets do for this:
Delete DATA_PACKAGE where COSTELMNT GE '611000' and COSTELMNT LE '613999'
Before activating the update rules, click the check button to check the syntax.
Lets make the code work for this and we will expand.
Ravi Thothadri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi
still it not working, i don't know what is the reason still it's not going in to case statement.
Thanks
roopa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where you give the cost element no, can you give them in single quotes.
Ravi Thothadri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.