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

Change the constant value

Former Member
0 Likes
3,360

hi,

I am working on one userexit and in that userexit I want to change the constant value. can anyone tell me how can i chage the constant vale. As far as I know we can not chage. Is it true?

thanks

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,498

If you mean changing the value at runtime, or in debug, no you can't, that's why it is a constant. but if you want to change the value at design time, then you simply navigate to the CONSTANT statement and change the value there.

Regards,

RIch Heilman

Read only

Former Member
0 Likes
1,498

Hello Manankumar,

U can't change the value of the Constants:

Since the value for the constants is passed during the declaration itself.

DATA: LV_CON TYPE I VALUE 10.

So in this example we can change the value of the field LV_CON for the whole execution of the report.

Thanks !!

Vasanth

Read only

Former Member
0 Likes
1,498

Hi,

We can't change the Constants Value.

It may be used in so many places. If at all you change that, it may effect other code also.

So findout using that field where used list, and if it is not used anywhere then you can change.

Regards,

Anji

Read only

Former Member
0 Likes
1,498

Yes cannot change a contanst value .

Constants mean a set value which is not changed at all.

The content of a constant cannot be changed at runtime of an ABAP program. You can only use it as an operands in read positions of ABAP statements. Constants that you declare in the declaration section of a class or an interface belong to static attributes of that class/interface.

Please reward if useful.