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

selection-screen help

Former Member
0 Likes
934

hi friends ,

need help from you i have to design selection screen with two radiobuttons.

if i select first radiobutton , it display some block of parameters.if i select another radiobutton it display another block of parameters with in the same selection screen. at a time one only i want display.

&&& display the icons for the radiobuttons, if iselect first radiobutton ihe icon shows green color, another icon shoows red color like vice versa.

can you

8 REPLIES 8
Read only

Former Member
0 Likes
898

Hi,

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

PARAMETERS : p_meth1 RADIOBUTTON GROUP g1 USER-COMMAND g1,

p_meth2 RADIOBUTTON GROUP g1.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK matnr

WITH FRAME TITLE text-002.

SELECTION-SCREEN SKIP 1.

SELECT-OPTIONS : so_matnr FOR marc-matnr MODIF ID m1.

SELECTION-SCREEN SKIP 1.

SELECT-OPTIONS : so_werks FOR marc-werks MODIF ID m1 .

SELECTION-SCREEN END OF BLOCK matnr.

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

SELECTION-SCREEN SKIP 1.

PARAMETERS: p_fpath TYPE ibipparms-path MODIF ID m2 LOWER CASE.

SELECTION-SCREEN END OF BLOCK file.

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

SELECTION-SCREEN SKIP 1.

PARAMETERS : p_date TYPE datuv. "CCT51576.

SELECTION-SCREEN END OF BLOCK date.

***************************************************************************************

***********************Screen Validation*********************************************

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

CASE screen-group1.

WHEN 'M1'.

IF p_meth1 <> 'X'.

screen-active = 1.

ENDIF.

IF p_meth2 = 'X'.

screen-active = 0.

ENDIF.

WHEN 'M2'.

IF p_meth2 = 'X'.

screen-active = 1.

ELSE.

screen-active = 0.

ENDIF.

IF p_meth1 = 'X'.

screen-active = 0.

ENDIF.

ENDCASE.

MODIFY SCREEN.

ENDLOOP.

This will satisfy ur requirement.

Read only

Former Member
0 Likes
898

Hi,

Check this thread

Regards,

Pravin

Read only

Former Member
0 Likes
898

tables:sscrfields.

data:flag.

PARAMETERS : r1 RADIOBUTTON GROUP g1 USER-COMMAND g1,

r2 RADIOBUTTON GROUP g1.

SELECTION-SCREEN BEGIN OF BLOCK b1

WITH FRAME TITLE text-002.

SELECTION-SCREEN SKIP 1.

SELECT-OPTIONS : so_matnr FOR marc-matnr MODIF ID m1.

SELECTION-SCREEN SKIP 1.

SELECT-OPTIONS : so_werks FOR marc-werks MODIF ID m1 .

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCKb2 WITH FRAME TITLE text-003.

SELECTION-SCREEN SKIP 1.

PARAMETERS: p_fpath TYPE ibipparms-path MODIF ID m2.

SELECTION-SCREEN END OF BLOCK b2.

***************************************************************************************

***********************Screen Validation*********************************************

at selection-screen.

if sscrfields-ucomm eq ' G1'.

flag = 1.

endif.

start-of-selection.

if flag = 1.

if R1 eq 'X'

LOOP AT SCREEN.

if screen-group1 eq 'M1'.

screen-input = 1.

modify screen.

endif.

exit.

ENDLOOP.

endif.

if R2 eq 'X'

LOOP AT SCREEN.

if screen-group1 eq 'M2''.

screen-input = 1.

modify screen.

endif.

exit.

ENDLOOP.

endif.

endif.

Edited by: swati gupta on Dec 26, 2008 9:33 AM

Read only

Former Member
0 Likes
898

Hi,

Try like this:

type-pools icon.

SELECTION-SCREEN BEGIN OF BLOCK b1 .

*Radio Button 1

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(5) text_001.

PARAMETER : r_pa TYPE c RADIOBUTTON GROUP gr1 USER-COMMAND mode.

SELECTION-SCREEN COMMENT 10(15) txt1.

SELECTION-SCREEN END OF LINE.

*Radio Button 2

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(5) text_002.

PARAMETER : r_pa1 TYPE c RADIOBUTTON GROUP gr1 DEFAULT 'X'.

SELECTION-SCREEN COMMENT 10(15) txt2.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b1.

selection-screen: begin of block bl1 with frame title text1.

parameters: p_vbeln like vbap-vbeln modif id opn,

p_matnr like vbap-matnr modif id opn,

