09-26-2007 7:06 PM
Hi,
I have an internal table , i need to convert that to a string. How it can be done.
Sa_R
09-26-2007 7:09 PM
data : v_string type string.
loop at itab.
concatenate itab-value v_string into v_string.
endloop.
write v_string.
09-26-2007 7:10 PM
Mahesh,
I forget tell you that i am working in Unicode environment. so MOVE will not work
After making this string i need to pass CL_ABAP_GZIP to compress
Sa_R
09-26-2007 7:24 PM
09-26-2007 7:09 PM
Something like this?
report zrich_0001 line-size 500.
data: it001 type table of t001 with header line.
data: string type string.
select * into table it001 from t001.
loop at it001.
concatenate string it001 into string separated by ','.
endloop.
shift string left deleting leading ','.
write:/ string.
Regards
RIch Heilman
09-26-2007 7:13 PM
Rich,
I tried with that , but system giving non compatible error
Sa_R
09-26-2007 7:17 PM
Ok, how about moving one field at a time?
report zrich_0001 line-size 500.
data: it001 type table of t001 with header line.
data: string type string.
data: fldstr type string.
data: substr type string.
field-symbols: <fs>.
select * into table it001 from t001.
loop at it001.
do.
assign component sy-index of structure it001 to <fs>.
if sy-subrc <> 0.
exit.
endif.
fldstr = <fs>.
concatenate substr fldstr into substr separated by space.
shift substr left deleting leading space.
enddo.
concatenate string substr into string separated by ','.
endloop.
shift string left deleting leading ','.
write:/ string.
Regards,
RIch Heilman
09-26-2007 7:20 PM
09-26-2007 7:29 PM
Seshu/Mahesh,
This fm only with type compatible structures , in unicode this will not work.
After using this fm it is giving dump in the following line
000420 * only one line of text > directly into text-string
000430 if sy-tfill = 1.
000440 read table text_tab index 1.
> text = text_tab.
000460 * more than one line of text > concatenate into text-string
Rich,
I need to use you logic to get this done. I try to avoid the loop . But there is no other way to avoid the loop, i have to go with loop.
Sa_R.