cancel
Showing results for 
Search instead for 
Did you mean: 

Start Routine

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (9)

Answers (9)

Former Member
0 Kudos

solved , thanks one and all

Former Member
0 Kudos

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 ..........

.......

Former Member
0 Kudos

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

Former Member
0 Kudos

i did simulate update and checked at that particular point ravi.

may be something fishy is going with that code .

thanks

roops

Former Member
0 Kudos

Are you getting any syntactical errors?

where do you think the code does not seem to work as intended in the debug mode?

Regards.

Former Member
0 Kudos

Activatw the update rules and load data. Lets see.

Ravi Thothadri

Former Member
0 Kudos

hi ravi

That simple code is not working . i have debugged that it's not recognising . there are no syntax errors.

Thanks

Roopa

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Where you give the cost element no, can you give them in single quotes.

Ravi Thothadri