<?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: Best practice for selection-screen in global classes in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-practice-for-selection-screen-in-global-classes/m-p/7214810#M1523082</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uwe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;correct me if I'm wrong: I remember RS_REFRESH_FROM_SELECTOPTIONS not doing the job perfectly, what ever it was, maybe&lt;/P&gt;&lt;P&gt;'RS_REFRESH_FROM_SELECTOPTIONS' reads only the main selection screen of a report; it will not give you SELECTION-SCREEN BEGIN OF SCREEN ... contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At least it is good for extracting the names of all SELECT-OPTIONS and PARAMETERS. Then use a dynamic assign like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data:
  lv_assign type string
field-symbols:
  &amp;lt;selopt&amp;gt; type table.
CONCATENATE '('IM_CALLING_PROGRAM')' SELNAME INTO lv_assign.
assign (lv_assign) to &amp;lt;selopt&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This not only enables you to use but also to modify the select-options on the screen as you want or need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know since 10 or more years SAP warns to use the dynamic ASSIGN. But it works perfectly and will probably never be changed.&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;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Aug 2010 22:10:26 GMT</pubDate>
    <dc:creator>Clemenss</dc:creator>
    <dc:date>2010-08-26T22:10:26Z</dc:date>
    <item>
      <title>Best practice for selection-screen in global classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-practice-for-selection-screen-in-global-classes/m-p/7214808#M1523080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have build several selection screens (overall 150+ select options / parameters) some time ago and want to reuse some of them within a global class encapsulating a ALV grid. Is there an easy way to forward the values of a selection screen into my class?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have thought of a function module (in the function group which contains the dynpros) to extract the values. Is this a state-of-the-art approach?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Alej&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Aug 2010 19:38:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-practice-for-selection-screen-in-global-classes/m-p/7214808#M1523080</guid>
      <dc:creator>alejiandro_sensejl</dc:creator>
      <dc:date>2010-08-26T19:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice for selection-screen in global classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-practice-for-selection-screen-in-global-classes/m-p/7214809#M1523081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alej&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would use the approach as implemented in class CL_DBSEL_CATS, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_macro_name="thread" id="279638"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Aug 2010 21:06:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-practice-for-selection-screen-in-global-classes/m-p/7214809#M1523081</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2010-08-26T21:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice for selection-screen in global classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-practice-for-selection-screen-in-global-classes/m-p/7214810#M1523082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uwe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;correct me if I'm wrong: I remember RS_REFRESH_FROM_SELECTOPTIONS not doing the job perfectly, what ever it was, maybe&lt;/P&gt;&lt;P&gt;'RS_REFRESH_FROM_SELECTOPTIONS' reads only the main selection screen of a report; it will not give you SELECTION-SCREEN BEGIN OF SCREEN ... contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At least it is good for extracting the names of all SELECT-OPTIONS and PARAMETERS. Then use a dynamic assign like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data:
  lv_assign type string
field-symbols:
  &amp;lt;selopt&amp;gt; type table.
CONCATENATE '('IM_CALLING_PROGRAM')' SELNAME INTO lv_assign.
assign (lv_assign) to &amp;lt;selopt&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This not only enables you to use but also to modify the select-options on the screen as you want or need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know since 10 or more years SAP warns to use the dynamic ASSIGN. But it works perfectly and will probably never be changed.&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;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Aug 2010 22:10:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-practice-for-selection-screen-in-global-classes/m-p/7214810#M1523082</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2010-08-26T22:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice for selection-screen in global classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-practice-for-selection-screen-in-global-classes/m-p/7214811#M1523083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alej&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're only after the definition of the selection screen then function module RS_ISOLATE_1_SELSCREEN might be useful. It will not give you the values but will give you the full selection screen definition, including any subscreens and blocks. Maybe you could use a combination of RS_ISOLATE_1_SELSCREEN and RS_REFRESH_FROM_SELECTOPTIONS to achieve what you want.&lt;/P&gt;&lt;P&gt;Let us know how you go...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Glen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Aug 2010 03:56:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-practice-for-selection-screen-in-global-classes/m-p/7214811#M1523083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-27T03:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice for selection-screen in global classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-practice-for-selection-screen-in-global-classes/m-p/7214812#M1523084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The approach recommended by SAP (read: Horst Keller) is to build a function group which would contain selection screens defined in a main program. There should be one function module for each selection screen. Function modules should have exporting parameters for all the fields of the screen it contains. Then you are able to call such a function module in a global class. You should implement an exception or some return flag which would say that screen has been left using back, exit, cancel buttons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;METHOD method_a.
  ...
  CALL FUNCTION 'MY_SELECTION_SCREEN'
    IMPORTING
      e_so_vbeln = l_rng_vbeln
    EXCEPTIONS ex_screen_left = 4.
  IF sy-subrc = 4.
    ...
  ELSE.
    ...
  ENDIF.
ENDMETHOD.

FUNCTION.   "MY_SELECTION_SCREEN
  CALL SELECTION-SCREEN 1001.
  IF sy-subrc NE 0.
    RAISE ex_screen_left.
  ENDIF.
  e_so_vbeln = so_vbeln.
ENDFUNCTION.

SELECTION-SCREEN BEGIN OF SCREEN 1001.
SELECT-OPTIONS so_vbeln FOR ...
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Krzysztof Usowicz on Sep 14, 2010 2:59 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Krzysztof Usowicz on Sep 14, 2010 3:04 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Sep 2010 12:59:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-practice-for-selection-screen-in-global-classes/m-p/7214812#M1523084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-14T12:59:02Z</dc:date>
    </item>
  </channel>
</rss>

