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,

the requirement is that

if i select one radiobutoon some the selection fields should be invisible.

Please provide the code for that

thanks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

If you want to do it using Selection screen then it is possible.

for that you have to use AT SELECTION-SCREEN output. event..

See the below code and use it according to your requirement.

======================================

tables: pa0000, pa0001.

parameters: p_rad1 radiobutton group rad1 default 'X' user-command rusr,

p_rad2 radiobutton group rad1.

selection-screen: begin of block blk1 with frame.

select-options: s_pernr for pa0000-pernr modif id ABC.

selection-screen: end of block blk1.

selection-screen: begin of block blk2 with frame.

select-options: s_stat2 for pa0000-stat2 modif id DEF.

select-options: s_werks for pa0001-werks modif id DEF.

selection-screen: end of block blk2.

AT SELECTION-SCREEN output.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ABC'.

IF p_rad1 = 'X'.

SCREEN-ACTIVE = 1.

ELSE.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'DEF'.

IF p_rad2 = 'X'.

SCREEN-ACTIVE = 1.

ELSE.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

=====================================

Regards,

Satish

4 REPLIES 4

Former Member
0 Kudos

Hi,

If you want to do it using Selection screen then it is possible.

for that you have to use AT SELECTION-SCREEN output. event..

See the below code and use it according to your requirement.

======================================

tables: pa0000, pa0001.

parameters: p_rad1 radiobutton group rad1 default 'X' user-command rusr,

p_rad2 radiobutton group rad1.

selection-screen: begin of block blk1 with frame.

select-options: s_pernr for pa0000-pernr modif id ABC.

selection-screen: end of block blk1.

selection-screen: begin of block blk2 with frame.

select-options: s_stat2 for pa0000-stat2 modif id DEF.

select-options: s_werks for pa0001-werks modif id DEF.

selection-screen: end of block blk2.

AT SELECTION-SCREEN output.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ABC'.

IF p_rad1 = 'X'.

SCREEN-ACTIVE = 1.

ELSE.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'DEF'.

IF p_rad2 = 'X'.

SCREEN-ACTIVE = 1.

ELSE.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

=====================================

Regards,

Satish

Former Member
0 Kudos

Hi,

Please refer to the code below :


TABLES : bsis.


SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETER : sp_sel radiobutton group rad USER-COMMAND radio DEFAULT 'X',
            sp_all RADIOBUTTON GROUP rad.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS : so_bukrs FOR bsis-bukrs MODIF ID sp1.
SELECT-OPTIONS : so_hkont FOR bsis-hkont MODIF ID sp2.
SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.
  IF sp_sel = 'X'.


      IF screen-group1 = 'SP2'.
        screen-input = '0'.
        screen-invisible = '0'.
        screen-required = '0'.
        MODIFY SCREEN.
      ENDIF.
      else.
      IF screen-group1 = 'SP1'.
        screen-input = '0'.
        screen-invisible = '0'.
        screen-required = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.

Thanks,

Sriram Ponna.

Former Member
0 Kudos

selection-screen begin of block b1 with frame.
parameters: alv-list radiobutton group gp1 default 'X' user-command chk,
            alv-grid radiobutton group gp1.
selection-screen end of block b1.

selection-screen begin of block b2 with frame.

parameters: s_matnr type mara-matnr modif id g1.
select-options: k_matnr for mara-matnr modif id g2.

selection-screen end of block b2.

*FILE PATH
selection-screen begin of block b3 with frame title text-003.
parameters: p_path(128) type c.
selection-screen end of block b3.


parameters: p_var type slis_vari.


*---------------------------------------------------------------------*
*                    At Selection-Screen(output)
*---------------------------------------------------------------------*
at selection-screen output.

  loop at screen.
    if alv-list = 'X' and screen-group1 = 'G1'.
      screen-active = 0.
*screen-intensified = '1'.
      modify screen.
    endif.
    if alv-grid = 'X' and screen-group1 = 'G2'.
      screen-active = 0.
      modify screen.
    endif.
  endloop.

use this code you will get your answer

<REMOVED BY MODERATOR>

kushagra

Edited by: Alvaro Tejada Galindo on Jan 31, 2008 10:08 AM

Former Member
0 Kudos

TABLES : marc.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
PARAMETERS: R1 RADIOBUTTON GROUP grp USER-COMMAND rusr,
            R2 RADIOBUTTON GROUP grp DEFAULT 'X'.
SELECTION-SCREEN: END OF BLOCK b1.

SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS:s_matnr FOR marc-matnr MODIF ID mat.
PARAMETERS : p_werks LIKE marc-werks  MODIF ID mat.
SELECTION-SCREEN: END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF screen-group1 = 'MAT' AND R1 = 'X'.
      screen-active = 0.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.