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

GUI_UPLOAD

Former Member
0 Likes
1,277

Thanks everyone for replying to my earlier question, seems that becoz of some issue, I couldnt see the left option to reward points to any of you... I am sorry for that.

I have seen people have replied saying do not use GUI_UPLOAD, Is there any reason on not using this FM?

My problem is still persistent, I think I have to move file and see that might help me.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,244

Did you change the forward slash to a back slash?

FILENAME = 'C:\myfile.xls'

Rob

Message was edited by:

Rob Burbank

11 REPLIES 11
Read only

Former Member
0 Likes
1,244

Hi Pranav,

GUI_UPLOAD is normally used to upload text files. For uploading excel file, its better to use <b>ALSM_EXCEL_TO_INTERNAL_TABLE</b>.

Regards

Aneesh.

Read only

Former Member
0 Likes
1,245

Did you change the forward slash to a back slash?

FILENAME = 'C:\myfile.xls'

Rob

Message was edited by:

Rob Burbank

Read only

0 Likes
1,244

Yes Rob, I did that too and even I closed the file as well, but then also no success.

Do I need to put url into some variable and then use that ?

Here is what all I checked :

File is not open

I went to windows explorer and typed file name which i have given in function module and I can see the file with data into that.

Read only

0 Likes
1,244

In the root directory?

Rob

Read only

0 Likes
1,244

What is your version??

Maybe this is a bug...

Read only

0 Likes
1,244

In your original program using GUI_UPLOAD, were you getting a dump or an error message?

Rob

Read only

0 Likes
1,244

I have moved my code to another SAP system and there I am not getting error message for file not available but I am getting some absurd dump message...

have long chain of "###################################### sheet1 ............................ ########### sheet 2.........

something of this type...

When i am replacing the xsl to txt and create .txt file, it works ...

Read only

0 Likes
1,244

Again, if you did not download the file using GUI_DOWNLOAD, then you will get junk data when trying to use GUI_UPLOAD, so you need to use the mentioned(example in your other thread) function module which uses OLE technology to upload.

Regards,

RIch Heilman

Read only

0 Likes
1,244

Does it mean that I need to use GUI_DOWNLOAD before GUI_UPLOAD ?

Message was edited by:

pranav .

Read only

0 Likes
1,244

If that is the requirement. But it could be that this file is not created by SAP, it could be some other system creating this file, right? In that case, it does not make sense to use GUI_DOWNLOAD. The idea here is that if you download the data to PC using GUI_DOWNLOAD and setting the parameter, WRITE_COLUMN_SEPERATOR(something like this), then the system will write the file in such a way that it is easily read back using GUI_UPLOAD and you would set the parameter HAS_COLUMN_SEPERATOR(i think that is the name). Otherwise, you need to upload the excel file using the said funciton module, or writing your OLE code.

REgards,

Rich HEilman

Read only

Former Member
0 Likes
1,244

Hi,

You can not upload an XLS file using GUI_UPLOAD. Please use following FM to upload XLS files:\

FAA_FILE_UPLOAD_EXCEL

TEXT_CONVERT_XLS_TO_SAP

ALSM_EXCEL_TO_INTERNAL_TABLE

In ALSM_EXCEL_TO_INTERNAL_TABL, you have to format the uploaded date before using it. So, use FAA_FILE_UPLOAD_EXCEL which internally calls ALSM_EXCEL_TO_INTERNAL_TABL, formats data and gives back formatted data in an internal table.

<b>

Also, use '\' instead of '/' in C:/myfile.xls'.</b>

You can also call a FM 'F4_FILENAME' to get the file.

Reward points if the answer is helpful.

Regards,

Mukul