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

Problem uploading XLSX using Tcode CG3Z

Former Member
0 Likes
4,870

Hi All,

My requirement is that I need to upload an XLSX extension file to application server using TCODE CG3Z.

This file contains characters of arabic fonts as well because of which I can't convert it to .txt or .csv before uploading as doing so converts the arabic font into series of '?'.

And when I simply try uploading that XLSX file to application server using format BIN, it uploads it as junk characters.

1 ACCEPTED SOLUTION
Read only

Juwin
Active Contributor
2,340

Where do you see junk characters? If you are trying to view the uploaded XLSX file through AL11, it will show junk characters. That doesn't mean that the file was uploaded incorrectly. AL11 is a text viewer. XLSX is a binary file and not a text file.

Thanks,

Juwin

9 REPLIES 9
Read only

Former Member
0 Likes
2,340

Is Arabic font installed in your system. If not kindly check with SAP BASIS team.

Thanks,

Velaga Rajesh Chowdary

Read only

0 Likes
2,340

Ho Rajesh,

Thanks for the reply.

But the problem is, I am not even able to upload even a simple file of .xlsx or .xls extension with no arabic text through CG3Z . Even that creates a file full of junk characters. I am able to upload csv and text files though but as these do not support arabic fonts so it doesnt help in my case.

Read only

Former Member
0 Likes
2,340


Hi,

You can also write a program to upload it on application server and handle logic of Page code  so that it will upload arabic text also.

Regards,

Pravin

Read only

Former Member
0 Likes
2,340

try this

Upload the file into an internal table, and then use the below lines to upload

OPEN DATASET gv_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

     IF sy-subrc EQ 0.
       LOOP AT gt_final INTO gs_final.
         TRANSFER gs_final-tline TO gv_file.
         CLEAR gs_final.
       ENDLOOP.
     ELSE.
       "Error Message
     ENDIF.

     CLOSE DATASET gv_file.


Thanks

Rajesh


Read only

Juwin
Active Contributor
2,341

Where do you see junk characters? If you are trying to view the uploaded XLSX file through AL11, it will show junk characters. That doesn't mean that the file was uploaded incorrectly. AL11 is a text viewer. XLSX is a binary file and not a text file.

Thanks,

Juwin

Read only

Former Member
0 Likes
2,340

Thanks Pravin and Rajesh.

But the requirement I have could not be solved by coding as I want to upload data in background and to write this on application server I would be required to create one more foreground report which uploads data from presentation server and writes down on application.

Juwin,

Thanks for your reply. Even I thought the same as you are suggesting but the thing is even for like one line of data, it creates a very heavy file on application server and when I was trying to re download it usin CG3Y, it wasn't creating a similar file.

Read only

0 Likes
2,340

Hi Palak,

In your recent post you wrote that you want this file upload in background.. If this is your requirement than you cannot use Xls file directly. As Presentation server file cannot be called in background processing.

As Juwin suggested, request you to upload and perform your furthe steps which you want to perform with the data uploaded from file.

We cannot confirm by downloading file by CG3Y, so to confirm the file uploaded is correct or not perform furthe steps based on AL11 data.

Regards,

Ganesh

Read only

alok_patra
Product and Topic Expert
Product and Topic Expert
0 Likes
2,340

Hi Palak,

First thing to be taken care while dealing with excel files are:

  • Remove all formatting from excel file.
  • Do not use copy paste, type all values manually.


Although, you may not see the same file in AL11 as you see in your presentation server due to the difference in file formats and the way OS interprets them, still you can use the file for further processing. While reading the file you need to use proper encoding like UTF-8 in Read dataset statement.


Thanks,

Alok

Read only

former_member202771
Contributor
0 Likes
2,340

Hi Palak,

Check if you are able to upload other formats .txt .doc in that particular server.

If not, the server may have restricted access.

Thanks,

Anil