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

Read an EXCEL file from Application server

0 Likes
1,018

Hi Friends,

I have an EXCEL file on application server.I want to upload this file.

I used OPEN DATASET , READ DATASET , CLOSE DATASET for this.but the data coming into internal table is containing special characters.I also used the function module "TEXT_CONVERT_TEX_TO_SAP'" to convert this raw data to proper SAP format but it is not working.

Note : I uploaded my test file on application server using transaction 'CG3Z'. Because of this I am getting this error?If yes then please suggest the correct way to place an EXCEL file to application server.

Thanks in advance!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
750

see, there are two things..

1. while uploading though CG3Z, you check what format you have used.. default is set as BIN.. and other is ASCII.. ex: you find '#' at the end of lines and tabs when kept in BIN mode.. which is not the same when you upload with ASCII format.

2. while getting data, you can use as suggested in the above post like in BINARY MODE

Hi Friends,

I have an EXCEL file on application server.I want to upload this file.

I used OPEN DATASET , READ DATASET , CLOSE DATASET for this.but the data coming into internal table is containing special characters.I also used the function module "TEXT_CONVERT_TEX_TO_SAP'" to convert this raw data to proper SAP format but it is not working.

Note : I uploaded my test file on application server using transaction 'CG3Z'. Because of this I am getting this error?If yes then please suggest the correct way to place an EXCEL file to application server.

Thanks in advance!

3 REPLIES 3
Read only

former_member214857
Contributor
0 Likes
750

Hi Prashant

Probably your Excel file was stored in binary mode.

You can use OPEN DATASET IN binary mode and store it in a xstring variable inside the system

Kind regards

Read only

Former Member
0 Likes
751

see, there are two things..

1. while uploading though CG3Z, you check what format you have used.. default is set as BIN.. and other is ASCII.. ex: you find '#' at the end of lines and tabs when kept in BIN mode.. which is not the same when you upload with ASCII format.

2. while getting data, you can use as suggested in the above post like in BINARY MODE

Read only

Former Member
0 Likes
750

Hi Prashant,

You can use OPEN DATASET <FILE> FOR INPUT IN BINARY MODE to download any binary documents such as XLS, ZIP etc.,

Also transactions CG3Y and CG3Z are not available in systems such as CRM.

You can refer to my article below for a sample code-

http://divulgesap.com/blog.php?p=MTI1

Regards,

Ravi