2009 Sep 11 6:18 PM
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
2009 Sep 11 6:23 PM
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
2009 Sep 11 6:23 PM
2009 Sep 16 4:54 PM
2009 Sep 11 6:34 PM
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
2009 Sep 11 7:02 PM
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
2009 Sep 11 7:22 PM
Also verify the type of "cl_abap_char_utilities=>horizontal_tab" by double clicking on it and define your variable/constant as that type.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |