<?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: System Variable to capture triggered events. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-variable-to-capture-triggered-events/m-p/6626314#M1441236</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 would not like to harcode teh events in my prg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However i would like to dynamically allocate the event triggered into teh variable in the Form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or say its a Function Module. It can be used in any prg and in any event. Then in that case to dynamically allocate the event in which this is called wht can be a probable way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jan 2010 11:25:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-01-28T11:25:11Z</dc:date>
    <item>
      <title>System Variable to capture triggered events.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-variable-to-capture-triggered-events/m-p/6626312#M1441234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any system variable to catch the triggered event Like Initialisation, Start of Selection etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a form which can be called in different events. And i want to display different msgs based on the based on the Event in which the form is called. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code for this display msg will be written inside the Form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please advice on how to capture the triggered event.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2010 11:14:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-variable-to-capture-triggered-events/m-p/6626312#M1441234</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-28T11:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: System Variable to capture triggered events.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-variable-to-capture-triggered-events/m-p/6626313#M1441235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you want to know the Events, when you know yourself that in which event you are calling your subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can hardCode your message.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2010 11:18:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-variable-to-capture-triggered-events/m-p/6626313#M1441235</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-28T11:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: System Variable to capture triggered events.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-variable-to-capture-triggered-events/m-p/6626314#M1441236</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 would not like to harcode teh events in my prg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However i would like to dynamically allocate the event triggered into teh variable in the Form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or say its a Function Module. It can be used in any prg and in any event. Then in that case to dynamically allocate the event in which this is called wht can be a probable way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2010 11:25:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-variable-to-capture-triggered-events/m-p/6626314#M1441236</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-28T11:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: System Variable to capture triggered events.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-variable-to-capture-triggered-events/m-p/6626315#M1441237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add a additional paramater in form for event. And while calling pass the event name from where its being called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CONSTANTS : BEGIN OF event ,
               init TYPE char01 VALUE 'A' ,
               strt TYPE char01 VALUE 'B' ,
               ends TYPE char01 VALUE 'C' ,
               topf TYPE char01 VALUE 'D' ,
            END OF event .

INITIALIZATION.

  PERFORM add_please USING 1 1 event-init .

START-OF-SELECTION .

  PERFORM add_please USING 2 2 event-strt .

END-OF-SELECTION .
  PERFORM add_please USING 3 4 event-ends .

TOP-OF-PAGE .

  PERFORM add_please USING 4 4 event-topf .

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  ADD_PLEASE
*&amp;amp;---------------------------------------------------------------------*
FORM add_please USING lv_a       TYPE i
                      lv_b       TYPE i
                      from_event TYPE char01 .

  DATA :lv_sum TYPE i .
  lv_sum = lv_a + lv_b .
  CASE from_event.
    WHEN event-init .
      WRITE : / 'Initialization' , lv_sum .
    WHEN event-strt .
      WRITE : / 'Start of Selection' , lv_sum .
    WHEN event-ends .
      WRITE : / 'End of Selection' , lv_sum .
    WHEN event-topf .
      WRITE : / 'Top of Page' , lv_sum .
  ENDCASE .

ENDFORM.                    "ADD_PLEASE&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2010 11:30:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-variable-to-capture-triggered-events/m-p/6626315#M1441237</guid>
      <dc:creator>Pawan_Kesari</dc:creator>
      <dc:date>2010-01-28T11:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: System Variable to capture triggered events.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/system-variable-to-capture-triggered-events/m-p/6626316#M1441238</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;Thanks for the code. However my requirement is this function module or form can be called inside any prg. Hence i will not have access to code in the calling program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways, I just found out there is a FM SYSTEM_CALLSTACK that returns the event in which this form of function module is called. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks anyways.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2010 11:48:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/system-variable-to-capture-triggered-events/m-p/6626316#M1441238</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-28T11:48:19Z</dc:date>
    </item>
  </channel>
</rss>

