<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to trigger script form to auto generate spool? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13990585#M2038316</link>
    <description>&lt;P&gt;Yes,&amp;nbsp;&lt;SPAN&gt;CL_RSPO_SPOOLID_TO_PDF=&amp;gt;GET_SPOOL_PDF&amp;nbsp;can be called in the background.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jan 2025 07:43:28 GMT</pubDate>
    <dc:creator>WO1</dc:creator>
    <dc:date>2025-01-20T07:43:28Z</dc:date>
    <item>
      <title>How to trigger script form to auto generate spool?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13958751#M2038061</link>
      <description>&lt;P&gt;Requirement is to create interface that will be triggered by outside app, They will pass invoice number then SAP will call the invoice form and download to PDF in a local file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far i am calling program&amp;nbsp;RFKORD50 but this only let me preview the file and will only generate spool once i manually select PRINT. I need this program to auto generate the spool once called then i will convert the spool to PDF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;REPORT z_trigger_script_to_pdf.

PARAMETERS: p_docnum TYPE bkorm-belnr OBLIGATORY DEFAULT '7035000025', " Document Number
            p_path   TYPE rlgrap-filename  OBLIGATORY DEFAULT 'C:\Users\jasmine.clemencio\Desktop\UAT.pdf', " File path for PDF output
            p_comp   TYPE bkorm-bukrs OBLIGATORY DEFAULT 'MY10',
            p_year   TYPE bkorm-gjahr OBLIGATORY DEFAULT '2023',
            p_cor    TYPE bkorm-event OBLIGATORY DEFAULT 'Z0017'.

DATA: lv_spool_no   TYPE tsp01-rqident,
      lv_file_path  TYPE rlgrap-filename,
      lv_parameters TYPE string.

" Step 1: Call RFKORD50 to generate spool
SUBMIT zrfkord50
  WITH rbelnr  = p_docnum
  WITH rgjahr  = p_comp
  WITH rgjahr   = p_year
  WITH revent  =  p_cor
  WITH spool = 'X' " Indicate spool creation
  AND RETURN.


" Step 2: Retrieve the spool number
SELECT SINGLE rqident
  INTO lv_spool_no
  FROM tsp01
  WHERE rq2name = sy-uname
    AND rqclient = sy-mandt.
lv_spool_no = 13300.
*IF sy-subrc NE 0.
*  WRITE: / 'Failed to retrieve spool number.'.
*  EXIT.
*ENDIF.

WRITE: / 'Spool Number:', lv_spool_no.

" Step 3: Call RSTXPDFT4 to convert spool to PDF

SUBMIT zrstxpdft4
  WITH spoolno = 13300
  WITH p_file  =  p_path
  EXPORTING LIST TO MEMORY
  AND RETURN.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 07:51:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13958751#M2038061</guid>
      <dc:creator>JasClemencio</dc:creator>
      <dc:date>2024-12-09T07:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger script form to auto generate spool?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13968483#M2038161</link>
      <description>&lt;P&gt;Did you try to call function like SET_PRINT_PARAMETERS ?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to set create new spool&amp;nbsp;&lt;/P&gt;&lt;P&gt;print immedialty ...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 14:02:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13968483#M2038161</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2024-12-19T14:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger script form to auto generate spool?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13968537#M2038163</link>
      <description>&lt;P&gt;You could also&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Execute the first SUBMIT with additions WITHOUT SPOOL DYNPRO and TO SAP-SPOOL spool_options (build this structure spool_options with FM GET_PRINT_PARAMETERS to prevent some immediate print and delete)&lt;/LI&gt;&lt;LI&gt;Get the spool number of the created spool request which is contained in a SPA/GPA parameter named SPI, using&amp;nbsp;&lt;SPAN&gt;GET PARAMETER ID 'SPI' FIELD spoolno.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 19 Dec 2024 14:57:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13968537#M2038163</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2024-12-19T14:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger script form to auto generate spool?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13984665#M2038270</link>
      <description>&lt;P&gt;And use CL_RSPO_SPOOLID_TO_PDF=&amp;gt;GET_SPOOL_PDF to get the PDF as an xstring.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 22:29:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13984665#M2038270</guid>
      <dc:creator>WO1</dc:creator>
      <dc:date>2025-01-13T22:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger script form to auto generate spool?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13990541#M2038313</link>
      <description>&lt;P&gt;the code above works fine. Except i cannot run the program in background because of program&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;rfkord50&lt;/PRE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/2867"&gt;@FredericGirod&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Did you try to call function like SET_PRINT_PARAMETERS ?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to set create new spool&amp;nbsp;&lt;/P&gt;&lt;P&gt;print immedialty ...&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Jan 2025 07:07:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13990541#M2038313</guid>
      <dc:creator>JasClemencio</dc:creator>
      <dc:date>2025-01-20T07:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger script form to auto generate spool?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13990543#M2038314</link>
      <description>&lt;P&gt;the code above works fine. Except i cannot run the program in background because of program&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 07:08:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13990543#M2038314</guid>
      <dc:creator>JasClemencio</dc:creator>
      <dc:date>2025-01-20T07:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger script form to auto generate spool?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13990544#M2038315</link>
      <description>&lt;P&gt;this works when i run background? external app will trigger the FM&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 07:09:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13990544#M2038315</guid>
      <dc:creator>JasClemencio</dc:creator>
      <dc:date>2025-01-20T07:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger script form to auto generate spool?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13990585#M2038316</link>
      <description>&lt;P&gt;Yes,&amp;nbsp;&lt;SPAN&gt;CL_RSPO_SPOOLID_TO_PDF=&amp;gt;GET_SPOOL_PDF&amp;nbsp;can be called in the background.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 07:43:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-trigger-script-form-to-auto-generate-spool/m-p/13990585#M2038316</guid>
      <dc:creator>WO1</dc:creator>
      <dc:date>2025-01-20T07:43:28Z</dc:date>
    </item>
  </channel>
</rss>

