0% found this document useful (0 votes)
88 views3 pages

E 20241128 Excel Issue

This SAP Knowledge Base Article addresses the issue of illegal XML characters causing corruption in Excel files exported from ALV grids. It provides a detailed method for identifying and correcting these illegal characters to restore functionality. The article also references related SAP Notes and KBAs for further assistance.

Uploaded by

@y@
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views3 pages

E 20241128 Excel Issue

This SAP Knowledge Base Article addresses the issue of illegal XML characters causing corruption in Excel files exported from ALV grids. It provides a detailed method for identifying and correcting these illegal characters to restore functionality. The article also references related SAP Notes and KBAs for further assistance.

Uploaded by

@y@
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

SAP Knowledge Base Article

2616421 - How to determine and correct illegal XML character error?


Component: BC-SRV-ALV (Basis Components > Basis Services/Communication Interfaces > SAP List Viewer),
Version: 14, Released On: 09.11.2024

Symptom
The 'Export to excel' function of an ALV grid creates a corrupt xlsx file, which cannot be opened by Microsoft Excel. The
error message is similar to the following example:
"Removed Part: /xl/sharedStrings.xml part with XML error. (Strings) Illegal xml character. Line 1, column 393939.
Removed Records: Cell information from /xl/worksheets/sheet1.xml part"

Which may be accompanied of other error pop ups such as "We found a problem with some content in '<filename>.XLS'. Do
you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes."
Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is
purely coincidental.

Environment
SAP NetWeaver
SAP Web Application Server for SAP S/4HANA all versions
Web Dynpro for ABAP

Reproducing the Issue


Use the 'Export to excel' function of an ALV grid.

Cause
The 'Illegal xml character...' message is not ABAP related, but a known limitation in XML. In such cases, the data to be
exported contains characters which are unknown or illegal in XML.

Resolution
How to determine the illegal XML character
1. After exported the .XLSX file, change the file extension to .ZIP, then decompress it.
2. Find the sharedStrings.xml file within the 'xl' folder. It could also be the file /xl/worksheets/sheet1.xml.
3. Open it, with an editor, which can show the position of the characters.
4. Check the line and column showed in the error message. The shortcut 'Ctrl + G' can be used to find the column.

5. Take notes about these characters and rename the whole file back to .XLSX extension. (Do not change and save the xml
here because after the compression the XLSX file will be corrupt.)
How to fix the error
1. Change the extension from .XLSX to .ZIP (do not decompress it!).
2. Double click on the .ZIP file and find the sharedStrings.xml file.
3. Copy sharedStrings.xml to any location, but "out of" the .zip file (to desktop, for instance)
4. Open the copied sharedStrings.xml file with an xml editor and find the characters which were discovered in the first
part of the Resolution ("How to determine the illegal XML character").
5. Delete these corrupted characters and save the file.
6. Copy the sharedStrings.xml back to from where it was copied (it was in the .zip) - use copy & replace
when windows asks, so basically overwrite the corrupted sharedStrings.xml with the changed/corrected
sharedStrings.xml
7. After finishing, change the extension back to .XLSX.
NOTE: Copying the sharedString.xml file is necessary because the OS will not let the file get changed within the .zip, even if
the read-only flag is removed.
The corresponding application team is responsible for the data itself.
In case further assistance is needed, involve the appropriate component.

See Also
KBA 2517992 - Export to excel creates corrupt file
SAP Note 1825127 - ALV Grid: Display of strange characters
KBA 3413729 - Excel error "We found a problem with some content in '<filename>.xls'" occurs when saving ALV as
'EXCEL Files (*.xls) through Local file (Ctrl+Shift+ F9)

Keywords
export to excel, alv, corrupt, XML, illegal character, wrong character, misplaced character, popup, excel error, try to open, not
possible, not opening, warning, popup, removed part, /xl/sharedStrings.xml, exportieren, verdorben, falsch character,
dialogfenster, warnung, Excel was able to open the file by repairing or removing the unreadable content. , Repairs to
'export.XLSX', ALVGrid, Gridview, ALV grid view, ALVgridview, &#0; Removed Part: /xl/sharedStrings.xml part with XML
error. (Strings) Illegal xml character; Removed Records: Cell information from /xl/worksheets/sheet1.xml part. Line 1,
corrupted, corruption, problem, recover.
Attributes
Key Value

Other Basis Components > Frontend Services (SAP Note 1322184) > SAP Desktop Office Integration (BC-FES-OFFI)
Components

Other Basis Components > Web Dynpro > Configurable Component > List Viewer > ALV for ABAP (BC-WD-CMP-ALV-
Components ABA)

Products
Products

SAP NetWeaver all versions

SAP Web Application Server for SAP S/4HANA all versions

This document refers to


SAP Note/KBA Component Title

2517992 BC-WD-CMP-ALV-ABA WDA: Export to Excel creates a corrupt file

1825127 BC-SRV-ALV ALV Grid: Display of strange characters

This document is referenced by


SAP Component Title
Note/KBA

2810959 Illegal xml character error occurs when exporting the report result into Excel - SAP ERP &
SAP S/4HANA.

2517992 BC-WD-CMP-ALV- WDA: Export to Excel creates a corrupt file


ABA

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy