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 data-record AT delimiter into table-fieldname

Former Member
0 Likes
1,152

Hi all,

I have the following SPLIT statement. But unable to split into respective field in an internal table. I'm using the standard delimeter.

Please help me how to create a file using the delimeter w_delimeter.

When I create the file with separated by '#' even it is not spliting.

w_delimeter TYPE c value cl_abap_char_utilities=>horizontal_tab.

SPLIT data-record AT w_delimeter INTO i_0208-pernr

i_0208-begda

i_0208-endda

i_0208-wtart

i_p0208-allpc.

Thanks,

Prasad

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,015

The file fields should be separated by tab not #.

The file fields should be separated by tab not #.

5 REPLIES 5
Read only

Former Member
0 Likes
1,016

The file fields should be separated by tab not #.

Read only

0 Likes
1,015

solved

Read only

Former Member
0 Likes
1,015

Hi Prasad,

it should work try this bellow piece of code.

REPORT ZTEST_A.

data: Begin of itab occurs 1,

name(30),

street(30),

Apt(3),

city(30),

state(2),

zipcode(5),

end of itab,

text1(250),

text2(250).

Text1 = 'Jacson 3 xyz dr B4 abcd DE 12345'.

Text2 = 'Edward 3 Caaa dr B4 pqr DE 54623'.

split text1 AT ' ' into itab-name itab-street itab-Apt

itab-city itab-state itab-zipcode.

append itab.

split text2 AT ' ' into itab-name itab-street itab-Apt

itab-city itab-state itab-zipcode.

append itab.

thanks,

Venkat

Read only

Former Member
0 Likes
1,015

Hi

Try this for Delimiter is #,

DATA: l_new_ln TYPE char1,
        l_field  TYPE filed type,    
        l_st2    TYPE char1.
 
data: l_var type string.
 
        l_new_ln = cl_abap_char_utilities=>cr_lf+0(1).   " It gets # symbol
Now,
Loop......
       SPLIT l_wa_data-line
        AT    l_new_ln
        INTO
        wa_data-field1
        wa_data-field2
         wa_data-field3
         wa_data-field3.
Append wa_data to i_data
endloop.

It may helpfull for you....

Thanks

Ravi

Read only

Former Member
0 Likes
1,015

Also verify the type of "cl_abap_char_utilities=>horizontal_tab" by double clicking on it and define your variable/constant as that type.