Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Split single field to structure fields

Former Member
0 Likes
606

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..

3 REPLIES 3
Read only

Former Member
0 Likes
559

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

Read only

former_member203501
Active Contributor
0 Likes
559

use this function module ...

RKD_WORD_WRAP

Read only

Former Member
0 Likes
559

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.