<?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 Submit a Report and execute pushbutton, in background in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-a-report-and-execute-pushbutton-in-background/m-p/11900676#M1962265</link>
    <description>&lt;P&gt;I have a program, PGM_A, which when executed runs another program PGM_B, which outputs a list and a number of pushbuttons along the top one named 'TEST' and the other 'UPDATE'.&lt;/P&gt;
  &lt;P&gt;I want to be able to run PGM_A in background mode in such a way that it executes PGM_B and executes the code for the pushbutton 'UPDATE'.&lt;/P&gt;
  &lt;P&gt;Is this done with, in PGM_A, Submit PGM_B with param = 'UPDATE'?&lt;/P&gt;
  &lt;P&gt;All help greatly appreciated!&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2019 20:25:12 GMT</pubDate>
    <dc:creator>former_member201275</dc:creator>
    <dc:date>2019-06-12T20:25:12Z</dc:date>
    <item>
      <title>Submit a Report and execute pushbutton, in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-a-report-and-execute-pushbutton-in-background/m-p/11900676#M1962265</link>
      <description>&lt;P&gt;I have a program, PGM_A, which when executed runs another program PGM_B, which outputs a list and a number of pushbuttons along the top one named 'TEST' and the other 'UPDATE'.&lt;/P&gt;
  &lt;P&gt;I want to be able to run PGM_A in background mode in such a way that it executes PGM_B and executes the code for the pushbutton 'UPDATE'.&lt;/P&gt;
  &lt;P&gt;Is this done with, in PGM_A, Submit PGM_B with param = 'UPDATE'?&lt;/P&gt;
  &lt;P&gt;All help greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 20:25:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/submit-a-report-and-execute-pushbutton-in-background/m-p/11900676#M1962265</guid>
      <dc:creator>former_member201275</dc:creator>
      <dc:date>2019-06-12T20:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Submit a Report and execute pushbutton, in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-a-report-and-execute-pushbutton-in-background/m-p/11900677#M1962266</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try bellow code . &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; PROGRAM test.

  DATA : v_jobhead      LIKE tbtcjob.
  DATA : v_jobcount     LIKE tbtcjob-jobcount.
  DATA : v_eventparm    LIKE tbtcjob-eventparm.
  DATA : v_flg_released TYPE c.
  DATA : e_error.
  DATA : running        LIKE tbtcv-run.


  TYPES: esp1_boolean   LIKE boole-boole.


  CONSTANTS: esp1_false TYPE esp1_boolean VALUE ' ',
             esp1_true  TYPE esp1_boolean VALUE 'X'.

  CONSTANTS: lv_true    TYPE boolean VALUE esp1_true,
             lv_false   TYPE boolean VALUE esp1_false.


  DATA      : v_jobnam  LIKE tbtcjob-jobname VALUE 'ZPGM_A', "Background Job Name
              v_report  LIKE sy-repid        VALUE 'PGM_B', "Second program name which you need to run on background 
              v_varian  LIKE raldb-variant,
              v_uname   LIKE sy-uname.

  v_uname = sy-uname.
*  v_varian = sy-slset.
* Add the new job
  CALL FUNCTION 'JOB_OPEN'
    EXPORTING
