‎2009 Mar 14 9:42 AM
Hi All
Some data is coming in single field in DB Table.
I want to populate this field to fields of custom structure.
I have to use "SPLIT" or move using offset etc?
Pleaes help..
‎2009 Mar 14 9:46 AM
Field field of the DBtable you can split it to a internal table fields.
Split <Field> at <Condition> INTO <ITAB>.
OR
SPLIT text AT space INTO: str1 str2 str3,
TABLE itab.
[Split help|http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb33f3358411d1829f0000e829fbfe/content.htm]
If you are using offsets it will create a loop will will increase the processing time of program..(i.e performance hamper)
Regards,
Gurpreet
‎2009 Mar 14 9:51 AM
‎2009 Mar 14 10:08 AM
Hi,
try this ...
parameters text(20) type c.
types:
begin of type_s_fs,
f1(5) type c, " Give the required length at which u want to split
f2(15) type c,
end of type_s_fs.
data fs type type_s_fs.
data tab like standard table of fs.
split text at ' ' into fs-f1 fs-f2. " ( Give the character at which u want to split in ' ' )
append fs to tab.
loop at tab into fs.
write 😕 fs-f1,
fs-f2.
endloop.