<?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: select-options depend on select options in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428981#M12096</link>
    <description>&lt;P&gt;Dear Sandra,&lt;/P&gt;
  &lt;P&gt;Thank you for your reply!&lt;/P&gt;</description>
    <pubDate>Mon, 14 Aug 2017 06:51:42 GMT</pubDate>
    <dc:creator>manole_apetroaie</dc:creator>
    <dc:date>2017-08-14T06:51:42Z</dc:date>
    <item>
      <title>select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428949#M12064</link>
      <description>&lt;P&gt;Good morning!&lt;/P&gt;
  &lt;P&gt;Does anybody know if a select-options match code can depend on another select-options match code? If yes ,please post an example.For example:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECT-OPTIONS: s_klart FOR klah-klart.
SELECT-OPTIONS: s_atinn FOR cabn-atinn NO INTERVALS NO-EXTENSION.
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;The match code of s_atinn need to depend on the match code of s_klart. Until now i`ve seen only dependency between select-option and a parameter.&lt;/P&gt;
  &lt;P&gt;Have a great day!&lt;/P&gt;
  &lt;P&gt;Please find below my code:&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;- code removed by moderator. Only post relevant code, and when you've posted it, make sure it is readable - &lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 06:58:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428949#M12064</guid>
      <dc:creator>manole_apetroaie</dc:creator>
      <dc:date>2017-07-19T06:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428950#M12065</link>
      <description>&lt;P&gt;There are lots of examples all around the web how to display your own values, with function module F4IF_INT_TABLE_VALUE_REQUEST for instance. I guess you know how to build the list of S_ATINN possible values according to values in S_KLART, or are you stuck somewhere?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 07:16:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428950#M12065</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-07-19T07:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428951#M12066</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Dear Sandra,

Thank you for your reply. I only found that F4IF_INT_TABLE_VALUE_REQUEST can be used in conjunction of select-option and a parameter. I am stuck on getting a match code of s_atinn based on the value(from a match code) entered in s_klart. Thank you. I updated my question with my program code . Much appreciated.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jul 2017 07:25:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428951#M12066</guid>
      <dc:creator>manole_apetroaie</dc:creator>
      <dc:date>2017-07-19T07:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428952#M12067</link>
      <description>&lt;P&gt;Nonetheless, unless I completely misunderstand, Sandra's answer is correct. You &lt;STRONG&gt;cannot&lt;/STRONG&gt; get a match-code of s_atinn based on the value(from a match code) entered in s_klart. You have to write your own code using the aforementioned function module.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 08:06:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428952#M12067</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2017-07-19T08:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428953#M12068</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;If you know how to perform this selection with one parameter then all you have to do is to loop on every singe values from first select-options.&lt;/P&gt;
  &lt;P&gt;Something like :&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;AT SELECTION SCREEN ON VALUE REQUEST FOR S_ATINN.
DATA t_klart type table of khla-klart.
FIELD-SYMBOLS : &amp;lt;klart&amp;gt; type khla-klart. 
select distinct klart from khla into table t_klart where klart in s_klart.
* Create values for s_atinn from t_klart and use F4IF_INT_TABLE_VALUE_REQUEST&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Or :&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_klart.
  SELECT DISTINCT class klart FROM klah INTO TABLE i_class1.
  IF sy-subrc = 0.
    SORT i_class1 BY klart.
  ENDIF.

  "Function Module to create F4 help
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'KLART' " Name of value_tab column to be returned
      dynpprog        = sy-repid 
      dynpnr          = sy-dynnr
      dynprofield     = 'S_KLART' " Name of field to be filled
      value_org       = 'S'       " I don't know why but it's mandatory
    TABLES
      value_tab       = i_class1
*     return_tab      = it_return1
    EXCEPTIONS
      parameter_error = 1
      no_values_found = 2
      OTHERS          = 3.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_atinn-low.
  CHECK s_klart IS NOT INITIAL.

  SELECT imerk clint klart FROM ksml INTO TABLE i_ksml
  WHERE klart = s_klart.
  IF sy-subrc = 0.
    SORT i_ksml BY imerk.
  ENDIF.

  DATA t_field_tab TYPE TABLE OF dfies.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'IMERK'
      dynpprog        = sy-repid
      dynpnr          = sy-dynnr
      dynprofield     = 'S_ATINN-LOW'
      value_org       = 'S'       
    TABLES
      value_tab       = i_ksml
    EXCEPTIONS
      parameter_error = 1
      no_values_found = 2
      OTHERS          = 3.
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; Best regards&lt;/P&gt;
  &lt;P&gt;Bertrand&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 08:06:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428953#M12068</guid>
      <dc:creator>bertrand_delvallee</dc:creator>
      <dc:date>2017-07-19T08:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428954#M12069</link>
      <description>&lt;P&gt;Dear Bertrand ,&lt;/P&gt;
  &lt;P&gt;I did as you advised me and i thank you for this . When i put a value in s_klart , after i can see in s_atinn the list accordingly to what i put in s_klart,which is good.The problem is that immediatly after my report gets blocked,enters in a sort of loop ,it countinuously loading without being able do anything else. Please find below my code,do you think you can advise me of anything else that i made wrong?: &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;DATA:

      "Internal Tables of Value Table for F4 Help

*      i_class1   TYPE STANDARD TABLE OF type_class1, pentru  parametrul : s_klart

*      i_ksml    TYPE STANDARD TABLE OF type_ksml,     pentru select-options s_atinn

*      it_pspid1  TYPE STANDARD TABLE OF ty_pspid,



      "Internal Tables of Return Table for F4 Help

      wa_return1 TYPE ddshretval,

      wa_return2 TYPE ddshretval,

      wa_return3 TYPE ddshretval,

      it_return1 TYPE STANDARD TABLE OF ddshretval,

      it_return2 TYPE STANDARD TABLE OF ddshretval,

      it_return3 TYPE STANDARD TABLE OF ddshretval.



CONSTANTS:

           "Constants for F4IF_INT_TABLE_VALUE_REQUEST

           c_klart     TYPE dfies-fieldname VALUE 'S_KLART',

           c_pspid_l   TYPE dfies-fieldname VALUE 'P_PSPID-LOW',

           c_pspid_h   TYPE dfies-fieldname VALUE 'P_PSPID-HIGH',

           c_vorg      TYPE char1  VALUE 'S'.





*  ALV data declarations

data: it_sortcat   type slis_sortinfo_alv occurs 1,

      wa_sort like line of it_sortcat.



DATA: it_filter TYPE slis_t_filter_alv.

Data: ls_filter TYPE slis_filter_alv.



*selection screen

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

 PARAMETERS: s_klart LIKE klah-klart. "Tip clasa  ,SELECT-OPTIONS: s_klart FOR klah-klart NO INTERVALS NO-EXTENSION.

 SELECT-OPTIONS :s_class FOR klah-class  OBLIGATORY MATCHCODE OBJECT clas DEFAULT 'Z_MEDIU'."Nume clasa   NO INTERVALS NO-EXTENSION



SELECT-OPTIONS: s_matkl FOR  mara-matkl.  "Grup Material

SELECT-OPTIONS: s_mtart FOR  t134t-mtart. "NO INTERVALS NO-EXTENSION DEFAULT '3010'.  "Grup Material

SELECT-OPTIONS: s_matnr FOR  mara-matnr." NO INTERVALS NO-EXTENSION.  "Numar Material

SELECT-OPTIONS: s_atinn  FOR cabn-atinn NO INTERVALS NO-EXTENSION.  "Caracteristici

SELECTION-SCREEN END OF BLOCK b1.







*SELECTION-SCREEN  SKIP 1.

*

*

*START-OF-SELECTION.





AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_klart.

  SELECT DISTINCT class klart FROM klah INTO TABLE i_class1.

  IF sy-subrc = 0.

    SORT i_class1 BY klart.

  ENDIF.



  "Function Module to create F4 help

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

      retfield        = c_klart

      value_org       = c_vorg

    TABLES

      value_tab       = i_class1

      return_tab      = it_return1

    EXCEPTIONS

      parameter_error = 1

      no_values_found = 2

      OTHERS          = 3.



  IF it_return1 IS NOT INITIAL.

    LOOP AT it_return1 INTO wa_return1.

      s_klart = wa_return1-fieldval.

    ENDLOOP.

    SELECT imerk clint klart FROM ksml INTO TABLE i_ksml

    WHERE klart = s_klart.

    IF sy-subrc = 0.

      SORT i_ksml BY imerk.

    ENDIF.

  ENDIF.







AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_atinn-low.



  "Function Module to create F4 help

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

      retfield        = c_pspid_l

      value_org       = c_vorg

    TABLES

      value_tab       = i_ksml

      return_tab      = it_return2

    EXCEPTIONS

      parameter_error = 1

      no_values_found = 2

      OTHERS          = 3.



  IF it_return2 IS NOT INITIAL.

    LOOP AT it_return2 INTO wa_return2.

      s_atinn-low = wa_return2-fieldval.

    ENDLOOP.

    SELECT imerk clint klart FROM ksml INTO TABLE i_ksml

      WHERE imerk GT s_atinn-low

        AND klart = s_klart.

    IF sy-subrc = 0.

      SORT i_ksml BY imerk.

    ENDIF.

  ENDIF.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jul 2017 13:21:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428954#M12069</guid>
      <dc:creator>manole_apetroaie</dc:creator>
      <dc:date>2017-07-19T13:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428955#M12070</link>
      <description>&lt;P&gt;Dear Matthew ,&lt;/P&gt;
  &lt;P&gt;I did as you advised me and i thank you for this . When i put a value in s_klart , after i can see in s_atinn the list accordingly to what i put in s_klart,which is good.The problem is that immediatly after my report gets blocked,enters in a sort of loop ,it countinuously loading without being able do anything else. Please find below my code: &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;DATA:&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; "Internal Tables of Value Table for F4 Help&lt;/P&gt;
  &lt;P&gt;* i_class1 TYPE STANDARD TABLE OF type_class1, pentru parametrul : s_klart&lt;/P&gt;
  &lt;P&gt;* i_ksml TYPE STANDARD TABLE OF type_ksml, pentru select-options s_atinn&lt;/P&gt;
  &lt;P&gt;* it_pspid1 TYPE STANDARD TABLE OF ty_pspid,&lt;/P&gt;
  &lt;P&gt; "Internal Tables of Return Table for F4 Help&lt;/P&gt;
  &lt;P&gt; wa_return1 TYPE ddshretval,&lt;/P&gt;
  &lt;P&gt; wa_return2 TYPE ddshretval,&lt;/P&gt;
  &lt;P&gt; wa_return3 TYPE ddshretval,&lt;/P&gt;
  &lt;P&gt; it_return1 TYPE STANDARD TABLE OF ddshretval,&lt;/P&gt;
  &lt;P&gt; it_return2 TYPE STANDARD TABLE OF ddshretval,&lt;/P&gt;
  &lt;P&gt; it_return3 TYPE STANDARD TABLE OF ddshretval.&lt;/P&gt;
  &lt;P&gt;CONSTANTS:&lt;/P&gt;
  &lt;P&gt; "Constants for F4IF_INT_TABLE_VALUE_REQUEST&lt;/P&gt;
  &lt;P&gt; c_klart TYPE dfies-fieldname VALUE 'S_KLART',&lt;/P&gt;
  &lt;P&gt; c_pspid_l TYPE dfies-fieldname VALUE 'P_PSPID-LOW',&lt;/P&gt;
  &lt;P&gt; c_pspid_h TYPE dfies-fieldname VALUE 'P_PSPID-HIGH',&lt;/P&gt;
  &lt;P&gt; c_vorg TYPE char1 VALUE 'S'.&lt;/P&gt;
  &lt;P&gt;* ALV data declarations&lt;/P&gt;
  &lt;P&gt;data: it_sortcat type slis_sortinfo_alv occurs 1,&lt;/P&gt;
  &lt;P&gt; wa_sort like line of it_sortcat.&lt;/P&gt;
  &lt;P&gt;DATA: it_filter TYPE slis_t_filter_alv.&lt;/P&gt;
  &lt;P&gt;Data: ls_filter TYPE slis_filter_alv.&lt;/P&gt;
  &lt;P&gt;*selection screen&lt;/P&gt;
  &lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.&lt;/P&gt;
  &lt;P&gt; PARAMETERS: s_klart LIKE klah-klart. "Tip clasa ,SELECT-OPTIONS: s_klart FOR klah-klart NO INTERVALS NO-EXTENSION.&lt;/P&gt;
  &lt;P&gt; SELECT-OPTIONS :s_class FOR klah-class OBLIGATORY MATCHCODE OBJECT clas DEFAULT 'Z_MEDIU'."Nume clasa NO INTERVALS NO-EXTENSION&lt;/P&gt;
  &lt;P&gt;SELECT-OPTIONS: s_matkl FOR mara-matkl. "Grup Material&lt;/P&gt;
  &lt;P&gt;SELECT-OPTIONS: s_mtart FOR t134t-mtart. "NO INTERVALS NO-EXTENSION DEFAULT '3010'. "Grup Material&lt;/P&gt;
  &lt;P&gt;SELECT-OPTIONS: s_matnr FOR mara-matnr." NO INTERVALS NO-EXTENSION. "Numar Material&lt;/P&gt;
  &lt;P&gt;SELECT-OPTIONS: s_atinn FOR cabn-atinn NO INTERVALS NO-EXTENSION. "Caracteristici&lt;/P&gt;
  &lt;P&gt;SELECTION-SCREEN END OF BLOCK b1.&lt;/P&gt;
  &lt;P&gt;*SELECTION-SCREEN SKIP 1.&lt;/P&gt;
  &lt;P&gt;*&lt;/P&gt;
  &lt;P&gt;*&lt;/P&gt;
  &lt;P&gt;*START-OF-SELECTION.&lt;/P&gt;
  &lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_klart.&lt;/P&gt;
  &lt;P&gt; SELECT DISTINCT class klart FROM klah INTO TABLE i_class1.&lt;/P&gt;
  &lt;P&gt; IF sy-subrc = 0.&lt;/P&gt;
  &lt;P&gt; SORT i_class1 BY klart.&lt;/P&gt;
  &lt;P&gt; ENDIF.&lt;/P&gt;
  &lt;P&gt; "Function Module to create F4 help&lt;/P&gt;
  &lt;P&gt; CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'&lt;/P&gt;
  &lt;P&gt; EXPORTING&lt;/P&gt;
  &lt;P&gt; retfield = c_klart&lt;/P&gt;
  &lt;P&gt; value_org = c_vorg&lt;/P&gt;
  &lt;P&gt; TABLES&lt;/P&gt;
  &lt;P&gt; value_tab = i_class1&lt;/P&gt;
  &lt;P&gt; return_tab = it_return1&lt;/P&gt;
  &lt;P&gt; EXCEPTIONS&lt;/P&gt;
  &lt;P&gt; parameter_error = 1&lt;/P&gt;
  &lt;P&gt; no_values_found = 2&lt;/P&gt;
  &lt;P&gt; OTHERS = 3.&lt;/P&gt;
  &lt;P&gt; IF it_return1 IS NOT INITIAL.&lt;/P&gt;
  &lt;P&gt; LOOP AT it_return1 INTO wa_return1.&lt;/P&gt;
  &lt;P&gt; s_klart = wa_return1-fieldval.&lt;/P&gt;
  &lt;P&gt; ENDLOOP.&lt;/P&gt;
  &lt;P&gt; SELECT imerk clint klart FROM ksml INTO TABLE i_ksml&lt;/P&gt;
  &lt;P&gt; WHERE klart = s_klart.&lt;/P&gt;
  &lt;P&gt; IF sy-subrc = 0.&lt;/P&gt;
  &lt;P&gt; SORT i_ksml BY imerk.&lt;/P&gt;
  &lt;P&gt; ENDIF.&lt;/P&gt;
  &lt;P&gt; ENDIF.&lt;/P&gt;
  &lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_atinn-low.&lt;/P&gt;
  &lt;P&gt; "Function Module to create F4 help&lt;/P&gt;
  &lt;P&gt; CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'&lt;/P&gt;
  &lt;P&gt; EXPORTING&lt;/P&gt;
  &lt;P&gt; retfield = c_pspid_l&lt;/P&gt;
  &lt;P&gt; value_org = c_vorg&lt;/P&gt;
  &lt;P&gt; TABLES&lt;/P&gt;
  &lt;P&gt; value_tab = i_ksml&lt;/P&gt;
  &lt;P&gt; return_tab = it_return2&lt;/P&gt;
  &lt;P&gt; EXCEPTIONS&lt;/P&gt;
  &lt;P&gt; parameter_error = 1&lt;/P&gt;
  &lt;P&gt; no_values_found = 2&lt;/P&gt;
  &lt;P&gt; OTHERS = 3.&lt;/P&gt;
  &lt;P&gt; IF it_return2 IS NOT INITIAL.&lt;/P&gt;
  &lt;P&gt; LOOP AT it_return2 INTO wa_return2.&lt;/P&gt;
  &lt;P&gt; s_atinn-low = wa_return2-fieldval.&lt;/P&gt;
  &lt;P&gt; ENDLOOP.&lt;/P&gt;
  &lt;P&gt; SELECT imerk clint klart FROM ksml INTO TABLE i_ksml&lt;/P&gt;
  &lt;P&gt; WHERE imerk GT s_atinn-low&lt;/P&gt;
  &lt;P&gt; AND klart = s_klart.&lt;/P&gt;
  &lt;P&gt; IF sy-subrc = 0.&lt;/P&gt;
  &lt;P&gt; SORT i_ksml BY imerk.&lt;/P&gt;
  &lt;P&gt; ENDIF.&lt;/P&gt;
  &lt;P&gt; ENDIF.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 13:22:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428955#M12070</guid>
      <dc:creator>manole_apetroaie</dc:creator>
      <dc:date>2017-07-19T13:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428956#M12071</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;Ok, it seems you are lost and you complicated your code &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
  &lt;P&gt; - You should prepare data for a select-options just before you display list. Because your way imply user HAS to request data for s_klart before it can request for s_atinn -&amp;gt; that's not logical and unfair for people already knowing S_KART value &lt;/P&gt;
  &lt;P&gt;- F4IF_INT_TABLE_VALUE_REQUEST is able to fill your field directly : you don't have to do it manually. Check this :&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_klart.
  SELECT DISTINCT class klart FROM klah INTO TABLE i_class1.
  IF sy-subrc = 0.
    SORT i_class1 BY klart.
  ENDIF.


  "Function Module to create F4 help
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'KLART' " Name of value_tab column to be returned
      dynpprog        = sy-repid 
      dynpnr          = sy-dynnr
      dynprofield     = 'S_KLART' " Name of field to be filled
      value_org       = 'S'       " I don't know why but it's mandatory
    TABLES
      value_tab       = i_class1
*     return_tab      = it_return1
    EXCEPTIONS
      parameter_error = 1
      no_values_found = 2
      OTHERS          = 3.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_atinn-low.
  CHECK s_klart IS NOT INITIAL.


  SELECT imerk clint klart FROM ksml INTO TABLE i_ksml
  WHERE klart = s_klart.
  IF sy-subrc = 0.
    SORT i_ksml BY imerk.
  ENDIF.


  DATA t_field_tab TYPE TABLE OF dfies.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'IMERK'
      dynpprog        = sy-repid
      dynpnr          = sy-dynnr
      dynprofield     = 'S_ATINN-LOW'
      value_org       = 'S'       " I don't know why but it's mandatory
    TABLES
      value_tab       = i_ksml
    EXCEPTIONS
      parameter_error = 1
      no_values_found = 2
      OTHERS          = 3.
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;In a "AT SELECTION-SCREEN ON VALUE-REQUEST" block you should do nothing more than filter data and fill corresponding field with selected value. Period.&lt;/P&gt;
  &lt;P&gt;After that you will check that all selected data are correct all together in START-OF-SELECTION for example but before to process your algorithm. If some parameter can't exist together you can then display a detailled error message to prevent execution.&lt;/P&gt;
  &lt;P&gt;Note that you can have some graphic buffer problem after you update your code. That's a known problem : if you see your breakpoints are not at the same place between your code and debug mode =&amp;gt; save, close your window and log again.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 15:36:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428956#M12071</guid>
      <dc:creator>bertrand_delvallee</dc:creator>
      <dc:date>2017-07-19T15:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428957#M12072</link>
      <description>&lt;P&gt;Dear Bertrand,&lt;/P&gt;
  &lt;P&gt;Thank you for your support.I added the code you advised me and now when i click on select option of s_atinn it doesn`t show me any list. When i click on matchcode my program executes accordingly to the other select-options values. Also now when i press F8 to run my program it doesn`t execute. Please advise urgently. Thank you for your support.&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Jul 2017 05:58:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428957#M12072</guid>
      <dc:creator>manole_apetroaie</dc:creator>
      <dc:date>2017-07-20T05:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428958#M12073</link>
      <description>&lt;P&gt;PS: you may also need to call RS_SELECTIONSCREEN_READ when you process F4 on S_ATINN, to retrieve the last entered value of S_KLART, because all screen values are not automatically transferred when you press F4.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 06:06:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428958#M12073</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-07-20T06:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428959#M12074</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;I edited my code, you have to use this parameter:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;value_org       = 'S'       " I don't know why but it's mandatory&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jul 2017 09:07:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428959#M12074</guid>
      <dc:creator>bertrand_delvallee</dc:creator>
      <dc:date>2017-07-21T09:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428960#M12075</link>
      <description>&lt;P&gt;Hi Bertrand,&lt;/P&gt;
  &lt;P&gt;I have used that parameter,still not working,i`v got four days since i am working on this :(.&lt;/P&gt;
  &lt;P&gt;Thank you for your support...&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2017 13:13:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428960#M12075</guid>
      <dc:creator>manole_apetroaie</dc:creator>
      <dc:date>2017-07-21T13:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428961#M12076</link>
      <description>&lt;P&gt;It's unfair to close the question by saying "Problem is not reproducible or outdated", because I think that the question was clear and the "right answer was given". From your side, maybe it's outdated, but for people looking for the same question, the answers are useful, so the closing text of the question is misleading (means something like "don't look at me").&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 06:37:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428961#M12076</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-07-26T06:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428962#M12077</link>
      <description>&lt;P&gt;Dear Sandra,the problem was not solved ,that`s why i closed the question and opened it in another thread in another way. At some point i thought that Bertrand`s reply is sufficient but it turned out that it isn`t. I will changed the answer of this question. &lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 06:59:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428962#M12077</guid>
      <dc:creator>manole_apetroaie</dc:creator>
      <dc:date>2017-07-26T06:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428963#M12078</link>
      <description>&lt;P&gt;Reopened - other thread deleted.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 07:36:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428963#M12078</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2017-07-26T07:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428964#M12079</link>
      <description>&lt;P&gt;If the user has input some value in select-option or parameter and then press "Enter" button, this basically allow selection screen values to be passed to the relevent variables like S_KLART etc. In this case you can simply address this variable (select-option to be more precise) in "AT SELECTION-SCREEN ON VALUE-REQUEST FOR" for other select-options. &lt;/P&gt;
  &lt;P&gt;However if user just types the value or select the value from a list and then goes to next select-option/parameter, in this case the selection-screen values are not passed to relevent variables. In this case Sandra Rossi has given you a very good tip to use function module RS_SELECTIONSCREEN_READ to read such value. &lt;/P&gt;
  &lt;P&gt;I had a similar requirement in one report. Following code is derived from that report, although i have removed the code not relevant with your issue. This is owrking code. Just copy/paste in your system and it should work. It can give you some baseline to observe and apply similar changes in your report.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  YYRJ_TEST0080
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Read selection screen elements
*&amp;amp; Working: Enter a valid PO number in s_ebeln. then press F4 for
*&amp;amp;          s_ebelp-low. Basically it will retreive a list of all
*&amp;amp;          all line items number for the PO given in s_ebeln.
*&amp;amp;---------------------------------------------------------------------*
REPORT yyrj_test0080.
TABLES: ekko, ekpo.


SELECT-OPTIONS :
s_ebeln FOR ekko-ebeln NO INTERVALS NO-EXTENSION,
s_ebelp FOR ekpo-ebelp.


TYPES: BEGIN OF tt_ebelp,
         ebelp LIKE ekpo-ebelp,
       END OF tt_ebelp.
DATA: lt_ebelp TYPE STANDARD TABLE OF tt_ebelp,
      ls_ebelp TYPE tt_ebelp.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_ebelp-low.
  PERFORM fetch_values_ebelp.

START-OF-SELECTION.
  WRITE:/ 'What is this'..
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  FETCH_VALUES_EBELP
*&amp;amp;---------------------------------------------------------------------*
FORM fetch_values_ebelp.

  DATA: lv_lin   TYPE i,
        lv_ebeln LIKE ekko-ebeln.
  DATA: lt_fieldvals TYPE STANDARD TABLE OF rsselread,
        ls_fieldvals TYPE rsselread.

  IF s_ebeln IS INITIAL.
**may be value not passed to select option yet
** fill fieldvals table
    CLEAR ls_fieldvals. REFRESH lt_fieldvals.
    MOVE: 'S_EBELN' TO ls_fieldvals-name,
          'S'     TO ls_fieldvals-kind,
          'LOW'   TO ls_fieldvals-position.
    APPEND ls_fieldvals TO lt_fieldvals.
** call the FM to read selection screen values
    CALL FUNCTION 'RS_SELECTIONSCREEN_READ'
      EXPORTING
        program     = sy-repid
      TABLES
        fieldvalues = lt_fieldvals.
** check fieldvals tab for values read
    CLEAR lv_ebeln.
    READ TABLE lt_fieldvals INTO ls_fieldvals WITH KEY name = 'S_EBELN'.
    IF sy-subrc = 0.
      CONDENSE ls_fieldvals-fieldvalue NO-GAPS.
      lv_ebeln = ls_fieldvals-fieldvalue.
      IF lv_ebeln IS NOT INITIAL.
        SELECT ebelp INTO TABLE lt_ebelp
          FROM ekpo
        WHERE ebeln = lv_ebeln.
        CHECK sy-subrc = 0.
        PERFORM show_f4_ebelp.
      ENDIF.  "lv_ebeln not initial
    ENDIF. "subrc read table
  ELSE.  "s_ebeln has some value
    SELECT ebelp INTO TABLE lt_ebelp
      FROM ekpo
    WHERE ebeln IN s_ebeln.
    IF sy-subrc = 0.
      PERFORM show_f4_ebelp.
    ENDIF.  "subrc 0 check
  ENDIF.   "s_ebeln check
ENDFORM.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  SHOW_F4_EBELP
*&amp;amp;---------------------------------------------------------------------*
FORM show_f4_ebelp .


  DATA: lt_return TYPE STANDARD TABLE OF ddshretval.


  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'EBELP'
      dynpprog        = sy-repid
      dynpnr          = sy-dynnr
      dynprofield     = 'S_EBELP-LOW'
      value_org       = 'S'
* IMPORTING
*     USER_RESET      =
    TABLES
      value_tab       = lt_ebelp
      return_tab      = lt_return
    EXCEPTIONS
      parameter_error = 1
      no_values_found = 2
      OTHERS          = 3.
  IF sy-subrc &amp;lt;&amp;gt; 0.
* Implement suitable error handling here
**** ??
  ENDIF.
ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Jul 2017 14:52:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428964#M12079</guid>
      <dc:creator>Rashid_Javed</dc:creator>
      <dc:date>2017-07-26T14:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428965#M12080</link>
      <description>&lt;P&gt;Very much confused by this whole thread... Why can't you simply use a debugger? The follow up questions below are like "omg, this is not working! see my code [unreadable code follows]". &lt;/P&gt;
  &lt;P&gt;But what effort have you made to analyze and troubleshoot the issue? Hm, what was that saying about &lt;A href="https://en.wikipedia.org/wiki/God_helps_those_who_help_themselves"&gt;helping themselves&lt;/A&gt;...&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 20:18:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428965#M12080</guid>
      <dc:creator>Jelena_Perfiljeva</dc:creator>
      <dc:date>2017-07-26T20:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428966#M12081</link>
      <description>&lt;P&gt;"Smart" answer Jelena, &lt;/P&gt;
  &lt;P&gt;What makes you think i haven`t tried ? I am new to abap. I`ve tried with a debugger and couldn`t resolve anything. I have posted the code with what i tried but the moderator thought that is not relevant to post the whole code. How can the readers know what needs to be done if i don`t post the whole code?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 05:29:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428966#M12081</guid>
      <dc:creator>manole_apetroaie</dc:creator>
      <dc:date>2017-07-27T05:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428967#M12082</link>
      <description>&lt;P&gt;Being a new to ABAP does not accord you any special treatment. &lt;/P&gt;
  &lt;P&gt;If you have a problem, it's important that you express it concisely and accurately. If you post source code, you must only post the relevant parts, must make sure that it is nicely formatted and easy to read. When people can't be bothered to even remove commented out code, it's a bit sad.&lt;/P&gt;
  &lt;P&gt;Remember, you cannot demand an answer. Anyone answering you here is doing so entirely voluntarily. The comments you've had so far are attempts to guide you.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 06:55:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428967#M12082</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2017-07-27T06:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: select-options depend on select options</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428968#M12083</link>
      <description>&lt;P&gt;Dear Matthew,&lt;/P&gt;
  &lt;P&gt;I thought i will be given some special treatment :). Thank you for your advices. I believed that all the source code is important because i think that an instruction may affect multiple parts of the source code.I will format the code better from now on. I never tried nor I am and never will force someone to answer to my questions.Is not in my character. I appreciate all people`s effort when they are trying to help me. But i also have the feeling that not everybody is too interested to help me and they are sarcastic. Struggling hard on a project and receiving sarcastic responses doesn`t help me at all,contrary It makes me worse. I expected from SAP comunity to be more friendly.... &lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 07:14:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-depend-on-select-options/m-p/428968#M12083</guid>
      <dc:creator>manole_apetroaie</dc:creator>
      <dc:date>2017-07-27T07:14:03Z</dc:date>
    </item>
  </channel>
</rss>