*     delanfrep        = 'X'
      jobname          = v_jobnam
    IMPORTING
      jobcount         = v_jobcount
    EXCEPTIONS
      cant_create_job  = 1
      invalid_job_data = 2
      jobname_missing  = 3
      OTHERS           = 4.


  IF sy-subrc &amp;lt;&amp;gt; 0.
    e_error = 'X'.
    MESSAGE 'Background job scheduling fail' TYPE 'E'.
    EXIT.
  ELSE.

    CALL FUNCTION 'JOB_SUBMIT'
      EXPORTING
        authcknam               = v_uname
        jobcount                = v_jobcount
        jobname                 = v_jobnam
        report                  = v_report
        variant                 = v_varian
      EXCEPTIONS
        bad_priparams           = 1
        bad_xpgflags            = 2
        invalid_jobdata         = 3
        jobname_missing         = 4
        job_notex               = 5
        job_submit_failed       = 6
        lock_failed             = 7
        program_missing         = 8
        prog_abap_and_extpg_set = 9
        OTHERS                  = 10.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE 'Background job scheduling fail' TYPE 'E'.
      EXIT.
    ELSE.
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
*         EVENT_ID             = IC_WWI_WORKPROCESS_EVENT
*         EVENT_PARAM          = V_EVENTPARM
*         EVENT_PERIODIC       = 'X'
          jobcount             = v_jobcount
          jobname              = v_jobnam
          strtimmed            = 'X'
        IMPORTING
          job_was_released     = v_flg_released
        EXCEPTIONS
          cant_start_immediate = 1
          invalid_startdate    = 2
          jobname_missing      = 3
          job_close_failed     = 4
          job_nosteps          = 5
          job_notex            = 6
          lock_failed          = 7
          OTHERS               = 8.
      IF sy-subrc &amp;lt;&amp;gt; 0.
        MESSAGE 'Background job scheduling fail' TYPE 'E'.
        EXIT.
      ELSE.
        MESSAGE 'Background job scheduled' TYPE 'S'.
      ENDIF.
    ENDIF." job submit
  ENDIF. "jon open
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jun 2019 20:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/submit-a-report-and-execute-pushbutton-in-background/m-p/11900677#M1962266</guid>
      <dc:creator>Nawanandana</dc:creator>
      <dc:date>2019-06-12T20:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Submit a Report and execute pushbutton, in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-a-report-and-execute-pushbutton-in-background/m-p/11900678#M1962267</link>
      <description>&lt;P&gt;Thank you for your answer. &lt;/P&gt;&lt;P&gt;The PGM_A has a selection screen which I will fill out, and then I will choose, from the Menu Options, execute in background. And then inside PGM_A I need to execute PGM_B which should then force the opcode for 'UPDATE' push button.&lt;/P&gt;&lt;P&gt;Can I send the value of which Push Button to select via JOB_SUBMIT?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 21:33:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/submit-a-report-and-execute-pushbutton-in-background/m-p/11900678#M1962267</guid>
      <dc:creator>former_member201275</dc:creator>
      <dc:date>2019-06-12T21:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Submit a Report and execute pushbutton, in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-a-report-and-execute-pushbutton-in-background/m-p/11900679#M1962268</link>
      <description>&lt;P&gt;Did you try batch input (call transaction ... using .../SHDB)?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 06:38:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/submit-a-report-and-execute-pushbutton-in-background/m-p/11900679#M1962268</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-06-13T06:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Submit a Report and execute pushbutton, in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-a-report-and-execute-pushbutton-in-background/m-p/11900680#M1962269</link>
      <description>&lt;P&gt;I'm afraid, not. You cannot store a pressed button in a variant, can you?&lt;/P&gt;&lt;P&gt;maybe you can add a hidden parameter in PGM_B an pass this.&lt;/P&gt;&lt;P&gt;PGM_B:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;parameters: p_upd as checkbox no-display.
if p_upd = 'X'.
  perform my_code.
endif.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Jun 2019 07:56:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/submit-a-report-and-execute-pushbutton-in-background/m-p/11900680#M1962269</guid>
      <dc:creator>former_member226519</dc:creator>
      <dc:date>2019-06-13T07:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Submit a Report and execute pushbutton, in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/submit-a-report-and-execute-pushbutton-in-background/m-p/11900681#M1962270</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you need to pass parameters as well , no need to call JOB_SUBMIT FM. but other two FM have to call . Look at bellow sequnce &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;1. CALL FUNCTION 'JOB_OPEN'

2. SUBMIT PGM_B AND RETURN
        WITH p_ifux = p_ifux
        WITH p_ofux = p_ofux
        WITH p_acc  = p_acc
        WITH p_payr = p_payr
        USER sy-uname
     VIA JOB v_jobnam
      NUMBER v_jobcount.

3 .CALL FUNCTION 'JOB_CLOSE'&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Jun 2019 13:10:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/submit-a-report-and-execute-pushbutton-in-background/m-p/11900681#M1962270</guid>
      <dc:creator>Nawanandana</dc:creator>
      <dc:date>2019-06-13T13:10:35Z</dc:date>
    </item>
  </channel>
</rss>

