01-08-2007 10:18 AM
Hi All,
I have a internal table filled with records in following format.
XXXXXXXX~~Export the invoice
2~19980501~19980531
// The first invoice:
0~00130698114000010004119980512059611000276233.350.1711076.66????321000789010005???????????????????130601000000000??????????18? 3352051????532611-3357211???~~~
0~????????176233.350.1711076.6676233.350~1510
// The second invoice:
0~00130698114000010007219980512059611000440482.000.175882.00????110108078901007?????????61? 68744479?????????????462088-07?????130601000000000??????????18? 3352051????532611-3357211???????????~~~
0~????????139780.000.175780.0039780.000~1510
0~????3.5"10702.000.17102.0070.20~1510
I want to sort this out field by field and fill it to the respective fields.
If i try to do so with work area
-
read table itgt_frmgto into waitgt_frmgto index 4.
-
i have a out put of one line that is 4th.Butbbecause these are random records,i cannot count on lines .So i have to go by fields.
Could anybody tell me how to do this with multiple lines coming in without using
index concept.
Thank you,
Priya
01-08-2007 10:24 AM
hi,
loop the table and inside the loop split each line into other variables if the line has a fix structure or split into an another itab if not.
SPLIT <line> AT '~~' INTO <f1> ... <fn>.
or
SPLIT <line> AT '~~' INTO <itab>.
you might want to take a look at the syntax of SPLI statement.
br
01-08-2007 10:53 AM
try like this
loop at itab where <fieldname> like '000%'.
now take your value here to the desired area.
endloop.
regards
shiba dutta
01-08-2007 10:59 AM
loop at line.
SPLIT <line> AT '~~' INTO <itab>.
append itab.
endloop.