‎2008 Jun 27 1:12 PM
Hi,
I have a line like the following..
A000001234GriffithsTimothy ^840USNA0999CC#0034567841^BO0987110400
I want to get this into an internal table separated by ^ sign, what do i do.
‎2008 Jun 27 1:14 PM
‎2008 Jun 27 1:14 PM
‎2008 Jun 27 1:19 PM
Hi,
first declare required number of fields, and one internal table whith those fields.
now by using SPLIT statement, you can read them into some variables.
now assign these variables to internal table and append.
SPLIT string_name at '^' into field1 field2......
it_tab1-field1 = field1.
it_tab1-field2 = field2.
......
......
......
append it_tab1.
Regards
Sandeep Reddy
‎2008 Jun 27 1:22 PM
Hello
SPLIT f AT g INTO TABLE itab.
Splits f wherever the separator g occurs and places the resulting sections into the fields of internal table itab. The sytsem creates a table row for each section of f.
Note: If f ends with the separator string g, the system does not create an empty table row at the end. This is in contrast to what happens when g occurs at the beginning of f.
‎2008 Jun 27 1:25 PM
Hi,
Try this-
Data: w_string(100),
w_del type c value '^'.
Data:
begin of wa,
f1(20) ,
end of wa.
Data: itab like table of wa.
w_string = 'A000001234GriffithsTimothy ^840USNA0999CC#0034567841^BO0987110400'
SPLIT w_string at w_del into table itab.
Loop at itab into wa.
Write:/ wa-f1.
Endloop.
Thanks.
Sujit