Skip to Content
avatar image
Former Member

Getting a PDF in an xstring format in the ABAP environment

I am trying to create a PDF in ABAP reusing the ADS/SFP functionality that I can send to XI without saving the pdf first to a file (i.e. Getting the PDF in an xstring format or similar that can be put into an XML structure).

I've gone as far as to see that the class CL_FP_PDF_OBJECT appears to support returning an xstring; but does anyone have an example of how to work directly with this class or if there is a higher level class that can assist in this manner?

Note - My aim is to be able to generate reports online plus using the same form, be able to send the file through XI to be stored in Documentum (file store).



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Mar 16, 2006 at 06:53 AM

    Okay - It was easy.

    Basically without being clear, from your own program, you set up the print type parameters using

    FP_CREATE_COMPOSER_INPUT with USER_SETTINGS = 'X' and CONTROL_PARAMETERS having no_dialog set to 'X'.

    Then taking the output of this function, set getpdf = 'X' and call function FPCOMP_JOB_OPEN with the previous output (sets up the internal output for when you call the pdf creation step).

    Now get your Adobe Form function and call it. The pdf xstring is returned in the formoutput variable.

    Now you can send this xstring to XI, or use the function SCMS_XSTRING_TO_BINARY to get a binary table, and then you can do what you want with it like send through a BSP or save as a file.

    If you want a better description, please reply to this message. my code is not worth posting at this stage as I'm just trying to prove it will work for some other developers.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi All,

      excuse me if I send you a new request, but I'm developing an interface by XI in order to create a XML with a TAG <spool> containing a PDF file of an invoice printform. I create a proxy that is called after the printform creation (by a standard smartforms) using the OTF data released from FORM_CLOSE w/o the spool generation (get_otf parameters set to 'X'). after I create a message mapping that compose the final XML and send it to receivers.

      My problem is related to the data type of my tag <spool>. my XSD schema output needs a xsd:based64Binary type. when I generated the proxy the system send a warning message ("The XSD type base64Binary does not exactly correspond to the ABAP type RAWSTRING Message no. SPRX067). When the data is passed from proxy to XI, every 77 characters, system inserts a CR/LF.

      It's correct use a proxy?

      in order to convert the OTF data to the based64 string I used:



      bin_filesize = lv_numbytes


      otf = i_otfdata

      doctab_archive = ls_doctab_archive

      lines = lt_line


      • Funzione per codifica in base64



      decode = ' '

      io_spec = 'T'

      ostr_input_data_l = lv_numbytes


      ostr_input_data = lt_line

      ostr_digested_data = pdf_based64



      thank you in advance,