<?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: Passing select-options value in method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-select-options-value-in-method/m-p/3325507#M796599</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Anee&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The coding of this functionality is quite simple:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT zmy_report.


DATA:  go_myclass   TYPE REF TO zcl_myclass,
           gd_repid         TYPE syst-repid.



PARAMETERS:
  p_bukrs   ...

SELECT-OPTIONS:
  o_kunnr  ...


START-OF-SELECTION.

  gd_repid = syst-repid.

  CREATE OBJECT go_myclass
    EXPORTING
      id_calling_program = gd_repid.
...

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And that's how your CONSTRUCTOR method should look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
METHOD constructor.  " IMPORTING parameter id_calling_program

CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
  EXPORTING
    CURR_REPORT = id_calling_report
  TABLES
    SELECTION_TABLE = me-&amp;gt;mt_selopts.

" NOTE: define mt_selopts as instance attribute of table type RSPARAMS_TT
  

ENDMETHOD.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally you have to extract the parameter and select-options from MT_SELOPTS.&lt;/P&gt;&lt;P&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>Wed, 30 Jan 2008 22:59:24 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2008-01-30T22:59:24Z</dc:date>
    <item>
      <title>Passing select-options value in method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-select-options-value-in-method/m-p/3325503#M796595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to pass select-options value in method ?&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select-options: carrid for spfli-carrid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class cl_myclass implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select  carrid connid from &lt;/P&gt;&lt;P&gt;spfli &lt;U&gt;&lt;STRONG&gt;where carrid in carrid&lt;/STRONG&gt;&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Jan 2008 06:12:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-select-options-value-in-method/m-p/3325503#M796595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-26T06:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Passing select-options value in method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-select-options-value-in-method/m-p/3325504#M796596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Anee&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The easiest (and probably most elegant) way is to use function module &lt;STRONG&gt;RS_REFRESH_FROM_SELECTOPTIONS&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the CONSTRUCTOR method of your class you add an EXPORTING parameter &lt;STRONG&gt;IM_CALLING_PROGRAM&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Within the CONSTRUCTOR method you call the function module with the value of the calling program (which is your selection report). The function module returns you all current selection criteria of the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at class &lt;STRONG&gt;CL_DBSEL_CATS&lt;/STRONG&gt; for a SAP standard example.&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>Sat, 26 Jan 2008 12:54:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-select-options-value-in-method/m-p/3325504#M796596</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-01-26T12:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Passing select-options value in method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-select-options-value-in-method/m-p/3325505#M796597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;THANKS A BUNCH&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jan 2008 02:13:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-select-options-value-in-method/m-p/3325505#M796597</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-27T02:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Passing select-options value in method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-select-options-value-in-method/m-p/3325506#M796598</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;&lt;/P&gt;&lt;P&gt;I am not getting that sample standard class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give me an example where you are population data in method from Select-options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Anee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2008 18:30:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-select-options-value-in-method/m-p/3325506#M796598</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-30T18:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Passing select-options value in method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-select-options-value-in-method/m-p/3325507#M796599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Anee&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The coding of this functionality is quite simple:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT zmy_report.


DATA:  go_myclass   TYPE REF TO zcl_myclass,
           gd_repid         TYPE syst-repid.



PARAMETERS:
  p_bukrs   ...

SELECT-OPTIONS:
  o_kunnr  ...


START-OF-SELECTION.

  gd_repid = syst-repid.

  CREATE OBJECT go_myclass
    EXPORTING
      id_calling_program = gd_repid.
...

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And that's how your CONSTRUCTOR method should look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
METHOD constructor.  " IMPORTING parameter id_calling_program

CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
  EXPORTING
    CURR_REPORT = id_calling_report
  TABLES
    SELECTION_TABLE = me-&amp;gt;mt_selopts.

" NOTE: define mt_selopts as instance attribute of table type RSPARAMS_TT
  

ENDMETHOD.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally you have to extract the parameter and select-options from MT_SELOPTS.&lt;/P&gt;&lt;P&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>Wed, 30 Jan 2008 22:59:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-select-options-value-in-method/m-p/3325507#M796599</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-01-30T22:59:24Z</dc:date>
    </item>
  </channel>
</rss>

