Application Development 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: 

selection screen

Former Member
0 Kudos

Hi folks,

I have a requirement, where there will be one check box on selection screen. if i click that box then only one paramenter should display on the selection screen. otherwise it should not be displayed. pls guide me...

thanks,

Ram.

3 REPLIES 3

Former Member
0 Kudos

Hi,

Please refer the code below:

SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS:p_family AS CHECKBOX USER-COMMAND com1. "Checkbox

SELECTION-SCREEN COMMENT 4(23) text-002 FOR FIELD p_family.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE text-005.

SELECT-OPTIONS:s_family FOR marc-matnr MODIF ID id1,

s_mbrsh FOR mara-mbrsh MODIF ID id1,

SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.

IF p_family EQ 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'ID1'.

screen-active = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

ENDIF.

venkat_o
Active Contributor
0 Kudos

Hi Ram, Have a look at this sample program and change ur program accordingly.


REPORT zvenkat_notepad4.
"Selection-screen
PARAMETERS: p_check AS CHECKBOX USER-COMMAND ucom.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(20) comm1 MODIF ID mg1 FOR FIELD p_input.
PARAMETERS: p_input TYPE char25.
SELECTION-SCREEN END OF LINE.
"Initialization

INITIALIZATION.
  comm1 = 'Text'.
  " PBO of Selection-screen

AT SELECTION-SCREEN OUTPUT.
  IF p_check IS INITIAL.
    LOOP AT SCREEN .
      IF screen-name = 'P_INPUT' OR screen-group1 = 'MG1'.
        screen-active = '0'.
        MODIFY SCREEN.
        CLEAR screen.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN .
      IF screen-name = 'P_INPUT' OR screen-group1 = 'MG1'.
        screen-active = '1'.
        MODIFY SCREEN.
        CLEAR screen.
      ENDIF.
    ENDLOOP.
  ENDIF.
Regards, Venkat.O

Former Member
0 Kudos

Hi,

You need to write the in at selection screen on output event.

Inside the event loop at screen (a system defined internal table) and then write your code (screen-active) to 0 or 1.

Parameter: p_chk type c as checkbox user-command flag,

p_fld1(10) type c,

p_fld2(10) type c.

at selection-screen output.

loop at screen.

if screen-name = 'P_FLD1'.

screen-active = '0'.

modify screen.

endif.

endloop.