16 May 2025

ADS "Serious error during message processing"

Another post on a PDF generation problem.
Sometime during PDF generation by the ADS (ie from a form created with SFP), the response returned by the ADS is an error stating "error during message processing". 

This post describe how to get the cause of the error.

Problem

During the processing of the form, the ADS return this message, along with the document number :

While is is good to know, this is not exactly filled with informations... We need to dig deeper  to find what really occurred.

Error returned

First, let check the exact error that the ADS returns

  1.  In class CL_FP_PDF_OBJECT, method EXECUTE_INTERNAL, insert a breakpoint in the line 263 (Note that the line may change depending on SAP's modification to the class)


  2. Reproduce the issue and when the debugger stop, open the variable L_SOAPRESPONSE by double click. At this point the the structure is empty.

  3. Go one step further by F6.
    The  field _RP_STRINGS now contain the ADS exception details

  4.  Double click on the text line under _VALUE, and change the View to HTML Browser, exception texts is displayed similarly as in default trace

Invalid XML file

If the message contains something about invalid characters, invalid values, or anything in the XML file, then we need to check it.

Example

For example:

Processing exception during a "Render" operation.

Request start time: Wed May 15 15:16:08 CEST 2024

com.adobe.ProcessingException: com.adobe.ProcessingException: 0 : InvalidDataException: Xml parsing error: reference to invalid character number (error code 14), line 1, column 12157 of file

Resolution

  1. In class CL_FP_PDF_OBJECT, method EXECUTE_INTERNAL, insert a breakpoint in the line 183:
  2. Reproduce the issue and, when debugger stopped in the breakpoint, open variable _FORMDATA;
  3. Probably this field output will be in the view "Fast Display". Change it to "XML Browser" or "HTML" and copy the content; (This functionality only works in the new debugger).
  4.  Open this content in notepad++ and search for the problematic value. Notepad++ is useful here because it displays non-displayable characters as small black boxes, which help when it’s the cause of a problem.



Having a STX character in the middle of a string may give problem (STX mean : “Start of Text”) …Note that in the debugger, this char is not visible, hence the use of Notepad++

 Conclusion

Now we “only” have to find where this text comes from, and correct this…

 References

This post is based on the following SAP Notes 

  • 2668144 "How to check ADS exception on ABAP system") and 
  • 2161416 ("How to check the XML file (XFD) in runtime on PDF generation")

No comments:

Post a Comment