Get XFT template by form name

246 Views Asked by At

Please let me know if there is a method by which we can get the XFT template of the Adobe Form in SAP. Basically I want to input form name ('Z_INVOICE', for example) and get back XFT template of the form in xstring format.

1

There are 1 best solutions below

2
On

Sandra probably missed _DOWNLOAD method of CL_FP_PDF_OBJECT class does exactly what you want, it downloads all the files that are created during PDF generation.

Moreover, it is explicitly confirmed in ADS help and list of files is given:

enter image description here

Provided you need this occasionally, the only thing you should do is to put a breakpoint in method _DOWNLOAD and initiate document output by standard means catching the necessary file, not to forget setting lv_download to true in debugger. File will be downloaded to C:\Users\<username>\AppData\Local\SAP\SAP GUI\tmp\ by default.

If you want this to be done automatically and/or on a regular basis, things get more complicated, you should inspect the call stack starting from print program (SD_SDOC_PRINT01 on the screen) and find the most simplistic point which to emulate in code:

enter image description here

At first sight for me it seems that FPCOMP_CREATE_PDX is the most probable candidate, but it should be checked thoroughly.

After you choose the point to start, you inspect the parameters with which FPCOMP_CREATE_PDX is called while standard output and make a custom program that generates these parameters for arbitrary PDF form. The only thing you should set in your custom program, is that lv_download to be true, it can be dome thru enhancement in this method.

And voila, you'll get universal approach that can export XFT into directory for any PDF template.