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

Uploading Excel from Application Server

pintoo_d
Participant
0 Likes
843

Hi Experts,

Wishing you Mery X-mas and happy new year.

I have a question. I have to upload XLS file from AS to SAP Sytem. Its not working fine.

I use TXT and it works perfect.

I am trying to use read dataset to read data in both cases.

Does it mean that AS doesnt support uploading file in XLS format or is there any other way to do it?

I hv tried alot and then asking you all for your support.

Thank You,

Temesh

8 REPLIES 8
Read only

Former Member
0 Likes
814

Hi,

please use function module TEXT_CONVERT_XLS_TO_SAP, ordinary GUI_UPLOAD does not work fine.

Regards,

Prosenjit.

Read only

0 Likes
814

U mean from Application Server ?

i tried TEXT_CONVERT_XLS_TO_SAP, no data is been copied to internal table.

Read only

0 Likes
814

Use Tcode CG3Y and CG3Z for uploading download from AS.

Read only

0 Likes
814

Well. this is my requirement.

I need to upload data from AS to SAP System by calling BAPI.

that excel has multiple records which i need to map to individual bapi structure.

so i guess T-code is ruled out for that.

any other suggestions ??

Read only

0 Likes
814
AS to SAP System

Than it depends on which kind of Data you want to upload.There are so many BAPI we have which works for Different-2 Purpose.

But Before calling BAPI you must take data into internal table,With open data set for input/output commands.

Read only

0 Likes
814

I will b using BAPI_MATERIAL_SAVEDATA to upload into SAP System.

Fields are frm MARA, MARC, MARD, MVKE, MBEW.

Excel file has almost 40 records which needs to be uploaded.

I tried reading dataset and mapping to custom defined types structure for every record in excel.

but it doesnt have those records after execution.

same data in text works fine for me with tab delimited spaces.

so i m not sure what could be done. Some explained that excel might not work frm AS. so they advised me to make use of TXT, but i hv to give a shot wth XLS.

Read only

0 Likes
814

Hi,

data extract from excel and text file is different ..

why is the option of text file ruled out in your case when you say that its working fine ?Why is excel option preferred .

//I tried reading dataset and mapping to custom defined types structure for every record in excel.

but it doesnt have those records after execution.

How is data from excel in AS being fetched ,,i dont think its possible ..

Vijay

Read only

Former Member
0 Likes
814

use this method. just mention the source and destination file paths.


DATA : p_source TYPE string,
           p_dest TYPE string. 

CALL METHOD cl_gui_frontend_services=>file_copy
  EXPORTING
    SOURCE               = p_source
    destination           = p_dest
    overwrite             = SPACE
    .