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

tostring function??

Former Member
0 Likes
978

Is there an ABAP version of a toStrng function in Java.

I want to input a structure/table name and I get in out put a string with all the contents of the structure as a string. It would be nice if I have options to have a field separator or if it is fixed length.

Thanks

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
614

Sure....notice here that "S" is a string.



report zrich_0003.


data: imara type table of mara with header line.
data: xmara type mara.

data: s type string.


select * from mara into table imara
          up to 5 rows.

read table imara into xmara index 1.

s = xmara.


write:/ s .

Regards,

Rich Heilman

Read only

Former Member
0 Likes
614

tables:mara.

data:l_fieldname(30),

stri type string.

select fieldname from dd03l into l_fieldname where tabname = 'MARA'.

concatenate l_fieldname stri into stri separated by '|'.

endselect.

write : stri.

Read only

Former Member
0 Likes
614

I am just going to use the transfer statement as my end goal is to write the contents to a file.

Thanks for your help

Read only

0 Likes
614

check the FM DDIF_TABL_GET