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

Display Hide screen elements on radio button select

Former Member
0 Likes
9,654

Hi all,

We have requirement to display some elements if radio button 1 is selected and display others elements if radio button 2 is selected .

All elements should display/hide on radio button click not on any other button .

<REMOVED BY MODERATOR>

Regards,

Edited by: Alvaro Tejada Galindo on Jun 12, 2008 5:34 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,401

Hi,

Refer the code below:

*Radiobuttons for selecting single material or range of BOM components

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

*Radiobutton for selecting material

PARAMETERS:rb_mat RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND com1.

*Radiobutton for selecting BOM components

PARAMETERS:rb_comp RADIOBUTTON GROUP g1.

SELECTION-SCREEN END OF BLOCK b1.

*Enter BOM header and details

SELECTION-SCREEN BEGIN OF BLOCK sub1 WITH FRAME TITLE text-002.

PARAMETERS:p_matnr TYPE mara-matnr MODIF ID id1. "Material Number

PARAMETERS:p_werks TYPE marc-werks MODIF ID id1. "Plant

PARAMETERS:p_stlan TYPE mast-stlan MODIF ID id1. "BOM usage

PARAMETERS:p_stlal TYPE mast-stlal MODIF ID id1. "Alternative BOM

PARAMETERS:p_capid TYPE rc29l-capid MODIF ID id1. "BOM Application

SELECTION-SCREEN END OF BLOCK sub1.

*Enter BOM components

SELECTION-SCREEN BEGIN OF BLOCK sub2 WITH FRAME TITLE text-003.

SELECT-OPTIONS:s_matnr FOR marc-matnr MODIF ID id2. "Material Number(BOM component)

SELECTION-SCREEN END OF BLOCK sub2.

*Enter document details

SELECTION-SCREEN BEGIN OF BLOCK sub3 WITH FRAME TITLE text-004.

*Document number

PARAMETERS:p_doknr TYPE draw-doknr.

*Document Type

PARAMETERS:p_dokar TYPE draw-dokar.

*Document Part

PARAMETERS:p_doktl TYPE draw-doktl DEFAULT '000'.

*Document Version

PARAMETERS:p_dokvr TYPE draw-dokvr DEFAULT '00'.

SELECTION-SCREEN END OF BLOCK sub3.

*Display screen based on selection of radio button

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF rb_mat = 'X'.

IF screen-group1 = 'ID2'.

screen-active = 0.

ENDIF.

ELSEIF rb_comp = 'X'.

IF screen-group1 = 'ID1'.

screen-active = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

3 REPLIES 3
Read only

Former Member
0 Likes
3,401

hiii

use following code

AT SELECTION-SCREEN OUTPUT .

  IF p_rad2 IS INITIAL .
    LOOP AT SCREEN.
      IF screen-name CS 'p_docno'.
        screen-active = 0.
        MODIFY SCREEN.
      ENDIF.                           " IF screen-name CS 'p_docno'.
    ENDLOOP.                           " LOOP AT SCREEN.

  ELSE.
    LOOP AT SCREEN .
      IF screen-name CS 'p_docno'.
        screen-active = 1.
         MODIFY SCREEN.
      ENDIF.                           " IF screen-name CS 'p_docno'.
    ENDLOOP.                           " LOOP AT SCREEN .
  ENDIF.                               " IF p_rad2 IS INITIAL .

<REMOVED BY MODERATOR>

thx

twinkal

Edited by: Alvaro Tejada Galindo on Jun 12, 2008 5:35 PM

Read only

Former Member
0 Likes
3,402

Hi,

Refer the code below:

*Radiobuttons for selecting single material or range of BOM components

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

*Radiobutton for selecting material

PARAMETERS:rb_mat RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND com1.

*Radiobutton for selecting BOM components

PARAMETERS:rb_comp RADIOBUTTON GROUP g1.

SELECTION-SCREEN END OF BLOCK b1.

*Enter BOM header and details

SELECTION-SCREEN BEGIN OF BLOCK sub1 WITH FRAME TITLE text-002.

PARAMETERS:p_matnr TYPE mara-matnr MODIF ID id1. "Material Number

PARAMETERS:p_werks TYPE marc-werks MODIF ID id1. "Plant

PARAMETERS:p_stlan TYPE mast-stlan MODIF ID id1. "BOM usage

PARAMETERS:p_stlal TYPE mast-stlal MODIF ID id1. "Alternative BOM

PARAMETERS:p_capid TYPE rc29l-capid MODIF ID id1. "BOM Application

SELECTION-SCREEN END OF BLOCK sub1.

*Enter BOM components

SELECTION-SCREEN BEGIN OF BLOCK sub2 WITH FRAME TITLE text-003.

SELECT-OPTIONS:s_matnr FOR marc-matnr MODIF ID id2. "Material Number(BOM component)

SELECTION-SCREEN END OF BLOCK sub2.

*Enter document details

SELECTION-SCREEN BEGIN OF BLOCK sub3 WITH FRAME TITLE text-004.

*Document number

PARAMETERS:p_doknr TYPE draw-doknr.

*Document Type

PARAMETERS:p_dokar TYPE draw-dokar.

*Document Part

PARAMETERS:p_doktl TYPE draw-doktl DEFAULT '000'.

*Document Version

PARAMETERS:p_dokvr TYPE draw-dokvr DEFAULT '00'.

SELECTION-SCREEN END OF BLOCK sub3.

*Display screen based on selection of radio button

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF rb_mat = 'X'.

IF screen-group1 = 'ID2'.

screen-active = 0.

ENDIF.

ELSEIF rb_comp = 'X'.

IF screen-group1 = 'ID1'.

screen-active = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Read only

Former Member
0 Likes
3,401

Hi,

as u know that we have to grouip the radio buttons.

then

if radio button 1 = 'X'.

first of all group the elements as per ur requirement

loop at screen.

disable the elements in the screen as per ur requirement by passing values to SCREEN.

endloop.

else if radio_button2 = 'X'.

loop at screen.

disable the elements in the screen as per ur requirement by passing values to SCREEN.

endloop.

endif.

Hope this can help u out.

Rgds.,

subash.