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

Debug - Replacing constant values

Former Member
0 Likes
4,157

Anyone know if there is a way to replace a value in debug of a data item declared as a constant ?

8 REPLIES 8
Read only

Former Member
0 Likes
1,912

Hi Paul,

I don't think there is any way to do that.

Thats is one of the major differences between a variable and a Constant.

Regards,

Ravi

Read only

venkata_ramisetti
Active Contributor
0 Likes
1,912

Paul,

It is not possible to change the constant value in the debugging mode. Instead you can modify the value after assigned to some other variable.

Thanks,

Ramakrishna

Read only

Former Member
0 Likes
1,912

Hi Paul,

There is no way of replacing a value assigned to a constant in debug mode.

There is a work around only for testing:

If you are debugging a Zprogram, then you can create a variable and assign the constant to a variable and use this variable wherever you want to change the value in debug mode.

Hope it helps...

Lokesh

Pls. reward appropriate points

Read only

Former Member
0 Likes
1,912

hey Paul,

Instead of changing that constant value

U can change the value of the variable to which Ur comparing with that constant

for Ex : x = 5 is ur constant

compare the value of the variable .

Read only

0 Likes
1,912

change the value of the variable to which U want to compare with that constant

Read only

Former Member
0 Likes
1,912

The problem is, I have a submit of another abap in the debugged program, one of the parameters for this submit is the user which is being set with a constant value. The user in the constant value, does not have appropriate authorisation to perform the task in the submitted program, so I wanted to be able to change it in debug.

SUBMIT ZBXXXXXXXX

USER C_USER <--- constant value containing user

VIA JOB P_JOBNAME

NUMBER P_JOBNUM

WITH P_KEY IN INDEXKEY

WITH P_JOB EQ P_JOBNUM

AND RETURN.

If I can't change the value of C_USER then I don't think I can easily change the user being used to call the submit without changing the program.

any suggestions ?

Read only

0 Likes
1,912
SUBMIT ZBXXXXXXXX
USER V_USER <--- constant value containing user
VIA JOB P_JOBNAME
NUMBER P_JOBNUM
WITH P_KEY IN INDEXKEY
WITH P_JOB EQ P_JOBNUM
AND RETURN.

change it to variable that is the only option.

there is no meaning if you change the constant value.(they are final variables)

thanks

vijay

Read only

0 Likes
1,912

Hi,

May be u can debug the program that submits the user value to your program.

If the user value is not constant there, then u can change the user value there in debug mode and this value should get submitted later on to the next program.

Thanks

Rashmi