This code sample explains how to create a PDF xstring from internal table.

    SELECT * FROM but000 INTO TABLE @DATA(lt_tab) UP TO 100 rows.
    DATA(lo_pdf) = NEW cl_apoc_pdf_generator( ).
    lo_pdf->create_pdf(
      EXPORTING
        input             = lt_tab
      RECEIVING
        pdf_binary_output = DATA(rv_bin)
    ).

The rv_bin is xstring binary content and can be displayed as pdf.

To test this code, SEGW based OData service or RAP OData service can be used. Example output is as below.

Visit ABAP Code Samples page for more code samples.


If you like the content, please subscribe…

Join 4,016 other subscribers

Discovering ABAP YouTube Channel