1

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.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
user9695260
  • 347
  • 3
  • 17
  • Maybe get some inspiration from the demo program `RSXFT_XFT_API_DEMO`... – Sandra Rossi May 26 '20 at 21:10
  • Thank you for prompt reply, but I was wondering if there is a way to retrieve XFT layout of already existing form rather than write XFT template from scratch. – user9695260 May 27 '20 at 14:45
  • I investigated more in depth. It seems that SAP proposes to generate XFT files, that you may inject them to the Adobe Server to produce forms (see code inside CL_FP_PDF_OBJECT), but I don't see any evidence in SAP code of extracting XFT from Adobe Forms out of the Adobe Server. Sorry, I can't help more. – Sandra Rossi May 28 '20 at 07:41
  • thank you for your assistance, greatly appreciated – user9695260 May 28 '20 at 11:23

1 Answers1

1

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.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
  • for some unknown reason, I get PDFDOC, XFD and PDLOUT files, but not XFT – user9695260 Jun 25 '20 at 14:34
  • it help they say that `some of the files may not occur depending on the performed process`. I tried on my system and I also was not able to catch the XFT. Sorry, I cannot help more here, it needs more investigation – Suncatcher Jun 26 '20 at 05:48