Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Need help - Split statement

Hi there,

I am using the following code to read data from application server.

open dataset l_ap_file for input

in text mode

encoding default.

if sy-subrc eq 0.

do.

  • Reading a line from the input file.

read dataset l_ap_file into wa_data.

if sy-subrc ne 0.

exit.

endif.

split wa_data at cl_abap_char_utilities=>horizontal_tab

into gs_input-matnr

gs_input-s1qty

gs_input-s2qty

gs_input-s3qty

gs_input-s4qty

gs_input-s5qty

gs_input-s6qty

gs_input-s7qty

gs_input-s8qty

gs_input-s9qty

gs_input-datab

gs_input-datbi.

gs_input-datbi is a 10 character field. If the input data is 2/28/2010, after split statement, gs_input-datbi looks like 2/28/2010# which is not correct.

I want to eliminate the hash symbol which is the field separator...

I used REPLACE statement to remove # symbol. Still not able to solve the issue...

Could anyone please help me to solve this issue...

Your help is greatly appreciated...

Thanks,

Geetha

Tags:
Former Member
Former Member replied

When you do the transfer, Use ASCII mode. You will not get the # character at the end.

P.S This will work provided your file doesnt have more than 255 characters in one line.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question