<?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: Dynamic selection-options on selection screen in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-selection-options-on-selection-screen/m-p/7924957#M1599127</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS:  p_name  TYPE string.
PARAMETERS:  p_more  AS CHECKBOX USER-COMMAND pmore.
SELECTION-SCREEN COMMENT /1(7) comm1 FOR FIELD p_field1.
PARAMETERS:  p_field1   TYPE string.
SELECTION-SCREEN COMMENT /1(7) comm2 FOR FIELD p_field2.
PARAMETERS:  p_field2   TYPE string.
SELECTION-SCREEN END OF BLOCK b1.

INITIALIZATION.
  "SELECT a ZTABLE containing all screen fields
  SELECT *
    FROM ztable
    INTO TABLE ztable.

START-OF-SELECTION.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  handle_screen
*&amp;amp;---------------------------------------------------------------------*
FORM handle_screen.
  LOOP AT SCREEN.
    
   " Handle FIELD 1
    IF screen-name CS 'COMM1'.
      IF p_more NE 'X'.
        "Hide it!
        screen-active = 0.
        MODIFY SCREEN.
      ELSE.
        "READ TABLE ZTABLE and if not found, you can hide it as well
        READ TABLE ztable INDEX 1.
        IF sy-subrc &amp;lt;&amp;gt; 0.
          screen-active = 0.
          MODIFY SCREEN.
        "Else, change COMM1 text
        ELSE.
          comm1 = ZTABLE-FIELD_DESC.
        ENDIF.
      ENDIF.
    ENDIF.
    IF screen-name CS 'P_FIELD1'.
      IF p_more NE 'X'.
        "Hide it!
        screen-active = 0.
        MODIFY SCREEN.
      ELSE.
        "READ TABLE ZTABLE and if not found, you can hide it as well
        READ TABLE ztable INDEX 1.
        IF sy-subrc &amp;lt;&amp;gt; 0.
          screen-active = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDIF.
    ENDIF.
    
   " Handle FIELD 2
    IF screen-name CS 'COMM2'.
      IF p_more NE 'X'.
        "Hide it!
        screen-active = 0.
        MODIFY SCREEN.
      ELSE.
        "READ TABLE ZTABLE and if not found, you can hide it as well
        READ TABLE ztable INDEX 2.
        IF sy-subrc &amp;lt;&amp;gt; 0.
          screen-active = 0.
          MODIFY SCREEN.
        "Else, change COMM2 text
        ELSE.
          comm2 = ZTABLE-FIELD_DESC.
        ENDIF.
      ENDIF.
    ENDIF.
    IF screen-name CS 'P_FIELD2'.
      IF p_more NE 'X'.
        "Hide it!
        screen-active = 0.
        MODIFY SCREEN.
      ELSE.
        "READ TABLE ZTABLE and if not found, you can hide it as well
        READ TABLE ztable INDEX 2.
        IF sy-subrc &amp;lt;&amp;gt; 0.
          screen-active = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDIF.
    ENDIF.

  ENDLOOP.
ENDFORM.                    "handle_screen&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jun 2011 18:26:27 GMT</pubDate>
    <dc:creator>DiogoAwaihara</dc:creator>
    <dc:date>2011-06-06T18:26:27Z</dc:date>
    <item>
      <title>Dynamic selection-options on selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-selection-options-on-selection-screen/m-p/7924954#M1599124</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 have a requirement as below:&lt;/P&gt;&lt;P&gt;For a report program, there need to be a checkbox on the seletion screen .If that is ticked then,  there some select options which are saved in a TVARVC variable should appear on the screen. Then we need to make selections in the program&lt;/P&gt;&lt;P&gt;according to these select options.It can be possible that user can add or delete select options in the TVARVC variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need help to know how to achieve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex below for more understanding:&lt;/P&gt;&lt;P&gt;Check box  :  Name&lt;/P&gt;&lt;P&gt;If ticked,&lt;/P&gt;&lt;P&gt;Treament : _______ To _______   (select-option)&lt;/P&gt;&lt;P&gt;Germination : _____ To _______  (select-option) should appear on screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then further selection in program based on values entered for these select -options like Treatment between ABC and DEF.&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;Neethu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 13:32:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-selection-options-on-selection-screen/m-p/7924954#M1599124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-06T13:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic selection-options on selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-selection-options-on-selection-screen/m-p/7924955#M1599125</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;Use "At Selection screen" event and then loop on screen to disable or enable desired screen fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Muktar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 13:36:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-selection-options-on-selection-screen/m-p/7924955#M1599125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-06T13:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic selection-options on selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-selection-options-on-selection-screen/m-p/7924956#M1599126</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;To perform dynamic select options you can use the below code.&lt;/P&gt;&lt;P&gt;Here p_tab is the table name where fields of enterd table are dynamically fecthed and shown to user on screen. Where he can add/ delete the selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA_TABS-PRIM_TAB = P_TAB.&lt;/P&gt;&lt;P&gt; APPEND WA_TABS TO IT_TABS.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'FREE_SELECTIONS_INIT'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      KIND                     = 'T'&lt;/P&gt;&lt;P&gt;      EXPRESSIONS              = GX_TEXPR " Variable to hold Expression&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      SELECTION_ID             = GV_SELID"Variable to hold Selid&lt;/P&gt;&lt;P&gt;      NUMBER_OF_ACTIVE_FIELDS  = GV_ACTNUM"Variable to hold no of fields&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      TABLES_TAB               = IT_TABS " Table name&lt;/P&gt;&lt;P&gt;      FIELDS_TAB               = IT_FLDS "Table fields&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      FIELDS_INCOMPLETE        = 01&lt;/P&gt;&lt;P&gt;      FIELDS_NO_JOIN           = 02&lt;/P&gt;&lt;P&gt;      FIELD_NOT_FOUND          = 03&lt;/P&gt;&lt;P&gt;      NO_TABLES                = 04&lt;/P&gt;&lt;P&gt;      TABLE_NOT_FOUND          = 05&lt;/P&gt;&lt;P&gt;      EXPRESSION_NOT_SUPPORTED = 06&lt;/P&gt;&lt;P&gt;      INCORRECT_EXPRESSION     = 07&lt;/P&gt;&lt;P&gt;      ILLEGAL_KIND             = 08&lt;/P&gt;&lt;P&gt;      AREA_NOT_FOUND           = 09&lt;/P&gt;&lt;P&gt;      INCONSISTENT_AREA        = 10&lt;/P&gt;&lt;P&gt;      KIND_F_NO_FIELDS_LEFT    = 11&lt;/P&gt;&lt;P&gt;      KIND_F_NO_FIELDS         = 12&lt;/P&gt;&lt;P&gt;      TOO_MANY_FIELDS          = 13.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you couldnt solve this problem pls drop a mail i will send you the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srikanth.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 16:00:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-selection-options-on-selection-screen/m-p/7924956#M1599126</guid>
      <dc:creator>former_member213275</dc:creator>
      <dc:date>2011-06-06T16:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic selection-options on selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-selection-options-on-selection-screen/m-p/7924957#M1599127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS:  p_name  TYPE string.
