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

Former Member
0 Likes
697

hi

in a field ,

if it has value like 200F502536R DE 566788 5557888

i want to split the fields .

200_MANDT

F502536_lifnr

de_country

5667788_ changenr.

how 2 do it.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
675

Hello


mandt = value(3).
lifnr = value+3(7).
country = value+12(2).
changenr = value+15(6)

6 REPLIES 6
Read only

Former Member
0 Likes
675

Use concatenate statement.

concatenate value0(3) '_' 'mandt' value4(8) '_' 'LIFNR' like this.

Regards,

Rajasekhar Reddy.

Edited by: Rajasekhar Reddy Nevali on Jul 10, 2008 3:26 PM

Read only

Former Member
0 Likes
675

U need to split using offset values as there is no delimitter

to split ..

v_value = '200F502536R DE 566788 5557888'.

v_mandt = v_value+0(3).

....and so on ...

Read only

Former Member
0 Likes
675

hiiii

use SPLIT statement of ABAP

SPLIT p_pfile AT w_del1
               INTO w_locate1
                    w_ext2.

then if you want it in new line then use CL_ABAP_CHAR_UTILITIES=>CR_LF

regards

twinkal

Read only

Former Member
0 Likes
678

Hello


mandt = value(3).
lifnr = value+3(7).
country = value+12(2).
changenr = value+15(6)

Read only

Former Member
0 Likes
675

hi,

do this way ...


data : v_field(40) value '200F502536R DE 566788 5557888' .
data : v_var1(10), 
          v_var2(10),
          v_var3(10),
          v_var3(10),
          v_var4(10),
          v_var1o(20),
           v_var2o(20),
          v_var3o(20),
          v_var4o(20).

v_var1 = v_field+0(3).
v_var2 = v_field+3(8).
v_var3 = v_field+12(2).
v_var4 = v_field+15(6).
         
concatenate v_var1 '_MANDT' INTO v_var1o.
concatenate v_var2 '_lifnr' INTO v_var2o.
concatenate v_var3 '_country' INTO v_var3o.
concatenate v_var4 '_ changenr' INTO v_var4o.

write :  v_var1o, v_var2o, v_var3o, v_var4o. 

Regards,

Santosh

Read only

Former Member
0 Likes
675

Hi Murali.

You can try :

SPLIT <c> AT <sep> INTO <c1> ... <cn>.

SPLIT <c> AT <sep> INTO TABLE <itab>.

"sep" - separator.

Or you can try if this helps:

[Sample Code|http://www.sap-img.com/ab039.htm]

Good Luck & Regards

Harsh