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

variable inside another variable

Former Member
0 Likes
1,516

Hi,

i have a requirement like this.

data:name(30).

data:abc(25).

name = 'abc'.

abc = 'some text'.

how can i write value of the variable abc <b>without using ABC</b>

by using the variable NAME can i print the value 'i am from abc'.

rgds,

bharat.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,176

Hi,

data:name(30).
data:abc(25).
field-symbols <fs> type any.
name = 'abc'.
abc = 'some text'.

assign (name) to <fs>.

write:/ fs.

regards

Sudheer

10 REPLIES 10
Read only

Former Member
0 Likes
1,176

Hi..,

U can use CONCATENATE statement.

WRITE TO will also helps u..

can u be more clearer with ur requirement !!

what u want exactly??

regards,

sai ramesh

Read only

Former Member
0 Likes
1,176

try this..i dont have sap to test...just a try

write : ((name)).

If it gives any syntax errors , just give spaces in brackets and checkout

Read only

0 Likes
1,176

Hi,

Chandrasekhar,even if i am giving the spaces also this statement is not working.are u sure that this type of statement is there in abap.

sai, i want to keep the value of name as same.its not possible if we use write to.

rgds,

bharat.

Read only

Former Member
0 Likes
1,176

Hi ..

i have tried this,.its working..

data:name(30).

data:abc(25).

name = 'abc'.

concatenate ' i am from' name into abc separated by ' '.

write : abc.

Read only

Former Member
0 Likes
1,176

if u change abc like this ..the updated one will come with a followed concatenate like this ..

<b>concatenate ' i am from' name into abc separated by ' '.

write : abc.

name = 'def'.

concatenate ' i am from' name into abc separated by ' '.

write : abc.</b>

reward if useful!!

Regards,

Shweta

Read only

Former Member
0 Likes
1,176

hi try this.

FIELD-SYMBOLS: <A>.

DATA: A1(10) TYPE C VALUE 'test1'.

ASSIGN A1 TO <A>.

WRITE: <A>.

Regards,

baiju

Read only

Former Member
0 Likes
1,176

&----


*& Report ZTEST_SDN_HELP

*&

&----


*&

*&

&----


REPORT ZTEST_SDN_HELP.

FIELD-SYMBOLS: <A>.

DATA: A1(10) TYPE C VALUE 'test1'.

ASSIGN A1 TO <A>.

WRITE: <A>.

Read only

Former Member
0 Likes
1,176

field-symbols: <A1>.

data: a(10) type c value 'test'.

assign a to <a1>.

write <a1>.

Read only

Former Member
0 Likes
1,177

Hi,

data:name(30).
data:abc(25).
field-symbols <fs> type any.
name = 'abc'.
abc = 'some text'.

assign (name) to <fs>.

write:/ fs.

regards

Sudheer

Read only

Former Member
0 Likes
1,176

Hi,

Data:abc(30) type c value 'iam from abc'.

Field-symbols <name> type c.

assign abc to <name>.

write:/ <name>.

i hope this will be helpful to u...

regards

ramesh