p_grkor like vbap-grkor modif id opn,

p_vstel like vbap-vstel modif id opn.

selection-screen: end of block bl1.

selection-screen: begin of block bl2 with frame title text2.

parameters: p_matel like mara-matnr modif id mat,

p_matkl like mara-matkl modif id mat,

p_satnr like mara-satnr modif id mat.

selection-screen: end of block bl2.

initialization.

txt1 = 'Radiobutton 1'.

txt2 = 'Radiobutton 2'.

at selection-screen output.

if r_pa = 'X'.

clear text_001.

write icon_green_light as icon to text_001.

loop at screen.

if screen-group1 = 'OPN'.

screen-active = 1.

modify screen.

elseif screen-group1 = 'MAT'.

screen-active = 0.

modify screen.

endif.

endloop.

else.

clear text_001.

write icon_red_light as icon to text_001.

endif.

if r_pa1 = 'X'.

clear text_002.

write icon_green_light as icon to text_002.

loop at screen.

if screen-group1 = 'MAT'.

screen-active = 1.

modify screen.

elseif screen-group1 = 'OPN'.

screen-active = 0.

modify screen.

endif.

endloop.

else.

clear text_002.

write icon_red_light as icon to text_002.

endif.

Regards,

Bhaskar

Read only

Former Member
0 Likes
898

Hello,

use the follwoing logic :

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

*Radio Button for selecting CHA Agent.

PARAMETERS : rb_cha RADIOBUTTON GROUP grp1 DEFAULT 'X' USER-COMMAND com1,

rb_trans RADIOBUTTON GROUP grp1.

*Company Code

PARAMETERS:p_bukrs TYPE t001k-bukrs OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b1.

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

*CHA Bill date

SELECT-OPTIONS:s_cdate FOR zboe_hdr-cha_bill_date MODIF ID id1.

PARAMETERS : p_cha TYPE zcan_cha-cha_agent MODIF ID id1.

SELECTION-SCREEN END OF BLOCK b2.

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

*Transporter Bill Date

SELECT-OPTIONS : s_tdate FOR zboe_hdr-fwd_bill_date MODIF ID id2.

PARAMETERS : p_trans TYPE zcan_cha-transporter MODIF ID id2.

SELECTION-SCREEN END OF BLOCK b3.

*******************************************************************************************

*Display screen based on selection of radio button

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF rb_cha = 'X'.

IF screen-group1 = 'ID2'.

screen-active = 0.

ENDIF.

ELSEIF rb_trans = 'X'.

IF screen-group1 = 'ID1'.

screen-active = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Thanks

Read only

Former Member
0 Likes
898

Try this code:


INCLUDE: <LIST>. " OR INCLUDE <ICON>. 
 
DATA: G_B1_F VALUE 'X', 
      G_B2_F VALUE 'X'. 
 
SELECTION-SCREEN PUSHBUTTON 1(30) BT1 USER-COMMAND BT1. 
 
SELECTION-SCREEN BEGIN OF BLOCK B1. 
PARAMETERS: A MODIF ID B1, 
            B MODIF ID B1, 
            C MODIF ID B1. 
SELECTION-SCREEN END OF BLOCK B1. 
 
SELECTION-SCREEN PUSHBUTTON 1(30) BT2 USER-COMMAND BT2. 
 
SELECTION-SCREEN BEGIN OF BLOCK B2. 
PARAMETERS: X MODIF ID B2, 
            Y MODIF ID B2, 
            Z MODIF ID B2. 
SELECTION-SCREEN END OF BLOCK B2. 
 
*--------------------------------------------------------------------* 
AT SELECTION-SCREEN OUTPUT. 
*--------------------------------------------------------------------* 
 
  IF G_B1_F IS NOT INITIAL AND G_B2_F IS NOT INITIAL. 
*--- + ICON 
    CALL FUNCTION 'ICON_CREATE' 
      EXPORTING 
        NAME   = ICON_EXPAND 
        TEXT   = 'Button 1' 
        INFO   = 'Button 1' 
      IMPORTING 
        RESULT = BT1 
      EXCEPTIONS 
        OTHERS = 0. 
*--- + ICON 
    CALL FUNCTION 'ICON_CREATE' 
      EXPORTING 
        NAME   = ICON_EXPAND 
        TEXT   = 'Button 2' 
        INFO   = 'Button 2' 
      IMPORTING 
        RESULT = BT2 
      EXCEPTIONS 
        OTHERS = 0. 
 
    LOOP AT SCREEN. 
      IF SCREEN-GROUP1 = 'B1' OR SCREEN-GROUP1 = 'B2'. 
        SCREEN-ACTIVE = 0. 
        MODIFY SCREEN. 
      ENDIF. 
    ENDLOOP. 
 
  ELSEIF G_B1_F IS INITIAL AND G_B2_F IS NOT INITIAL. 
