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

Problems in Splitting the uploaded file

Former Member
0 Likes
1,474

Hi All,

when i convert a file from excel to notepad there is a new character added which looks like this '[]'

when i upload this in my program '[]' is displayed as # .

I am not able to split the string because ABAP is not recognising this new '#' symbol . how do i split this string . Please help

Amit

Hi All,

when i convert a file from excel to notepad there is a new character added which looks like this '[]'

when i upload this in my program '[]' is displayed as # .

I am not able to split the string because ABAP is not recognising this new '#' symbol . how do i split this string . Please help

Amit

5 REPLIES 5
Read only

Former Member
0 Likes
1,006

Hi

If you are on UNICODE system, check class: cl_abap_char_utilities. You will find methods for CARRIAGE RETURN and LINE FEED, use these to split the string. Am not on SAP system to give you the exact way.

Incase you are NON-UNICODE system, define a variable of X for Carriage return and use this for splitting.

Eg:

data: l_cr(1) type X value '13'.

Use this for splitting.

Try the above method and see if it works for you.

Kind Regards

Eswar

Read only

Former Member
0 Likes
1,006

You could save your file as .CSV from Excel. This will create a comma-delimited text file which can be read into your ABAP program and split easily.

Read only

Former Member
0 Likes
1,006

Hi,

Notepad file will not support some charaters in excel format. Y can't u upload excel file to SAP.

Use comma separated file(.CSV).

Download .CSV file and split it to internal table.

EX:

Assume u r downloading matnr matxt.

and records are downloaded to the structure say wa.

declare wa as "data: wa(1000) type c".

loop at wa.

split wa at , into

itab-matnr

itab-matxt.

append itab

endloop.

Regards

Divakar

Read only

0 Likes
1,006

You can also use function ALSM_EXCEL_TO_INTERNAL_TABLE to upload from Excel to internal table directly. Be sure to specify the begin and end row/columns. Empty cells will be left out of the internal table.

Read only

Former Member
0 Likes
1,006

one suggestion here for you is,

you can upload directly an EXCEL file to an internal table.

if you want to go like this, check this link

http://www.sapdevelopment.co.uk/file/file_upexcel.htm

here we use the function module <b>TEXT_CONVERT_XLS_TO_SAP</b> instead of <b>GUI_UPLOAD</b>

Regards

srikanth