<?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 Call-back routine not triggered. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-back-routine-not-triggered/m-p/8613936#M1663323</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created the following sample program for testing.  And it seems like the call-back routine does not get triggered when I put in function call to execute external OS command.  Can anyone confirm if it is indeed not possible to implement call-back with this type of scenario?  Anyone has any alternatives?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, the RFC-enabled function will act like a separate timer (a different dialog task run in the background).  When time is up, it will execute the call-back routine in ZTEST.  This routine can be used for further clean-up action, such as closing connections, releasing logical lock, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report ztest .&lt;/P&gt;&lt;P&gt;p_maxrun type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;  call function 'z_timer' &lt;/P&gt;&lt;P&gt;      starting new task destination 'NONE' &lt;/P&gt;&lt;P&gt;      performing handle_timeout on end of task&lt;/P&gt;&lt;P&gt;      exporting i_interval =  p_max.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at itab.&lt;/P&gt;&lt;P&gt;    perform ping_ip_address changing good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if good &amp;lt;&amp;gt; 'X'.&lt;/P&gt;&lt;P&gt;      continue.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form handle_timeout.&lt;/P&gt;&lt;P&gt;  message s000(38) 'timeout occured.'.&lt;/P&gt;&lt;P&gt;  leave program.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form ping_ip_address.&lt;/P&gt;&lt;P&gt;  call function 'SXPG_CALL_SYSTEM' to run external OS command "PING" on application server.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**************************************************&lt;/P&gt;&lt;P&gt;Function z_timer &lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local Interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(I_INTERVAL) TYPE  AVGTIM&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wait up to i_interval.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endfunction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Feb 2012 09:32:56 GMT</pubDate>
    <dc:creator>chongwahng</dc:creator>
    <dc:date>2012-02-24T09:32:56Z</dc:date>
    <item>
      <title>Call-back routine not triggered.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-back-routine-not-triggered/m-p/8613936#M1663323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created the following sample program for testing.  And it seems like the call-back routine does not get triggered when I put in function call to execute external OS command.  Can anyone confirm if it is indeed not possible to implement call-back with this type of scenario?  Anyone has any alternatives?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, the RFC-enabled function will act like a separate timer (a different dialog task run in the background).  When time is up, it will execute the call-back routine in ZTEST.  This routine can be used for further clean-up action, such as closing connections, releasing logical lock, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report ztest .&lt;/P&gt;&lt;P&gt;p_maxrun type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;  call function 'z_timer' &lt;/P&gt;&lt;P&gt;      starting new task destination 'NONE' &lt;/P&gt;&lt;P&gt;      performing handle_timeout on end of task&lt;/P&gt;&lt;P&gt;      exporting i_interval =  p_max.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at itab.&lt;/P&gt;&lt;P&gt;    perform ping_ip_address changing good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if good &amp;lt;&amp;gt; 'X'.&lt;/P&gt;&lt;P&gt;      continue.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form handle_timeout.&lt;/P&gt;&lt;P&gt;  message s000(38) 'timeout occured.'.&lt;/P&gt;&lt;P&gt;  leave program.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form ping_ip_address.&lt;/P&gt;&lt;P&gt;  call function 'SXPG_CALL_SYSTEM' to run external OS command "PING" on application server.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**************************************************&lt;/P&gt;&lt;P&gt;Function z_timer &lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local Interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(I_INTERVAL) TYPE  AVGTIM&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wait up to i_interval.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endfunction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 09:32:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-back-routine-not-triggered/m-p/8613936#M1663323</guid>
      <dc:creator>chongwahng</dc:creator>
      <dc:date>2012-02-24T09:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Call-back routine not triggered.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-back-routine-not-triggered/m-p/8613937#M1663324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please check this demo:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ZSBAB008 NO STANDARD PAGE HEADING.

DATA: XV_SWITCH(1)   TYPE  N  VALUE  1.
DATA: XV_ARCUS(3)    TYPE  N.
DATA: XV_SKIP(02)    TYPE  N.
DATA: XV_POS(02)     TYPE  N.
DATA: XV_BOGEN       TYPE  F.

