Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamically hiding fields in tabbed block

Former Member
0 Likes
1,322

Hello everyone,

I have two probably simple problems.

First - I have selection screen with tabs. On first tab I have select-option field and below the checkbox. How can I dynamically hide the select-option field when I click a checkbox.

My code:



SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
SELECT-OPTIONS s_valid  FOR lv_valid MODIF ID gr1.
PARAMETER p_chkab AS CHECKBOX DEFAULT ' '.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 100.

SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 10 LINES,
TAB (20) t1_en USER-COMMAND push1
DEFAULT SCREEN 100,
TAB (20) t2_partn USER-COMMAND push2
DEFAULT SCREEN 200,
...
END OF BLOCK mytab.
INITIALIZATION.
  t1_en = 'DATES'.
  t2_partn = 'partn'.
  mytab-prog = sy-repid.
  mytab-dynnr = 100.
  mytab-activetab = 'T1_EN'.

I tried to use LOOP AT SCREEN but AT SELECTION-SCREEN OUTPUT i do not have access to the fields in tabs (only to the tabs). and this event is not triggered when I checked the checkbox. What can I do to make it works?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
811

Hi Max,

Welcome to SCN/SDN

*PARAMETER p_chkab AS CHECKBOX DEFAULT ' '. 
PARAMETER p_chkab AS CHECKBOX USER-COMMAND ABC DEFAULT ' '. " Add USER-COMMAND
This will trigger automatic PAI/PBO

AT SELECTION-SCREEN OUTPUT.
IF P_CHKAB = 'X'.
loop at screen.
           screen-name = '%_S_VALID_%_APP_%-TEXT' or " Get these from Screen Layout 
           screen-name = 'S_VALID-LOW'            or
           screen-name = 'S_ERDAT-HIGH' .
 SCREEN-ACTIVE = 0.
MODIFY SCREEN.
endloop.
endif.

Cheerz

Ram

3 REPLIES 3
Read only

Former Member
0 Likes
811

Hi,

You have to use Usercommand Keyword.

e.g.


PARAMETER p_chkab AS CHECKBOX DEFAULT ' ' user-command fcode.

Try it .

Hope it helps.

Regards

Arbind

Read only

Former Member
0 Likes
812

Hi Max,

Welcome to SCN/SDN

*PARAMETER p_chkab AS CHECKBOX DEFAULT ' '. 
PARAMETER p_chkab AS CHECKBOX USER-COMMAND ABC DEFAULT ' '. " Add USER-COMMAND
This will trigger automatic PAI/PBO

AT SELECTION-SCREEN OUTPUT.
IF P_CHKAB = 'X'.
loop at screen.
           screen-name = '%_S_VALID_%_APP_%-TEXT' or " Get these from Screen Layout 
           screen-name = 'S_VALID-LOW'            or
           screen-name = 'S_ERDAT-HIGH' .
 SCREEN-ACTIVE = 0.
MODIFY SCREEN.
endloop.
endif.

Cheerz

Ram

Read only

Former Member
0 Likes
811

use SCREEN-INVISIBLE = 1, to hide the screen field.

example:

selection-screen begin of block b1 with frame title text-001.
parameters : rad1 radiobutton group rad default 'X' user-command radio.
parameters : rad2 radiobutton group rad.
parameters : rad3 radiobutton group rad.
selection-screen end of block b1.

selection-screen begin of block b2 with frame title text-005.
parameter : p_file type ibipparms-path modif id m1.
select-options : p_delno for likp-vbeln no intervals modif id m2.
select-options : p_vbeln for likp-vbeln modif id m3.
selection-screen end of block b2.

at selection-screen output.
  loop at screen.
    if rad1 eq 'X'.
      if screen-group1 = 'M1'.
        move 1 to screen-input.
        move 0 to screen-invisible.
      elseif screen-group1 = 'M2'.
        move 0 to screen-input.
        move 1 to screen-invisible.
      elseif screen-group1 = 'M3'.
        move 0 to screen-input.
        move 1 to screen-invisible.
      endif.
    endif.
   modify screen.
endloop.

Regards

Vinod