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

Determining a variable name during runtime

Former Member
0 Likes
440

Hi,

I need to determine the name of a variable during runtime. For example L_TEMP (type i) contains value 10.

During runtime we know the value is 10 but I’m more interested in obtaining the name ‘L_TEMP’ and assigning it to another variable of type c.

I need the name to compare it against another value.

A reason on why I need this is when using the following syntax:

do 10 times varying l_temp

from mver-gsv01

next mver-gsv02.

<whatever code> ...

enddo.

I need to keep track of which field in MVER is being processed within the DO loop ie. GSV01, GSV02, GVS03 ... etc

Help would be appreciated and points rewarded.

Thanks

Liam

2 REPLIES 2
Read only

Former Member
0 Likes
401

Liam,

I don't think that will be possible. However, can you explain a little more, with the code you have, your requirement.

I am sure we will be able to process the data without knowing the name of the field.

Regards,

Ravi

Read only

Former Member
0 Likes
401

Hi,

I'm given a from date and to date range such as 03.2006 to 10.2006.

Using this date range I need to select from MVER to obtain material consumption history. I then need to sum the quantity for periods 3 to 10 i.e. from MVER-GSV03 to MVER-GSV10.

So by first selecting the record in a structure ST_MVER we then use the following syntax to 'loop' through all 13 periods (GSV01 to GVS13) and summing them up but only for thos periods chosen i.e. period 3 to 10, not 1 to 13.

do 10 times varying l_temp

from mver-gsv01

next mver-gsv02.

if current <l_temp period> is greate or equal to from period (3) and less than to period (10).

sum it up.

endif.

enddo.

Hope this helps.