System Error(sy-subrc =2) with InvalidDataException in SAP Adobe forms
I am ABAP developer and working extensively on Adobe Form, would like to share challenging or time consuming scenario.
We have received several issues where users are not unable to preview Adobe Form. System doesn’t show any error message. When we start debugging we came to know the below error and its an system error due to invalid characters in XML Data.
“ADS: com.adobe.ProcessingException: com.adobe.ProcessingException: 0 : InvalidDataException: Xml parsing error: reference to invalid character number (error code 14), line 3, column 177698 of file (200.101)”
We were facing issue with the quotation with around 260 items, it is quite challenging for us to check invalid characters manually.
To find Invalid Characters, or data in which field causing the issue, we need to analyze the runtime in XML format. Documented the blow sequence of steps t read the XML data runtime.
Put Breakpoints at lines with PDFDOC.XML & XFD.XML in below method in class CL_FP_PDF_OBJECT and reproduce the case.
In debugging mode, open l_bindata & Formdata by double click. Change view to XML Browser and save the file in XML format.
In XML File I searched for Invalid Character formats and able the find the invalid entry.
It’s a random check for invalid characters. we were able to track the invalid data causing the exception.
Please refer to the below link, which will help you in identifying the Exception in detailed