<?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: Call a subroutine from a Method in background mode in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956471#M1966890</link>
    <description>&lt;P&gt;IMHO setting the status doesn't make more sense, could you consider executing the form in your main code before calling FM (even do not call the FM if spool not required, and then convert to OO) you could check if sy-batch is not initial or use a print event and not a screen event.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jun 2019 12:37:52 GMT</pubDate>
    <dc:creator>RaymondGiuseppi</dc:creator>
    <dc:date>2019-06-26T12:37:52Z</dc:date>
    <item>
      <title>Call a subroutine from a Method in background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956468#M1966887</link>
      <description>&lt;P&gt;I have a method which calls a subroutine 'USER_COMMAND' in Program 'MYPROGAM'. In foreground this works fine the code in the subroutine is executed. Is there a way to do this in background? When I run in background the code in the subroutine is not executed.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1698615-pic1.png" /&gt;&lt;/P&gt; 
  &lt;P&gt;All help greatly appreciated. &lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 11:52:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956468#M1966887</guid>
      <dc:creator>former_member201275</dc:creator>
      <dc:date>2019-06-26T11:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Call a subroutine from a Method in background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956469#M1966888</link>
      <description>&lt;P&gt;Handling user commands in background does not make sense, does it?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 11:59:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956469#M1966888</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2019-06-26T11:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Call a subroutine from a Method in background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956470#M1966889</link>
      <description>&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;sorry, left out the part where i force the user_command:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1698617-pic2.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 12:08:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956470#M1966889</guid>
      <dc:creator>former_member201275</dc:creator>
      <dc:date>2019-06-26T12:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Call a subroutine from a Method in background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956471#M1966890</link>
      <description>&lt;P&gt;IMHO setting the status doesn't make more sense, could you consider executing the form in your main code before calling FM (even do not call the FM if spool not required, and then convert to OO) you could check if sy-batch is not initial or use a print event and not a screen event.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 12:37:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956471#M1966890</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2019-06-26T12:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Call a subroutine from a Method in background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956472#M1966891</link>
      <description>&lt;P&gt;Hi Raymond,&lt;/P&gt;&lt;P&gt;I have commented that out but it doesn't work either.&lt;/P&gt;&lt;P&gt;What I would like to do is execute the code in subroutine 'USER_COMMAND' of program 'MYPROGAM' when the program is run in background. Not sure if this can be called from a method in background mode? &lt;/P&gt;&lt;P&gt;At the moment when the program is run in foreground, the USER_COMMAND subroutine is called and the user can then click on a button called 'BOOK' to make a booking. I want to change the program so that it runs in background and forces the booking.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 12:55:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956472#M1966891</guid>
      <dc:creator>former_member201275</dc:creator>
      <dc:date>2019-06-26T12:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Call a subroutine from a Method in background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956473#M1966892</link>
      <description>&lt;P&gt;Assertion 'At the moment when the program is run in foreground, the USER_COMMAND subroutine is called and the user can then click on a button called 'BOOK' to make a booking.' is false!&lt;/P&gt;&lt;P&gt;In foreground the ALV grid is displayed, and when user interacts with screen the user_command and other events are triggered so the form would be executed. the SET_PF_STATUS form is only executed in foreground in the PBO of screen...&lt;/P&gt;&lt;P&gt;In background, a spool is génerated by REUSE_ALV_LIST_DISPLAY and bye, Bye. (look for cl_gui_alv_grid=&amp;gt;offline( ) in the FM execution) &lt;/P&gt;&lt;P&gt;So use a print event such as TOP_OF_PAGE and check if sy-batch is set. Or rewrite youw whole code for better reusability...&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 13:06:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956473#M1966892</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2019-06-26T13:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Call a subroutine from a Method in background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956474#M1966893</link>
      <description>&lt;P&gt;I vote for Raymond answer : "... or rewrite your whole code for better reusability"&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 13:10:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956474#M1966893</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-06-26T13:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Call a subroutine from a Method in background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956475#M1966894</link>
      <description>&lt;P&gt;Rewrite your code so you use CL_GUI_ALV_GRID or CL_SALV_TABLE directly.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 13:52:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956475#M1966894</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2019-06-26T13:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Call a subroutine from a Method in background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956476#M1966895</link>
      <description>&lt;P&gt;Thank you to all of you so much for your help. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 14:48:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956476#M1966895</guid>
      <dc:creator>former_member201275</dc:creator>
      <dc:date>2019-06-26T14:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Call a subroutine from a Method in background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956477#M1966896</link>
      <description>&lt;P&gt;You could try using the parameter IS_PRINT_LVC.    I believe that's what I used.   However, it's been a long time.  If you have the time, the best thing to do is to use one of the classes suggested above.  They are actually a lot easier to work with than the function module.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2019 15:11:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956477#M1966896</guid>
      <dc:creator>mmcisme1</dc:creator>
      <dc:date>2019-06-28T15:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Call a subroutine from a Method in background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956478#M1966897</link>
      <description>&lt;P&gt;I have solved this using the advice of Raymond Giuseppi i.e. rewrite the whole Code. For some reason I cannot 'accept' his answer. All of the other answers though also helped me a lot!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 15:02:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956478#M1966897</guid>
      <dc:creator>former_member201275</dc:creator>
      <dc:date>2019-07-05T15:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Call a subroutine from a Method in background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956479#M1966898</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;raymond.giuseppi&lt;/SPAN&gt; please convert your comment into an answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 18:20:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956479#M1966898</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-07-05T18:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Call a subroutine from a Method in background mode</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956480#M1966899</link>
      <description>&lt;P&gt;(Converted to answer)&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jul 2019 07:24:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-a-subroutine-from-a-method-in-background-mode/m-p/11956480#M1966899</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2019-07-07T07:24:51Z</dc:date>
    </item>
  </channel>
</rss>

