2010 May 06 9:20 AM
hi all
i have define a variable and assign a value. Now i want show the variable as string in screen.
Example:
data lf_vab type i.
lf_vab = 1.
Output is
lf_vab = 1.
I know, i have might define LF_VAB as a constant but i wan't.
Thx abap_begin
2010 May 06 9:41 AM
yes, i know, i can definition as string, look this problem
data lf_vab1 type i .
data lf_va type string value 'LF_VAB1'.
lf_vab1 = 3
WRITE: lf_va, ' = ' , lf_vab1.
Now the output is
LF_VAB1= 3
When i change later the variable name, then the output isn't right.
Example
data lf_vab type i .
data lf_va type string value 'LF_VAB1'.
lf_vab1 = 3
WRITE: lf_va, ' = ' , lf_vab1. "Now is wrong, because the Variable LF_VAB1 isn't exist
What i want is, get the variable name as string. Is for dynamic programing.....
Thx abap_begin
Edited by: abap_begin on May 6, 2010 10:41 AM
yes, i know, i can definition as string, look this problem
data lf_vab1 type i .
data lf_va type string value 'LF_VAB1'.
lf_vab1 = 3
WRITE: lf_va, ' = ' , lf_vab1.
Now the output is
LF_VAB1= 3
When i change later the variable name, then the output isn't right.
Example
data lf_vab type i .
data lf_va type string value 'LF_VAB1'.
lf_vab1 = 3
WRITE: lf_va, ' = ' , lf_vab1. "Now is wrong, because the Variable LF_VAB1 isn't exist
What i want is, get the variable name as string. Is for dynamic programing.....
Thx abap_begin
Edited by: abap_begin on May 6, 2010 10:41 AM
2010 May 06 9:25 AM
2010 May 06 9:26 AM
2010 May 06 9:41 AM
yes, i know, i can definition as string, look this problem
data lf_vab1 type i .
data lf_va type string value 'LF_VAB1'.
lf_vab1 = 3
WRITE: lf_va, ' = ' , lf_vab1.
Now the output is
LF_VAB1= 3
When i change later the variable name, then the output isn't right.
Example
data lf_vab type i .
data lf_va type string value 'LF_VAB1'.
lf_vab1 = 3
WRITE: lf_va, ' = ' , lf_vab1. "Now is wrong, because the Variable LF_VAB1 isn't exist
What i want is, get the variable name as string. Is for dynamic programing.....
Thx abap_begin
Edited by: abap_begin on May 6, 2010 10:41 AM
2010 May 06 10:05 AM
data lf_vab type i .
data lf_va type string value 'LF_VAB1'.
lf_vab = 3
WRITE: lf_va, ' = ' , lf_vab. if if you change the varible name ten you have to change in all the place.Please check your codings.
you are declared lf_vab but used as lf_vab1
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |