<?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: Problem while hide a block on selection screen on button press in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328153#M167840</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hii Titu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the hide perform&lt;/P&gt;&lt;P&gt;set a flag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ur problem will be solved&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;The problem is when you press the variant button ucomm is gain stored as 'FC01' for both the buttons.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Where did you set the pf-status ?&lt;/P&gt;&lt;P&gt;if you can differentiate the pf-status of variant and the button you can achieve that.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;i guess this will solve the problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 May 2006 12:16:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-05-15T12:16:06Z</dc:date>
    <item>
      <title>Problem while hide a block on selection screen on button press</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328144#M167831</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 added two buttons on the application toolbar of the selection screen. I have input fields under two blocks on the selection-screen. Initially the second block is hidden. If I press the button 1 the second block should be made visible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this to happen, I captured the button 1 click event using the following statement.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF sscrfields-ucomm = 'FC01'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Inside the if ... endif, I looped at the screen and made the second block visible. It was working fine.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at screen.
  if screen-group4 = '013'.
     screen-invisible = 1.
     screen-active    = 0.
  endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Later the second button was added. Now when i run the report for the first time, if button 2 is clicked the hidden block appears on the selection screen even though i have not added any code for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to check, i commented the logic to display the hidden block on button 1 click event. Even without any code the first time i press any of the two buttons added on the application toolbar the hidden block is displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I saved a variant for the report.&lt;/P&gt;&lt;P&gt;During execution of the report, if i select any variant then the hidden block is displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please tell me how to fix this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;T2.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 May 2006 08:30:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328144#M167831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-13T08:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while hide a block on selection screen on button press</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328145#M167832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Put your logic un at selection-screen event..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at screen.&lt;/P&gt;&lt;P&gt;  if screen-group4 = '013'.&lt;/P&gt;&lt;P&gt;     screen-invisible = 1.&lt;/P&gt;&lt;P&gt;     screen-active    = 0.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 May 2006 08:37:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328145#M167832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-13T08:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while hide a block on selection screen on button press</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328146#M167833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use ur logic in At selection-screen output&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 May 2006 08:43:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328146#M167833</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-13T08:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while hide a block on selection screen on button press</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328147#M167834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Madhu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry. forgot to mention. The code is under &amp;lt;b&amp;gt;at selection-screen &amp;lt;/b&amp;gt; event. I even tried it under &amp;lt;b&amp;gt;at selection-screen output&amp;lt;/b&amp;gt; event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;T2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Titu Joseph&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 May 2006 08:44:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328147#M167834</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-13T08:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while hide a block on selection screen on button press</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328148#M167835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use this at selection screen output event &lt;/P&gt;&lt;P&gt;and use both radiobutton and use this stat while declaring the radio button:&lt;/P&gt;&lt;P&gt; USER-COMMAND ucom (where ucomm can have value like 'ONLI')...&lt;/P&gt;&lt;P&gt;and check if the first button is clicked make screen pertaining to modif id 1 visible and at the same time make the other screen invisible and say &lt;/P&gt;&lt;P&gt;modify screen...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward point if it helps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regds&lt;/P&gt;&lt;P&gt;gunjan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 May 2006 12:51:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328148#M167835</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-13T12:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while hide a block on selection screen on button press</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328149#M167836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gunjan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With radiobuttons on the selection screen it will work. But i want it to be triggered using buttons added on the application toolbar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't change the scenario. Any inputs to solve the issue with same scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;T2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 May 2006 15:11:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328149#M167836</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-13T15:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while hide a block on selection screen on button press</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328150#M167837</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;modify screen is missing in ur code i guess...try with that....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 May 2006 05:17:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328150#M167837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-14T05:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while hide a block on selection screen on button press</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328151#M167838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Titu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add Modify Screen in your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at screen.&lt;/P&gt;&lt;P&gt;  if screen-group4 = '013'.&lt;/P&gt;&lt;P&gt;     screen-invisible = 1.&lt;/P&gt;&lt;P&gt;     screen-active    = 0.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  &amp;lt;b&amp;gt;MODIFY SCREEN.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Please reward points to all the helpful answers and close the thread.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit Mishra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 May 2006 12:00:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328151#M167838</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-14T12:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while hide a block on selection screen on button press</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328152#M167839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I guess you guys are getting confused. i am including the whole code here. &lt;/P&gt;&lt;P&gt;My requirement is when i press the first button on the&lt;/P&gt;&lt;P&gt;application server the second block should be visible.&lt;/P&gt;&lt;P&gt;which is happening now. &lt;/P&gt;&lt;P&gt;Now when i press the button again it should hide the&lt;/P&gt;&lt;P&gt;dynamic screen.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT z_test_t2_1 .
INCLUDE &amp;lt;icon&amp;gt;.
TABLES: t001,
        lfa1,
        sscrfields.

DATA: gv_button_press   TYPE c.

DATA: gs_dyntxt TYPE smp_dyntxt.

SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN FUNCTION KEY 2.

SELECTION-SCREEN BEGIN OF BLOCK ccode 
WITH FRAME TITLE text-s03.
SELECT-OPTIONS: s_bukrs FOR t001-bukrs OBLIGATORY 
MEMORY ID buk.
SELECTION-SCREEN END OF BLOCK ccode.

SELECTION-SCREEN BEGIN OF BLOCK vend 
WITH FRAME TITLE text-s04.
SELECT-OPTIONS: s_konzs FOR lfa1-konzs.
SELECT-OPTIONS: s_txcd1 FOR lfa1-stcd1.
SELECT-OPTIONS: s_txcd2 FOR lfa1-stcd2.
SELECTION-SCREEN END OF BLOCK vend.

INITIALIZATION.
  PERFORM populate_app_toolbar_buttons.
  PERFORM hide_screenfields.

AT SELECTION-SCREEN.
  PERFORM adapt_screen.

*******************************************************

FORM populate_app_toolbar_buttons.

  CLEAR gs_dyntxt.
  WRITE icon_fencing     TO gs_dyntxt-icon_id AS ICON.
  MOVE  text-b01         TO gs_dyntxt-quickinfo.    
  MOVE gs_dyntxt         TO sscrfields-functxt_01.

  CLEAR gs_dyntxt.
  WRITE icon_information TO gs_dyntxt-icon_id AS ICON.
  MOVE  text-b02         TO gs_dyntxt-quickinfo.   
  MOVE gs_dyntxt         TO sscrfields-functxt_02.

ENDFORM.
                   
FORM hide_screenfields.

  LOOP AT SCREEN.
    IF   screen-group4 EQ '006' 
      OR screen-group4 EQ '007'
      OR screen-group4 EQ '008'.
      screen-invisible = 1.
      screen-active    = 0.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

ENDFORM.  

FORM adapt_screen.

  CHECK sscrfields-ucomm NS '%'.
  IF sscrfields-ucomm = 'FC01'.
    IF gv_button_press IS INITIAL.
      LOOP AT SCREEN.
        IF   screen-group4 EQ '006' 
          OR screen-group4 EQ '007'
          OR screen-group4 EQ '008'.
          screen-invisible = 0.
          screen-active    = 1.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
      gv_button_press = 'X'.
    ELSEIF gv_button_press EQ 'X'.
      CLEAR gv_button_press.
      LOOP AT SCREEN.
        IF   screen-group4 EQ '006' 
          OR screen-group4 EQ '007'
          OR screen-group4 EQ '008'.
          screen-invisible = 1.
          screen-active    = 0.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    ENDIF.
  ENDIF.
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 May 2006 12:07:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328152#M167839</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-15T12:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while hide a block on selection screen on button press</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328153#M167840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hii Titu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the hide perform&lt;/P&gt;&lt;P&gt;set a flag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ur problem will be solved&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;The problem is when you press the variant button ucomm is gain stored as 'FC01' for both the buttons.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Where did you set the pf-status ?&lt;/P&gt;&lt;P&gt;if you can differentiate the pf-status of variant and the button you can achieve that.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;i guess this will solve the problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 May 2006 12:16:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328153#M167840</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-15T12:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while hide a block on selection screen on button press</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328154#M167841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have done a similar prob, this works absolutely fine even with ur case too even &amp;lt;b&amp;gt;though it has variants&amp;lt;/b&amp;gt;, please check this and &amp;lt;b&amp;gt;award points if helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*Selection Screen 1

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS : P_FILE(25) TYPE C,
             O_FILE(25) TYPE C.

SELECTION-SCREEN END OF BLOCK B1.

*Selection Screen 2

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.

PARAMETERS: CAL_TRA RADIOBUTTON GROUP G1 USER-COMMAND FLAG,
            SESSION RADIOBUTTON GROUP G1 DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK B2.

*Selection Screen 3

SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.

PARAMETERS: MODE DEFAULT 'X' MODIF ID BL1,
            UPDATE DEFAULT 'X' MODIF ID BL1.

SELECTION-SCREEN END OF BLOCK B3.

*Selection Screen 4

SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-003.


PARAMETERS: SES_NAM TYPE APQI-GROUPID MODIF ID BL2,
            KEP_TRAS TYPE C DEFAULT 'X' MODIF ID BL2,
            LOC_DATE TYPE SY-DATUM MODIF ID BL2,
            USER TYPE SY-UNAME DEFAULT SY-UNAME MODIF ID BL2.

SELECTION-SCREEN END OF BLOCK B4.

************************************************************************
*                     At  Selection-Screen Output                      *
************************************************************************

AT SELECTION-SCREEN OUTPUT.


  IF CAL_TRA = 'X'.
    LOOP AT SCREEN.

      IF SCREEN-GROUP1 = 'BL1'.
        SCREEN-ACTIVE = '1'.
      ENDIF.

      IF SCREEN-GROUP1 = 'BL2'.
        SCREEN-ACTIVE = '0'.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

  IF SESSION = 'X'.

    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'BL1'.
        SCREEN-ACTIVE = '0'.
      ENDIF.

      IF SCREEN-GROUP1 = 'BL2'.
        SCREEN-ACTIVE = '1'.
      ENDIF.

      MODIFY SCREEN.

    ENDLOOP.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 May 2006 12:21:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328154#M167841</guid>
      <dc:creator>rahulkavuri</dc:creator>
      <dc:date>2006-05-15T12:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while hide a block on selection screen on button press</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328155#M167842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use at Selection-screen Output.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 May 2006 14:04:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328155#M167842</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-15T14:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while hide a block on selection screen on button press</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328156#M167843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is solved. &lt;/P&gt;&lt;P&gt;Everyone was confusing between the pushbutton on the selectio-screen and on apllication toolbar &lt;/P&gt;&lt;P&gt;(where you have the execute icon).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the code below. Thanks for you time and help. I appreciate it.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ztest.


INCLUDE &amp;lt;icon&amp;gt;.

*----------------------------------------------------------------------*
*  TABLES                                                              *
*----------------------------------------------------------------------*
TABLES: t001,              " Company Codes
        lfa1,              " Vendor Master (General Section)
        sscrfields.        " Fields on selection screens

* To capture button press event.
DATA: gv_button_press       TYPE c.

* Menu Painter: Program interface for dynamic texts
DATA: gs_dyntxt             TYPE smp_dyntxt.

*----------------------------------------------------------------------*
*  SELECTION SCREEN                                                    *
*----------------------------------------------------------------------*
SELECTION-SCREEN FUNCTION KEY 1.

SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-s01.

* Company Code.
SELECTION-SCREEN BEGIN OF BLOCK ccode WITH FRAME TITLE text-s02.
SELECT-OPTIONS: s_bukrs FOR t001-bukrs OBLIGATORY MEMORY ID buk.
SELECTION-SCREEN END OF BLOCK ccode.
SELECTION-SCREEN END OF BLOCK blk1.

SELECTION-SCREEN BEGIN OF BLOCK dsel WITH FRAME TITLE text-s04.

