2015 Dec 28 1:01 PM
Hi ABAP'ers.
I have a question about how to move value.
What i have:
lv_counter
<gs_dyn>
I give sample code:
DO 3 TIMES.
ADD 1 TO lv_counter.
ASSIGN COMPONENT sy-index OF STRUCTURE <gs_dyn> TO <fs_value>.
CONCATENATE 'GV_LICZBA' lv_counter INTO lv_liczba.
ASSIGN ('lv_liczba') TO <fs_value>.
ENDDO.
My question is:
When I concatenate 'GV_LICZBA' and lv_counter I will get the name of variable which I want take value. But I only get in first 'DO' 'GV_LICZBA1' instead a value of this.
Could someone to help me?
2015 Dec 28 1:53 PM
It is not clear what is your problem. Can you describe it better?
2015 Dec 28 2:39 PM
Hi, try without quotes, should work:
ASSIGN (lv_liczba) TO <fs_value>.
Regards,
Sandro Ramos
2015 Dec 29 10:21 AM
2016 Jan 04 12:00 PM
Great!!
Please, mark the correct answer to close this thread.
Best Regards,
Sandro Ramos
2016 Jan 04 12:51 PM
2016 Jan 04 8:34 PM
2016 Jan 04 12:10 PM
Hi Wojtek,
Instead of CONCATENATE 'GV_LICZBA' lv_counter INTO lv_liczba.
write the below code.(Just remove the colon (' '))
CONCATENATE GV_LICZBA lv_counter INTO lv_liczba.
It will work...
Thanks,
Satya
2016 Jan 04 8:11 PM
Hi WojteK
View the code.
DATA: lv_text1 TYPE string,
lv_text2 TYPE string,
lv_dis TYPE string,
lv_cnt TYPE string.
FIELD-SYMBOLS: <fs> TYPE ANY.
DO 2 TIMES.
lv_cnt = sy-index.
CONCATENATE 'LV_TEXT' lv_cnt INTO lv_dis.
CONDENSE lv_dis NO-GAPS.
ASSIGN (lv_dis) to <fs>.
CHECK <fs> IS ASSIGNED.
<fs> = lv_dis.
ENDDO.
WRITE: lv_text1, lv_text2.
Hope it helpful,
Regards,
Bhuvnesh