PARAMETERS:  p_more  AS CHECKBOX USER-COMMAND pmore.
SELECTION-SCREEN COMMENT /1(7) comm1 FOR FIELD p_field1.
PARAMETERS:  p_field1   TYPE string.
SELECTION-SCREEN COMMENT /1(7) comm2 FOR FIELD p_field2.
PARAMETERS:  p_field2   TYPE string.
SELECTION-SCREEN END OF BLOCK b1.

INITIALIZATION.
  "SELECT a ZTABLE containing all screen fields
  SELECT *
    FROM ztable
    INTO TABLE ztable.

START-OF-SELECTION.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  handle_screen
*&amp;amp;---------------------------------------------------------------------*
FORM handle_screen.
  LOOP AT SCREEN.
    
   " Handle FIELD 1
    IF screen-name CS 'COMM1'.
      IF p_more NE 'X'.
        "Hide it!
        screen-active = 0.
        MODIFY SCREEN.
      ELSE.
        "READ TABLE ZTABLE and if not found, you can hide it as well
        READ TABLE ztable INDEX 1.
        IF sy-subrc &amp;lt;&amp;gt; 0.
          screen-active = 0.
          MODIFY SCREEN.
        "Else, change COMM1 text
        ELSE.
          comm1 = ZTABLE-FIELD_DESC.
        ENDIF.
      ENDIF.
    ENDIF.
    IF screen-name CS 'P_FIELD1'.
      IF p_more NE 'X'.
        "Hide it!
        screen-active = 0.
        MODIFY SCREEN.
      ELSE.
        "READ TABLE ZTABLE and if not found, you can hide it as well
        READ TABLE ztable INDEX 1.
        IF sy-subrc &amp;lt;&amp;gt; 0.
          screen-active = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDIF.
    ENDIF.
    
   " Handle FIELD 2
    IF screen-name CS 'COMM2'.
      IF p_more NE 'X'.
        "Hide it!
        screen-active = 0.
        MODIFY SCREEN.
      ELSE.
        "READ TABLE ZTABLE and if not found, you can hide it as well
        READ TABLE ztable INDEX 2.
        IF sy-subrc &amp;lt;&amp;gt; 0.
          screen-active = 0.
          MODIFY SCREEN.
        "Else, change COMM2 text
        ELSE.
          comm2 = ZTABLE-FIELD_DESC.
        ENDIF.
      ENDIF.
    ENDIF.
    IF screen-name CS 'P_FIELD2'.
      IF p_more NE 'X'.
        "Hide it!
        screen-active = 0.
        MODIFY SCREEN.
      ELSE.
        "READ TABLE ZTABLE and if not found, you can hide it as well
        READ TABLE ztable INDEX 2.
        IF sy-subrc &amp;lt;&amp;gt; 0.
          screen-active = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDIF.
    ENDIF.

  ENDLOOP.
ENDFORM.                    "handle_screen&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 18:26:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-selection-options-on-selection-screen/m-p/7924957#M1599127</guid>
      <dc:creator>DiogoAwaihara</dc:creator>
      <dc:date>2011-06-06T18:26:27Z</dc:date>
    </item>
  </channel>
</rss>