* Vendor Master.
SELECTION-SCREEN BEGIN OF BLOCK vend WITH FRAME TITLE text-s07.
SELECT-OPTIONS: s_konzs FOR lfa1-konzs MODIF ID aw1.
SELECT-OPTIONS: s_txcd1 FOR lfa1-stcd1 MODIF ID aw1.
SELECT-OPTIONS: s_txcd2 FOR lfa1-stcd2 MODIF ID aw1.
SELECTION-SCREEN END OF BLOCK vend.
SELECTION-SCREEN END OF BLOCK dsel.


* ---------------------------------------------------------------------*
* INITIALIZATION                                                       *
* ---------------------------------------------------------------------*
INITIALIZATION.
* Populate the Application toolbar button attributes.
  PERFORM populate_app_toolbar_buttons.
* Hide the dynamic screen intially.
  PERFORM hide_screenfields.

* ---------------------------------------------------------------------*
* AT SELECTION SCREEN                                                  *
* ---------------------------------------------------------------------*
AT SELECTION-SCREEN.
* Capture the button press event.
  PERFORM capture_button_press.

*----------------------------------------------------------------------*
* AT SELECTION-SCREEN OUTPUT.                                          *
*----------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT.
* Show/Hide the dynamic selection screen based on button press.
  PERFORM adapt_screen.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;  Form  populate_app_toolbar_buttons                                 *
*&amp;amp;---------------------------------------------------------------------*
*   Display Icon on the application toolbar buttons. Also set the      *
*   function codes for these buttons.                                  *
*----------------------------------------------------------------------*
FORM populate_app_toolbar_buttons.

  CLEAR gs_dyntxt.
  WRITE icon_fencing     TO gs_dyntxt-icon_id AS ICON.
  MOVE  text-b01         TO gs_dyntxt-quickinfo.   " Dynamic Selections
  MOVE gs_dyntxt         TO sscrfields-functxt_01.

ENDFORM.                    " populate_app_toolbar_buttons

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;  Form  hide_screenfields                                            *
*&amp;amp;---------------------------------------------------------------------*
*   Initially hide the Dynamic selection screen.                       *
*----------------------------------------------------------------------*

FORM hide_screenfields.

  LOOP AT SCREEN.
    IF screen-group1 = 'AW1'.
      screen-invisible = '1'.
      screen-active    = '0'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

ENDFORM.                    " hide_screenfields

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;  Form  capture_button_press                                         *
*&amp;amp;---------------------------------------------------------------------*
*   Set the flag based on button press event. Appication bar button    *
*   tcode is available only at 'At Selection-screen' event.            *
*   Use the captured data at 'At Selection-screen Output' event.       *
*   Screen adjustments is possible only under this event.              *
*----------------------------------------------------------------------*
FORM capture_button_press.

  IF sscrfields-ucomm = 'FC01'.
    IF gv_button_press IS INITIAL.
      gv_button_press = 'X'.
    ELSEIF gv_button_press EQ 'X'.
      CLEAR gv_button_press.
    ENDIF.
  ENDIF.

ENDFORM.                    " capture_button_press

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;  Form  adapt_screen                                                 *
*&amp;amp;---------------------------------------------------------------------*
*   Show/Hide the dynamic selection screen based on button press       *
*   captured at 'At selection-screen' event.                           *
*----------------------------------------------------------------------*
FORM adapt_screen.

* If button press flag is initial hide the dynamic selection screen.
  IF gv_button_press IS INITIAL.
    LOOP AT SCREEN.
      IF screen-group1 = 'AW1'.
        screen-invisible = '1'.
        screen-active    = '0'.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
* Elseif button press flag is 'X' show the dynamic selection screen.
  ELSEIF gv_button_press EQ 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'AW1'.
        screen-invisible = '0'.
        screen-active    = '1'.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

ENDFORM.                    " adapt_screen
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;T2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Titu Joseph&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 May 2006 20:57:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-hide-a-block-on-selection-screen-on-button-press/m-p/1328156#M167843</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-20T20:57:28Z</dc:date>
    </item>
  </channel>
</rss>