CONSTANTS: PI        TYPE  F VALUE '3.1415926535897932'.

DATA: BEGIN OF XK_UFO,
        L01(35) VALUE 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
        L02(35) VALUE 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB',
        L03(35) VALUE 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC',
        L04(35) VALUE 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD',
        L05(05) VALUE 'VVVVV',
      END   OF XK_UFO.

DATA: BEGIN OF XK_UFO2,
        L01(35) VALUE 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
        L02(35) VALUE 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
        L03(35) VALUE 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
        L04(35) VALUE 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
        L05(05) VALUE 'WWWWW',
      END   OF XK_UFO2.

PARAMETERS: XP_WAIT  LIKE  SY-SPONR DEFAULT 1 no-display.

START-OF-SELECTION.

*    Aufruf Warteschleife
     CALL FUNCTION                     'ZT_ENQUE_SLEEP'
        STARTING    NEW TASK           'WAIT'
        PERFORMING  FERTIG             ON END OF TASK
        EXPORTING
                    SECONDS         =  XP_WAIT
        EXCEPTIONS
                    OTHERS          =  1.

*    Bild ausgeben
     PERFORM                           AUSGABE.

************************************************************
AT USER-COMMAND.
************************************************************

*    RESET User Idle Time
     COMMIT  WORK.

*    Aufruf Warteschleife
     CALL FUNCTION                     'ZT_ENQUE_SLEEP'
        STARTING    NEW TASK           'WAIT'
        PERFORMING  FERTIG             ON END OF TASK
        EXPORTING
                    SECONDS         =  XP_WAIT
        EXCEPTIONS
                    OTHERS          =  1.

*    Bild ausgeben
     PERFORM                           AUSGABE.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  FERTIG
*&amp;amp;---------------------------------------------------------------------*
*       Ausgabe veranlassen
*----------------------------------------------------------------------*
*  --&amp;gt;  L_TASK  Taskname
*  &amp;lt;--  keine Ausgabeparameter
*----------------------------------------------------------------------*
FORM FERTIG USING L_TASK.

     RECEIVE RESULTS FROM FUNCTION 'ENQUE_SLEEP'.
     SET USER-COMMAND 'SHOW'.

ENDFORM.                    " FERTIG&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FM&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION ZT_ENQUE_SLEEP.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"       IMPORTING
*"             VALUE(SECONDS) LIKE  SY-SPONR
*"       EXCEPTIONS
*"              SYSTEM_FAILURE
*"----------------------------------------------------------------------
                                                           
   CALL FUNCTION 'ENQUE_SLEEP'
        EXPORTING
             SECONDS        = SECONDS
        EXCEPTIONS
             SYSTEM_FAILURE = 1
             OTHERS         = 2.
                                                                                IF SY-SUBRC &amp;lt;&amp;gt; 0.
      RAISE SYSTEM_FAILURE.
   ENDIF.
                                                            
ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, original output couldn't be shown in browser as a code ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Klaus Babl on Feb 24, 2012 11:00 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 09:54:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-back-routine-not-triggered/m-p/8613937#M1663324</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-24T09:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Call-back routine not triggered.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-back-routine-not-triggered/m-p/8613938#M1663325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Klaus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply.  The sample code is pretty similar with what I have done on my own implementation.  The only difference is your sample code did not call external OS command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have finally decided to give up implementing the call-back routine.  As a workaround, I have to execute a function module, BP_JOB_ABORT, to terminate the background job instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Chong Wah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 07:22:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-back-routine-not-triggered/m-p/8613938#M1663325</guid>
      <dc:creator>chongwahng</dc:creator>
      <dc:date>2012-02-27T07:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Call-back routine not triggered.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-back-routine-not-triggered/m-p/8613939#M1663326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Call-back routine not implemented.  But use function module BP_JOB_ABORT in the newly spawn task to terminate the background job instead.  Not as ideal as the call-back routine approach, but it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 07:25:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-back-routine-not-triggered/m-p/8613939#M1663326</guid>
      <dc:creator>chongwahng</dc:creator>
      <dc:date>2012-02-27T07:25:34Z</dc:date>
    </item>
  </channel>
</rss>

