<?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: AT Cursor Selection - Module call in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-cursor-selection-module-call/m-p/11725355#M1948482</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess this example is used because it's not trivial to understand, and programmers often do this error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE AT CURSOR-SELECTION : &lt;A href="http://help.sap.com/abapdocu_702/en/dynpmodule.htm#!ABAP_ADDITION_2@2@"&gt;http://help.sap.com/abapdocu_702/en/dynpmodule.htm#!ABAP_ADDITION_2@2@&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's just how it has been designed. As for MODULE AT EXIT-COMMAND (there can be only one).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Jun 2016 16:36:28 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2016-06-21T16:36:28Z</dc:date>
    <item>
      <title>AT Cursor Selection - Module call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-cursor-selection-module-call/m-p/11725354#M1948481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can someone help me explain the below example. The same can be found in the link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/abapdocu_702/en/abendynpro_on_cond_abexa.htm"&gt;http://help.sap.com/abapdocu_702/en/abendynpro_on_cond_abexa.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function key settings for F2 has been assigned the function type 'S' and function code 'CS', which is necessary for a module with "At cursor selection" to be called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I do understand is when the field input1 is double clicked, the module c1 gets called since there is a field statement for the same - This is explained on the second last point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I don't understand is when the field input2 or input3 is double clicked, as per the explanation on the last point the module "cursor" gets called but not the module "c2". The reason as explained is when there are more than one module for cursor selection only the last one gets called. If this is the case the very last statement is also common for the field input1. So when input1 is double clicked why wouldn't it call the module "cursor" instead of the module "c2"?&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/jiveimages/979924" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vikram.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 13:13:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-cursor-selection-module-call/m-p/11725354#M1948481</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-21T13:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: AT Cursor Selection - Module call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-cursor-selection-module-call/m-p/11725355#M1948482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess this example is used because it's not trivial to understand, and programmers often do this error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE AT CURSOR-SELECTION : &lt;A href="http://help.sap.com/abapdocu_702/en/dynpmodule.htm#!ABAP_ADDITION_2@2@"&gt;http://help.sap.com/abapdocu_702/en/dynpmodule.htm#!ABAP_ADDITION_2@2@&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's just how it has been designed. As for MODULE AT EXIT-COMMAND (there can be only one).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 16:36:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-cursor-selection-module-call/m-p/11725355#M1948482</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-06-21T16:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: AT Cursor Selection - Module call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-cursor-selection-module-call/m-p/11725356#M1948483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;Sandra Rossi wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt; It's just how it has been designed. &lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;That is what I do not understand. If the design allows more than 1 module with "at cursor selection" to be present and only the last one will be called, then when the function code F2 is selected for the field input1, it should call the module "cursor" and not "c1", yes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 18:00:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-cursor-selection-module-call/m-p/11725356#M1948483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-06-21T18:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: AT Cursor Selection - Module call</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-cursor-selection-module-call/m-p/11725357#M1948484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I could test it in a live system. For input1, you're right, it calls c1. So the rule is more complex, and I came to the following conclusion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are three MODULE ... AT CURSOR-SELECTION possibilities:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Module for a given field:&lt;PRE&gt;&lt;CODE&gt;FIELD m1field MODULE m1 AT CURSOR-SELECTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;Chain of fields:&lt;PRE&gt;&lt;CODE&gt;CHAIN.
&amp;nbsp; FIELD : m2field, m2field_bis.
&amp;nbsp; MODULE m2 AT CURSOR-SELECTION.
ENDCHAIN.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;All fields:&lt;PRE&gt;&lt;CODE&gt;MODULE m3 AT CURSOR-SELECTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;When the PAI is called (any function code):&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;the PAI flow logic is processed sequentially, as usual&lt;/LI&gt;&lt;LI&gt;if a module AT CURSOR-SELECTION is found and function code is CS and function type is S then :&lt;UL&gt;&lt;LI&gt;If it's a m1-like module, and corresponds to the double-clicked field, (and in the previous lines there's no m1-like module corresponding to the double-clicked field - which was thus already processed/executed), it's executed.&lt;/LI&gt;&lt;LI&gt;If it's one of type m2 or m3-like module, it's executed only if, in the following lines of the PAI, there's no other m2 or m3-like module, and there's no m1-like module corresponding to the double-clicked field.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Concerning your question about the dynpro generation, why it doesn't warn about the "incompatibilities", I don't know, but there are other similar situations, for instance CHAIN in the PBO being ignored at runtime but no warning/error at compile time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 21:11:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-cursor-selection-module-call/m-p/11725357#M1948484</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-06-21T21:11:40Z</dc:date>
    </item>
  </channel>
</rss>

