2007 Feb 22 8:32 PM
Hi all,
Is there any fm to split string as per data base filed length and pass in to table.
FM should contain input fields table name and string .for example
if i give input table name : mara
string: 200123456789123456789
it should give output in an internal table like this
t_mara-mandt : 200
t_mara-matnr :12345678912345689
is there any fm ?
2007 Feb 22 8:42 PM
Try:
REPORT ztest MESSAGE-ID 00.
DATA: data(100) VALUE '200123456789123456789'.
DATA: BEGIN OF table,
mandt TYPE mandt,
matnr TYPE matnr,
END OF table.
MOVE data TO table.
WRITE: /001 table-mandt,
table-matnr.
Rob
2007 Feb 22 8:52 PM
Rob,
I agree: this will work for this particular example, but as soon as there are some specific non-character fields (i.e packed etc.) as part of the internal table, this might crash (dependent on whether the string takes the field content into account or not).
Guenther
2007 Feb 22 9:00 PM