Language Conversion : Getting junk character in excel file
Hi Experts,
I am getting one issue while sending data in form of email. I have certain data in ALV output & I am sending that data through email using one custom function module.
This function module is sending data as ZIPPED file. If we open the ZIPPED file it is displaying file as .XLS file.
Now the issue is that material description is maintained DE language & in output that description is coming proper i.e. whatever maintained in DE language.
But when ever I am receiving email, the DE text gets converted to zunk character. While debugging I found that data is properly populated in internal table prior to using Custom FM.
Can anybody will suggest how I can resolve it?
Thanks,
Neha
Hi,
The problem might be in zipping. The sender(zipper) and the receiver(unzipper) must use the same codepage.
/Simo
Similar Messages
-
Getting junk character while creating PDF image for Hebrew language
Hi,
I have a issue while creating PDF image for invoice in Hebrew language . I can able to create a PDF image but it' showing junk characters instead of Hebrew characters.
Please provide your inputs to resolve this issue.
Thanks,
Joy.Hi ,
I am also facing similar problem.My system is unicode enabled and i am using the device type I8SWIN and courier font .
But still i am getting junk characters for Hebrew characters in PDF.
Can any one suggest me what is the exact device type we have to use for unicode enabled system and also for non unicode enalbled system.
Is any related to truetype font here .Kindly let me know .
Thanks for your valuable inputs .
PRadeep.... -
I cant get my PDF and Excel files to open on my iphone help!
Has any one had problems opening a pdf file or excel file in the ISO5 platform, if so how did you fix it
I use PDF File Viewer, a free app.
I would download Keynote, Numbers and/or Pages for iOS; they are quality apps made by Apple. You can create, edit and view documents, but these apps are $9.99 each, on the other hand they are of the upmost quality. -
Conversion of internal table into excel file format &put it on app server
Hi,
My requirement is to convert the internal table into excel file format and I have to store it on application server so that administrator can send the file thr e-mail attachment.
So, please let me know how to convert the records of internal table and store it on application server in Excel file format.
TIA,
NitinHi,
Use FM GUI_DOWNLOAD to download the data from inernal table to excel sheet.
Then Using tcode CG3Z u can transfer file to application server.
*& Form sub_download
text
--> p1 text
<-- p2 text
FORM sub_download.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = p_path
filetype = 'ASC'
APPEND = ' '
write_field_separator = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = it_final
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " sub_download
Otherwise use OPEN DATASET and TRANSFER statement to download data from internal table to direct application server
Regards,
Prashant -
In my program, I am downloading 3 types of result in 3 diffreent excel sheet.
Is there any way by which we can download these 3 diffreent excel sheet into one excel file in 3 diffrent sheet.....( i.e. the result should be in 3 different sheets in same (single) excel file ?????It is possible
USE FM : 'EXCEL_OLE_STANDARD_DAT'
Here you can mention diffrent sheet names and file name
Thanks
Seshu -
I do input in urdu Language but get English Character Why??
i take input in JtextField in URDU language(Pakistan National Language) by the help of
this.jTextField1.setFont(new java.awt.Font("URDU", 1, 13));user do input in text filed its display correctly.
but WHEN i get in programme it return English Character..
JOptionPane.showMessageDialog(this, this.jTextField1.getText());give me some clue....i changed it by the help of under code , but my problem is sitll...
Locale locale = new Locale("UR", "PK");
String l = locale.getISO3Language();
UIDefaults d = new UIDefaults();
d.setDefaultLocale(locale);any other idea??????????? -
Get list of all excel file from directory
solved
Edited by: Ravi Ranjan on Mar 23, 2009 9:27 AMHello,
Thanks in advance too, to indicate the exact version you use in your every post.
Francois -
Function module to get data into internal table from Excel file sheets
Hi,
I have to upload customers from excel file.
we are donloading customer data excel file sheets.
Customer data in 1 sheet, tax data the other sheet of same excel file, Customer master-Credit data in other sheet of same excel file.
so i have 3-4 sheet in one excel file.
now my requirement is to get the data from excel file into internal table.
is there any function module.
Thanks & RegardsI am sending you the idea with an example how you can upload data from an EXCEL file into an internal table. I am not sure if you can take data from different sheet in the same EXCEL file. I think that this is not possible (try it )
Upload the data into an internal table, like the way that I am describing in the above:
DATA: L_MAX_COL_NB TYPE I.
DATA: l_file_name LIKE RLGRAP-FILENAME.
Just to be sure that is the correct type for the FM.
l_file_name = P_FILE_NAME.
L_MAX_COL_NB = 58. "Maximum nb of colums that the FM can read.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = l_file_name
I_BEGIN_COL = 1
I_BEGIN_ROW = 2
I_END_COL = L_MAX_COL_NB
I_END_ROW = 9999
TABLES
INTERN = PT_EXCEL
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
ENDIF.
Now you should upload the data into your own itab. The Function Module will return to you all the an itab
from all fields and columns. Define the structure of the uploading file into SE11 - Data Dictionary. Then read the fieldcatalog of this structure. In the code that I am sending to you, I am insearting an empty line into the internal table and then I am assigning this line into a corresponding field-symbol. Then I am able to change the working area - so and the line of the itab. Propably you could you the statement APPEND INITIAL LINE TO (your_table_name) ASSIGNING <your_field_symbol>, but the example was written in an old SAP version.
FIELD-SYMBOLS:
<F_REC> LIKE WA_UPLOAD_FILE, "working are of the uploading file
<F_FIELD> TYPE ANY.
DATA: COLUMN_INT TYPE I,
C_FIELDNAME(30) TYPE C.
PERFORM GET_FIELDCATOLG TABLES FIELDCAT
USING 'ZECO_CHARALAMBOUS_FILE'.
LOOP AT PT_EXCEL.
AT NEW ROW.
ASSIGN WA_UPLOAD_FILE TO <F_REC>.
ENDAT.
COLUMN_INT = PT_EXCEL-COL.
READ TABLE FIELDCAT INTO WA_FIELDCAT INDEX COLUMN_INT.
CONCATENATE '<F_REC>-' WA_FIELDCAT-FIELDNAME INTO C_FIELDNAME.
ASSIGN (C_FIELDNAME) TO <F_FIELD>.
<F_FIELD> = PT_EXCEL-VALUE.
AT END OF ROW.
APPEND WA_UPLOAD_FILE TO GT_UPLOAD_FILE.
CLEAR WA_UPLOAD_FILE.
ENDAT.
ENDLOOP.
With Regards
George
Edited by: giorgos michaelaris on Mar 4, 2010 3:44 PM -
ECC6.0 - PDF issue - Junk Character output after Upgrade from 4.7c
Hi All,
I am working in Uprgade project(from 4.7c Non-unicode system to ECC6.0 unicode system).
We are facing PDF output issue in ECC6.0 that means we are getting junk character output(screenshot is attached for your reference).
In 4.7c , we have stroed the OTF data in table after generated from smartform as we should not get different output in future. Whenever we need output of the same then we are getting the OTF data from that table and we will generate pdf through "Convert_otf" function module.This logic is working fine in 4.7c.
In ECC6.0 ,the same logic is not working as system is unicode sytem and we are getting junk character output.
As per my old upgrade project experience , i have used the below piece of code for solve this junk character issue but still I am facing the same issue.
Kindly note that in my old upgrade project i have regenerated the OTF data in ECC6.0 and used the below piece of code then I got correct output but here I have to use the old OTF data (from table) which was generated in 4.7c.
Please any one can give solution for this issue.
Regards
Anandakumar.K
+91 9486963561.
REPORT z_display_notification_tst.
Local Vairable Declaration
TYPES: lt_pdf_table(1000) TYPE x.
Local Vairable Declaration
DATA :
lv_otf_data TYPE STRING, " OTD data in string format
lv_length TYPE i, " OTF Length
lv_lines TYPE i, " No of lines
lv_no_of_recs TYPE int4, " No of OTF Lines
lv_offset TYPE int4, " Offset
pdf_fsize TYPE i,
lv_binfile TYPE xstring,
gv_reportsize TYPE i,
l_url(80) TYPE c,
l_pdf_data TYPE STANDARD TABLE OF lt_pdf_table ,
l_pdf_line TYPE lt_pdf_table,
l_offset TYPE i,
l_len TYPE i,
lt_pdf_table TYPE rcl_bag_tline,
lt_otfdata TYPE tsfotf,
ls_otfdata TYPE itcoo. " Line type of OTF data
DATA:
g_html_container TYPE REF TO cl_gui_custom_container,
g_html_control TYPE REF TO cl_gui_html_viewer.
******************GET OTF data from Table ******************************
Primary Keys used for selection : BUSKEY,
NTFTYP,
TRNTYP,
SELECT SINGLE otf_data FROM znotif_otf
INTO lv_otf_data
WHERE buskey EQ 'LS_000000000010001470'
AND ntftyp EQ '0037'
AND trntyp EQ 'ACT'.
Get the length of the OTF data stored as stream of string************
l_len = STRLEN( lv_otf_data ).
Compute the OTF lines
lv_lines = l_len / 72.
lv_no_of_recs = lv_lines + 1.
Set the offset to initial
lv_offset = 0.
*Reconstruct the OTF data from the string
DO lv_no_of_recs TIMES.
IF sy-index NE lv_no_of_recs .
Get OFT format: command ID
ls_otfdata-tdprintcom = lv_otf_data+lv_offset(2).
lv_offset = lv_offset + 2.
Get OTF format: command parameters
ls_otfdata-tdprintpar = lv_otf_data+lv_offset(70).
lv_offset = lv_offset + 70.
ELSE.
Last line contains only the OFT format: command ID "//" (End of file)
ls_otfdata-tdprintcom = lv_otf_data+lv_offset(2).
lv_offset = lv_offset + 2.
ENDIF.
Append the OTF data to Export OTF table
APPEND ls_otfdata TO lt_otfdata.
CLEAR ls_otfdata.
ENDDO.
*************************Convert OTF to PDF**************************
IF lt_otfdata IS NOT INITIAL.
clear: lv_binfile,
pdf_fsize.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = pdf_fsize
bin_file = lv_binfile
TABLES
OTF = lt_otfdata
lines = lt_pdf_table
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
Call screen***********************************
Call screen
CALL SCREEN 100.
RETURN.
*& Module STATUS_0100 OUTPUT
text
MODULE status_0100 OUTPUT.
SET PF-STATUS '100'.
SET TITLEBAR '100'.
Convert bin file
clear :l_len,
l_offset.
free l_pdf_data[].
l_len = XSTRLEN( lv_binfile ).
WHILE l_len >= 1000.
l_pdf_line = lv_binfile+l_offset(1000).
APPEND l_pdf_line TO l_pdf_data.
ADD 1000 TO l_offset.
SUBTRACT 1000 FROM l_len.
ENDWHILE.
IF l_len > 0.
l_pdf_line = lv_binfile+l_offset(l_len).
APPEND l_pdf_line TO l_pdf_data.
ENDIF.
Initialise and create the HTML container
IF NOT g_html_container IS INITIAL.
CALL METHOD g_html_container->free
EXCEPTIONS
OTHERS = 0.
CLEAR g_html_container.
ENDIF.
CREATE OBJECT g_html_container
EXPORTING
container_name = 'HTML_CONTAINER'.
Initialise and create the HTML control that will display the
PDF output as URL
IF NOT g_html_control IS INITIAL.
CALL METHOD g_html_control->free
EXCEPTIONS
OTHERS = 0.
CLEAR g_html_control.
ENDIF.
CREATE OBJECT g_html_control
EXPORTING
parent = g_html_container
saphtmlp = 'X'.
Load the pdf data and obtain the URL
CALL METHOD g_html_control->load_data
EXPORTING
size = pdf_fsize
type = 'application'
subtype = 'pdf'
IMPORTING
assigned_url = l_url
CHANGING
data_table = l_pdf_data
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
raise cntl_error.
ENDIF.
CALL METHOD cl_gui_cfw=>flush.
Show the URL
CALL METHOD g_html_control->show_url
EXPORTING
url = l_url.
ENDMODULE. " STATUS_0100 OUTPUT
Edited by: Anandakumar.K on Oct 25, 2011 12:47 PM
Edited by: Anandakumar.K on Oct 25, 2011 12:54 PMHi,
as you can see in SAP notes 842767 and 1349413, spool data cannot be converted properly for all types in a Unicode conversion.
This might be possible if you have English (US7ASCII) characters only, but with Chinese characters I do not think that a small piece of code can do it ...
Hence I think you need to recreate the data on the Unicode system ...
Best regards,
Nils Buerckel
Edited by: Nils Buerckel on Nov 3, 2011 1:51 PM -
GUI Download Chinese Character to Excel gibberish character
Hi Experts,
I'm facing a problem where I'm using FM gui_download to save Chinese Character into Excel file.
Upon double click to open the excel file, funny character shows up.
But if I were to open the same file using a blank Ms Excel application (Go to File->Open->choose file),
Excel will prompt me to select a proper encoding (GB2312 in this case), and the Chinese character can be seen thereafter.
But, my user doesn't want to go through this.
I've browsed through the forum and someone has posted about this before and it's unanswered.
How to download the chinese character using GUI_DOWNLOAD - unanswered
And, Re: GUI_DOWNLOAD give 2 bytes for each chinese character - I need fixed len which is not related to my problem.
Below is my code:
DATA: lv_codepage TYPE cpcodepage,
lv_char_cpage TYPE abap_encod,
lv_encoding TYPE abap_encod.
Get Code Page for Chinese Character Spras = '1' or 'ZH'
CALL FUNCTION 'NLS_GET_FRONTEND_CP'
EXPORTING
langu = '1' " Chinese Simplified Table T002
fetype = 'MS' " Manufacturer is Microsoft Table TCP05
IMPORTING
frontend_codepage = lv_codepage
EXCEPTIONS
illegal_syst_codepage = 1
no_frontend_cp_found = 2
internal_or_db_error = 3
OTHERS = 4.
Conversion c(4) = n(10)
lv_char_cpage = lv_codepage.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = p_file
filetype = 'DAT' "tried ASC and not working as well
codepage = lv_char_cpage "8404 in this case tried 8400 and same result
replacement = '#'
write_field_separator = 'X'
TABLES
data_tab = i_data_cnvr "table content
fieldnames = i_data_head "table header
Please help. Does this has something to do with utf-8 encoding?
Thank you.
Thanks,
ZY SeeHi Nitesh,
Is there a way to check the Excel codepage? Do you mean by codepage = 936 for GB2312 encoding?
Anyway, this issue is fixed. Issue is related to unicode system.
Below codes for gui_download solved the problem.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
codepage = '4103'
replacement = '#'
write_field_separator = 'X'
write_bom = 'X'
TABLES
data_tab = i_data_cnvr
fieldnames = i_data_head
Codepage = 4103 for utf-16 Unicode system.
Write-bom = 'X' to write Byte-Order-Mark.
Thanks,
ZY See -
Allowing client to upload/download standardised excel file for testing [Beginner]
Hi,
New to development so please bear with me if this stuff is super easy (really hope it is).
I'm developing a simple web app that will run some stat tests on data, however, I want any user to be able to upload the info they want to test in a pre-formatted excel sheet rather than have them input it. The website would then show the tables, run the
tests in the cloud, and return results plus highlighting individual rows that are over certain thresholds. I then want the user to be able to download the result and the highlighted rows back to a new excel sheet.
I'm looking for a simple way to do this that will allow me to
mess around a bit with the formatting of the uploaded table to make it look a bit nicer and more in line with the flat design of the site
make sure the file you download looks good when you open it in excel again
I've heard office 365 has a lot of useful API calls and as there's now a free version online perhaps it's possible to integrate that into a site? I'm also assuming there are some conversion methods to migrate an excel file into MySQL, but are there then
potential issues migrating back, especially formatting etc?
Thanks in advance, and sorry again if this is just too basic.Hi Freppas,
For this requirement, I suggest that you could consider Open XML SDK for office. For this way, you could easy do something for the uploaded excel file.
There are some links that can help you:
# Welcome to the Open XML SDK 2.5 for Office
https://msdn.microsoft.com/en-us/library/office/bb448854.aspx
# Open XML Format SDK 2.0: Getting Started Best Practices
http://blogs.msdn.com/b/erikaehrli/archive/2009/05/14/open-xml-format-sdk-2-0-getting-started-best-practices.aspx
Regards
Starain
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Error Raised while uploading Excel file to SAP
Hi All,
I am getting error while uploading excel file into SAP using the function module 'TEXT_CONVERT_XLS_TO_SAP'.
Error Message is UX(893) - 'Excel file & cannot be processed' .
Please let me know what went wrong.
Regards,
DeepthiHi,
1 .TEXT_CONVERT_XLS_TO_SAP Funtion module will work if you have installed Microsoft Excel at front end.
2. Whenyou declare internal table for upload, specify the char only in the strcture ,don't specify any data element or dictionary reference. If the data element and dictionaly reference is character field then its ok.
eg.
types:begin of st_data,
field1 type char15,
field2 type char23,
endif.
3. Close the excel before you upload
Hope this might solve your issue.
Regards
Aromal R -
Append characters to an existin excel file
Hello guys
I've an excel file where I write an array (single data type)of 6 elements by using "Write to Spreadsheet File.vi" On this file I also need to write a new column with the time and date.At this point everthing it´s ok, but when I´m trying to append this new column(date & time) with "Write character to File.vi" it writes this data not in the rigth column but it does it in the first column of the file. Could it be wrong by problems with the EOF marker??
I attached the excel file.
Thanks in advance
Attachments:
test_RPila.xls 14 KBHello,
When I use the Write to Spreadsheet File.vi to append data to an existing Excel file, the data I input doesn't appear in the file.All I get is replace the Excel file by the new data and I loss the old data. This is due because Excel changes tab-delimited format. There is a KB than explains it:
http://digital.ni.com/public.nsf/websearch/D1629D863F0442CC86256A0200558A15?OpenDocument
You could use the Report Generation Toolkit to avoid this Excel formatting. Look at the following KB and you will see that it is possible:
http://digital.ni.com/public.nsf/websearch/EFCE1C25DCE7483E86256CAF00539451?OpenDocument
If you don't have Report Generation Toolkit, try to contact to NI
regards
crisR -
Downloading excel file from FTP Server to Application Server
Hi,
I have to get data from an excel file available on FTP server into an Internal table.Can I use FTP_SERVER_TO_R3 to do so.
Please let me know if there are any function modules available to do this.
Thanks,
Prasuna.Dear Gayatri,
You can get the file from FTP to internal table...
I am sending you the code with inline comments ....Hope this will be helpful to you.
Data: lv_key TYPE i VALUE 26101957.
Data: lv_password(30) TYPE c.
i_rfc_destination = 'SAPFTP'.
lv_length = STRLEN( i_password ).
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = i_password "give ftp server pwd
sourcelen = lv_length
key = lv_key
IMPORTING
destination = lv_password.
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
user = i_user "give ftp user name
password = lv_password
host = i_host
rfc_destination = i_rfc_destination
IMPORTING
handle = lv_ftp_handle
EXCEPTIONS
not_connected = 1
OTHERS = 2.
CONCATENATE 'cd' i_folder_path INTO lv_cmd SEPARATED BY space.
*i_folder path is the path in ftp server where file is stored
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
handle = lv_ftp_handle
command = lv_cmd
TABLES
data = result
EXCEPTIONS
command_error = 1
tcpip_error = 2.
lv_blob_length = 392.
TRANSLATE i_filename TO LOWER CASE.
CALL FUNCTION 'FTP_SERVER_TO_R3'
EXPORTING
handle = lv_ftp_handle
fname = i_filename "give required file name
IMPORTING
blob_length = lv_blob_length
TABLES
blob = lt_dummy.
Regards
Sajid -
How to read the data from Excel file and Store in XML file using java
Hi All,
I got a problem with Excel file.
My problem is how to read the data from Excel file and Store in XML file using java excel api.
For getting the data from Excel file what are all the steps i need to follow to get the correct result.
Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
Thanks & Regards,
Sreenu,
[email protected],
india,If you want someone to do your work, please have the courtesy to provide payment.
http://www.rentacoder.com
Maybe you are looking for
-
I would like to delete my debit card information from all devices associated with it with it
I would like to remove my bank debit card information from all apple devices associated with it. I have charges to my account that I do not want to continue as I don't know where they are coming from. I need to delete all credit information as soon a
-
Trying to get sql server compact up and running. I connected to a sqlite database and atuo generated the model.cs code. however, I get the following error. Error 1 The type or namespace name 'SQLite' could not be found (are you missing a using
-
phones are constantly searching for internet connection My time capsule/air port is always losing internet connection----anyone know how to solve this?
-
Data connection issue - Unable to load URL
Hi Folks, when I am trying to import URL (developed based on Query as Web services) in Xcelsius 2008, I am getting error "Unable to load URL". My other teammates are able to upload using their own laptop, so it indicates there is no issue on server s
-
Hey guys, I've got a little problem with the audio on a video I'm working on. In the video, I have several very low bass sounds (LFE, or low-frequency effect). Kind of like those sounds you hear in dramatic movie trailers. Because the volume of the L