Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Obsolete statement

Former Member
0 Likes
2,603

Hi friends,

I have used the statement:

"ON CHANGE OF........ENDON." in my program.

during extended check in program.... this satement is showing as obsolete statement error.

The error is as follows:

" The current ABAP command is obsolete and problematic, especially so in ABAP

Objects

"ON CHANGE OF ... ENDON" is not supported in the OO context."

Can you give any way to get rid of this? What can i use instead of this statement?

As this is very necessary in my program. I am not finding any solution.

Please help me out....

Thanks,

Chinmay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,540

Use

at new <field>.

endat.

as an alternative.

Regards,

Ravi

7 REPLIES 7
Read only

Former Member
0 Likes
1,540

Hai Chimay

Use At NewEnd At. instead of On changeendon.

Thanks & Regards

Sreenivasulu P

Read only

Former Member
0 Likes
1,540

Hi Chinmay,

You can use At New. But for this it would be better if that field is the first field in the internal table.

Thanks and Regards,

Bharat Kumar Reddy.v

Read only

Former Member
0 Likes
1,540

HI

GOOD

WHAT VERSION YOU R USING NOW ,IT SHOULD NOT GIVE IN 4.6C OR ABOVE,IF STILL YOU R GETTING ANY ERROR IN EXTENDED CHECK THAN ITS NOT AN ERROR BUT A WARNING.YOU CAN GO AHEAD WITH THAT AND YOU WILL GET THE CORRECT RESULT.

THANKS

MRUTYUN

Read only

Former Member
0 Likes
1,541

Use

at new <field>.

endat.

as an alternative.

Regards,

Ravi

Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,540

on change of is obsolete statement so u r getting this message,

use at new to get rid of this.

or else if at new doesnot solve ur problem,

see the following

The pseudo control structure ON CHANGE OF - ENDON is not allowed in ABAP Objects.

Error message in ABAP Objects if the following syntax is used:

ON CHANGE OF f.

...

ENDON.

Correct syntax:

DATA g LIKE f.

IF f <> g.

...

g = f.

ENDIF.

Reason:

A global invisible work field over which the program has no control is created internally. A separate work field should be declared and processed using the IF control structure.

Read only

Former Member
0 Likes
1,540

Hi chinmay,

u can use at new <fd>... endat or at end of <fd>... endat whichever is suitable for ur case.

Award points if helpful.

regards,

keerthi.

Read only

sbhutani1
Contributor
0 Likes
1,540

Hi Chinmay

Dont use ON change of because SAP is not supporting this in later versions.

Instead of On change you can use at new and end at

It will work correctly.

Regards

Sumit Bhutani