*--- - ICON 
    CALL FUNCTION 'ICON_CREATE' 
      EXPORTING 
        NAME   = ICON_COLLAPSE 
        TEXT   = 'Button 1' 
        INFO   = 'Button 1' 
      IMPORTING 
        RESULT = BT1 
      EXCEPTIONS 
        OTHERS = 0. 
*--- + ICON 
    CALL FUNCTION 'ICON_CREATE' 
      EXPORTING 
        NAME   = ICON_EXPAND 
        TEXT   = 'Button 2' 
        INFO   = 'Button 2' 
      IMPORTING 
        RESULT = BT2 
      EXCEPTIONS 
        OTHERS = 0. 
 
    LOOP AT SCREEN. 
      IF SCREEN-GROUP1 = 'B2'. 
        SCREEN-ACTIVE = 0. 
        MODIFY SCREEN. 
      ENDIF. 
      IF SCREEN-GROUP1 = 'B1'. 
        SCREEN-ACTIVE = 1. 
        MODIFY SCREEN. 
      ENDIF. 
    ENDLOOP. 
 
  ELSEIF G_B1_F IS NOT INITIAL AND G_B2_F IS INITIAL. 
*--- + ICON 
    CALL FUNCTION 'ICON_CREATE' 
      EXPORTING 
        NAME   = ICON_EXPAND 
        TEXT   = 'Button 1' 
        INFO   = 'Button 1' 
      IMPORTING 
        RESULT = BT1 
      EXCEPTIONS 
        OTHERS = 0. 
*--- - ICON 
    CALL FUNCTION 'ICON_CREATE' 
      EXPORTING 
        NAME   = ICON_COLLAPSE 
        TEXT   = 'Button 2' 
        INFO   = 'Button 2' 
      IMPORTING 
        RESULT = BT2 
      EXCEPTIONS 
        OTHERS = 0. 
 
    LOOP AT SCREEN. 
      IF SCREEN-GROUP1 = 'B1'. 
        SCREEN-ACTIVE = 0. 
        MODIFY SCREEN. 
      ENDIF. 
      IF SCREEN-GROUP1 = 'B2'. 
        SCREEN-ACTIVE = 1. 
        MODIFY SCREEN. 
      ENDIF. 
    ENDLOOP. 
 
  ELSEIF G_B1_F IS INITIAL AND G_B2_F IS INITIAL. 
*--- - ICON 
    CALL FUNCTION 'ICON_CREATE' 
      EXPORTING 
        NAME   = ICON_COLLAPSE 
        TEXT   = 'Button 1' 
        INFO   = 'Button 1' 
      IMPORTING 
        RESULT = BT1 
      EXCEPTIONS 
        OTHERS = 0. 
*--- - ICON 
    CALL FUNCTION 'ICON_CREATE' 
      EXPORTING 
        NAME   = ICON_COLLAPSE 
        TEXT   = 'Button 2' 
        INFO   = 'Button 2' 
      IMPORTING 
        RESULT = BT2 
      EXCEPTIONS 
        OTHERS = 0. 
 
    LOOP AT SCREEN. 
      IF SCREEN-GROUP1 = 'B1'. 
        SCREEN-ACTIVE = 1. 
        MODIFY SCREEN. 
      ENDIF. 
      IF SCREEN-GROUP1 = 'B2'. 
        SCREEN-ACTIVE = 1. 
        MODIFY SCREEN. 
      ENDIF. 
    ENDLOOP. 
 
  ENDIF. 
 
AT SELECTION-SCREEN. 
  CASE SY-UCOMM. 
    WHEN 'BT1'. 
      IF G_B1_F IS INITIAL. 
        G_B1_F = 1. 
      ELSE. 
        CLEAR: G_B1_F. 
      ENDIF. 
    WHEN 'BT2'. 
      IF G_B2_F IS INITIAL. 
        G_B2_F = 1. 
      ELSE. 
        CLEAR: G_B2_F. 
      ENDIF. 
  ENDCASE.

Read only

Former Member
0 Likes
898

Hi,

You can do it by using Loop at screen .... endloop.

Regards.

Read only

Former Member
0 Likes
898

thanks.