08-17-2007 3:23 PM
We are in the process of upgrading to ECC 6.0 and are correcting unicode errors.
I am looking for a way to convert a string into a flat structure containing various data types.
I have looked at func modules but have not come across one that fits.
Our internal table is defined as a standard table of type string.
We loop thru this table and now want to assign each line of the table into a structure defined as follows:
Begin of _ttype
m like mseg,
other fields...
end of ttype
i_mseg like ttype occurs 0 with header line
any help is appreciated
J
08-17-2007 3:54 PM
Hello
Assuming that the string contains the data with the right lengths and offsets then you can use the methods of class <b>CL_ABAP_CONTAINER_UTILITIES</b>:
FILL_CONTAINER_C Fill Container of Type C or STRING with Content
READ_CONTAINER_C Read Container of Type C or STRING
Regards
Uwe
08-17-2007 3:33 PM
hi
we can do it by field symbols easily
take one generic field symbol.
copy source data to field symbol then from field symbol to destination.
08-17-2007 3:44 PM
is there any field seperator in the string .. if yes just us split command..
Thank
Mahesh
08-17-2007 3:54 PM
Hello
Assuming that the string contains the data with the right lengths and offsets then you can use the methods of class <b>CL_ABAP_CONTAINER_UTILITIES</b>:
FILL_CONTAINER_C Fill Container of Type C or STRING with Content
READ_CONTAINER_C Read Container of Type C or STRING
Regards
Uwe
08-17-2007 3:57 PM
Hello,
if you have a string you can do it with the split command.
Ie:
DATA: str1 TYPE string,
str2 TYPE string,
str3 TYPE string,
itab TYPE TABLE OF string,
text TYPE string.
text = `What a drag it is getting old`.
SPLIT text AT space INTO: str1 str2 str3,
TABLE itab.
Bye
Gabriel