‎2014 Jun 03 12:24 PM
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.
‎2014 Jun 03 2:56 PM
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
‎2014 Jun 03 1:52 PM
Is Arabic font installed in your system. If not kindly check with SAP BASIS team.
Thanks,
Velaga Rajesh Chowdary
‎2014 Jun 03 2:01 PM
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.
‎2014 Jun 03 2:14 PM
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
‎2014 Jun 03 2:54 PM
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
‎2014 Jun 03 2:56 PM
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
‎2014 Jun 04 7:08 AM
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.
‎2014 Jun 04 7:18 AM
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
‎2014 Jun 04 9:17 AM
Hi Palak,
First thing to be taken care while dealing with excel files are:
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
‎2014 Jun 04 9:44 AM
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