<?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: Submit statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-statement/m-p/5421237#M1244336</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Search on SCN with keywords JOB_OPEN, JOB_SUBMIT, JOB_CLOSe. these are the functions used for background job processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Apr 2009 08:11:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-06T08:11:22Z</dc:date>
    <item>
      <title>Submit statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-statement/m-p/5421236#M1244335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Am making use of submit statement via a job.Once i submit the report using the job after completing, it must do further processing.I no need to generate a spool in the job log.How to do it.Its enough to have the job started and job finished in the job.How to do it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2009 08:06:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/submit-statement/m-p/5421236#M1244335</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-06T08:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Submit statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-statement/m-p/5421237#M1244336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Search on SCN with keywords JOB_OPEN, JOB_SUBMIT, JOB_CLOSe. these are the functions used for background job processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2009 08:11:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/submit-statement/m-p/5421237#M1244336</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-06T08:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Submit statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-statement/m-p/5421238#M1244337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lakshmi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a Piece of code which clears all of your doubts...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Write statement to represent report output. Spool request is created&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if write statement is executed in background. This could also be an&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ALV grid which would be converted to PDF without any extra effort&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  WRITE 'Hello World'.&lt;/P&gt;&lt;P&gt;  new-page.&lt;/P&gt;&lt;P&gt;  commit work.&lt;/P&gt;&lt;P&gt;  new-page print off.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-batch EQ 'X'.&lt;/P&gt;&lt;P&gt;    PERFORM get_job_details.&lt;/P&gt;&lt;P&gt;    PERFORM obtain_spool_id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;Alternative way could be to submit another program and store spool&lt;/P&gt;&lt;/LI&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;id into memory, will be stored in sy-spono.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;*submit ZSPOOLTOPDF2&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       to sap-spool&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       spool parameters   %_print&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       archive parameters %_print&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       without spool dynpro&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       and return.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get spool id from program called above&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM convert_spool_to_pdf.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    if p_delspl EQ 'X'.&lt;/P&gt;&lt;P&gt;      PERFORM delete_spool.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-sysid = c_dev.&lt;/P&gt;&lt;P&gt;      wait up to 5 seconds.&lt;/P&gt;&lt;P&gt;      SUBMIT rsconn01 WITH mode   = 'INT'&lt;/P&gt;&lt;P&gt;                      WITH output = 'X'&lt;/P&gt;&lt;P&gt;                      AND RETURN.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    SKIP.&lt;/P&gt;&lt;P&gt;    WRITE:/ 'Program must be executed in background in-order for spool',&lt;/P&gt;&lt;P&gt;            'request to be created.'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM obtain_spool_id.&lt;/P&gt;&lt;P&gt;  CHECK NOT ( gd_jobname IS INITIAL ).&lt;/P&gt;&lt;P&gt;  CHECK NOT ( gd_jobcount IS INITIAL ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT * FROM  tbtcp&lt;/P&gt;&lt;P&gt;                 INTO TABLE it_tbtcp&lt;/P&gt;&lt;P&gt;                 WHERE      jobname     = gd_jobname&lt;/P&gt;&lt;P&gt;                 AND        jobcount    = gd_jobcount&lt;/P&gt;&lt;P&gt;                 AND        stepcount   = gd_stepcount&lt;/P&gt;&lt;P&gt;                 AND        listident   &amp;lt;&amp;gt; '0000000000'&lt;/P&gt;&lt;P&gt;                 ORDER BY   jobname&lt;/P&gt;&lt;P&gt;                            jobcount&lt;/P&gt;&lt;P&gt;                            stepcount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    message s004(zdd) with gd_spool_nr.&lt;/P&gt;&lt;P&gt;    gd_spool_nr = wa_tbtcp-listident.&lt;/P&gt;&lt;P&gt;    MESSAGE s004(zdd) WITH gd_spool_nr.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    MESSAGE s005(zdd).&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_job_details.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get current job details&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'GET_JOB_RUNTIME_INFO'&lt;/P&gt;&lt;P&gt;       IMPORTING&lt;/P&gt;&lt;P&gt;            eventid                 = gd_eventid&lt;/P&gt;&lt;P&gt;            eventparm               = gd_eventparm&lt;/P&gt;&lt;P&gt;            external_program_active = gd_external_program_active&lt;/P&gt;&lt;P&gt;            jobcount                = gd_jobcount&lt;/P&gt;&lt;P&gt;            jobname                 = gd_jobname&lt;/P&gt;&lt;P&gt;            stepcount               = gd_stepcount&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            no_runtime_info         = 1&lt;/P&gt;&lt;P&gt;            OTHERS                  = 2.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM convert_spool_to_pdf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            src_spoolid              = gd_spool_nr&lt;/P&gt;&lt;P&gt;            no_dialog                = c_no&lt;/P&gt;&lt;P&gt;            dst_device               = c_device&lt;/P&gt;&lt;P&gt;       IMPORTING&lt;/P&gt;&lt;P&gt;            pdf_bytecount            = gd_bytecount&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            pdf                      = it_pdf_output.&lt;/P&gt;&lt;P&gt;     CHECK sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Transfer the 132-long strings to 255-long strings&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT it_pdf_output.&lt;/P&gt;&lt;P&gt;    TRANSLATE it_pdf_output USING ' ~'.&lt;/P&gt;&lt;P&gt;    CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TRANSLATE gd_buffer USING '~ '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    it_mess_att = gd_buffer.&lt;/P&gt;&lt;P&gt;    APPEND it_mess_att.&lt;/P&gt;&lt;P&gt;    SHIFT gd_buffer LEFT BY 255 PLACES.&lt;/P&gt;&lt;P&gt;    IF gd_buffer IS INITIAL.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM delete_spool.&lt;/P&gt;&lt;P&gt;  DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ld_spool_nr = gd_spool_nr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CHECK p_delspl &amp;lt;&amp;gt; c_no.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            spoolid = ld_spool_nr.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Dileep .C&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2009 08:23:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/submit-statement/m-p/5421238#M1244337</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-06T08:23:37Z</dc:date>
    </item>
  </channel>
</rss>

