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

Former Member
0 Likes
695

Hi all,

I am creating a program that generate report for new hire or terminated or transfer.

What I want that if suppose we select one of the readio button then automaticaly it add the default selection value on selection screen

e.g.

suppose I selected for New hire then

default selection value select for

employee status

employee group

reason for action

action

and if some want to change that they can change.

I am doing in at selection screen event setting default value as of the radio button selected

but when I was trying to go to change the value for selecion It add that value but default is also there.

i have a logic if we select radio button first but I dont want to restrict that user have to select radio button first.

7 REPLIES 7
Read only

rahulkavuri
Active Contributor
0 Likes
637

do this at the <b>AT-SELECTION SCREEN OUTPUT</b> EVENT

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS : P_FILE(25) TYPE C,
             O_FILE(25) TYPE C.

SELECTION-SCREEN END OF BLOCK B1.

*Selection Screen 2

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.

PARAMETERS: CAL_TRA RADIOBUTTON GROUP G1 USER-COMMAND FLAG,
            SESSION RADIOBUTTON GROUP G1 DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK B2.

*Selection Screen 3

SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.

PARAMETERS: MODE DEFAULT 'X' MODIF ID BL1,
            UPDATE DEFAULT 'X' MODIF ID BL1.

SELECTION-SCREEN END OF BLOCK B3.

*Selection Screen 4

SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-003.


PARAMETERS: SES_NAM TYPE APQI-GROUPID MODIF ID BL2,
            KEP_TRAS TYPE C DEFAULT 'X' MODIF ID BL2,
            LOC_DATE TYPE SY-DATUM MODIF ID BL2,
            USER TYPE SY-UNAME DEFAULT SY-UNAME MODIF ID BL2.

SELECTION-SCREEN END OF BLOCK B4.

************************************************************************
*                     At  Selection-Screen Output                      *
************************************************************************

AT SELECTION-SCREEN OUTPUT.


  IF CAL_TRA = 'X'.
    LOOP AT SCREEN.

      IF SCREEN-GROUP1 = 'BL1'.
        SCREEN-ACTIVE = '1'.
      ENDIF.

      IF SCREEN-GROUP1 = 'BL2'.
        SCREEN-ACTIVE = '0'.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

  IF SESSION = 'X'.

    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'BL1'.
        SCREEN-ACTIVE = '0'.
      ENDIF.

      IF SCREEN-GROUP1 = 'BL2'.
        SCREEN-ACTIVE = '1'.
      ENDIF.

      MODIFY SCREEN.

    ENDLOOP.
  ENDIF.

************************************************************************
*****************            INITIALIZATION         ********************
************************************************************************

INITIALIZATION.

  LOC_DATE  = SY-DATUM - 1.

Read only

Former Member
0 Likes
637

hi

hav u used at <b>selection-screen output</b>

Read only

Former Member
0 Likes
637

Hi,

u can do the same thing what u have done at selection screen in the INITIALIZATION Event.

Read only

Former Member
0 Likes
637

hii

check this

you can do that AT SELECTION SCREEN OUTPUT .

REPORT z_selectionscreen .

SELECTION-SCREEN BEGIN OF BLOCK blk.

PARAMETERS : p_rb1 TYPE PAYGROUP RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND FC,

p_rb2 TYPE PAYGROUP RADIOBUTTON GROUP rad1.

SELECTION-SCREEN END OF BLOCK blk.

SELECTION-SCREEN BEGIN OF BLOCK blk_1 WITH FRAME.

PARAMETERS : p_werks1 TYPE werks_d MODIF ID bk1.

SELECTION-SCREEN END OF BLOCK blk_1.

SELECTION-SCREEN BEGIN OF BLOCK blk_2 WITH FRAME.

PARAMETERS : p_werks2 TYPE werks_d MODIF ID bk2,

p_matnr2 TYPE matnr MODIF ID bk2.

SELECTION-SCREEN END OF BLOCK blk_2.

<b>AT SELECTION-SCREEN OUTPUT.</b>

IF p_rb1 = '5V'.

LOOP AT SCREEN.

IF screen-group1 = 'BK1'.

screen-active = 0.

MODIFY SCREEN.

ELSE.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF screen-group1 = 'BK2'.

screen-active = 0.

MODIFY SCREEN.

ELSE.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

REGARDS

Naresh

Read only

Former Member
0 Likes
637

Rahul,

I didn,t get that

what exactly happen when i will do that

what i want

I will select one of the radio button at that time it will show me seletion screen for action ,employee group with default valueas of radio button .And then if someone want to change the default setting it will allow him.

what happen right now is I am adding default value but when I was going to change default value it will add default + new value.

Read only

Former Member
0 Likes
637

Hii Manan ,

just clear the values..that will clear the default values..

for ex: in Rahul's example..

CLEAR CAL_TRA .

CLEAR SESSION.

This will solve your problem

Read only

Former Member
0 Likes
637

Bellow is the code that I am trying to do

but at selection screen event

when I select any of the radio button it sets the default value that I can do but the problem is I want to activate the sectioncsreen with group1-SEL that I Inactivate.

selection-screen begin of block trn with frame title text-s01.

selection-screen begin of line.

selection-screen comment 1(65) text-s02 for field actual.

selection-screen position 67.

parameter : actual as checkbox.

selection-screen end of line.

SELECTION-SCREEN END OF BLOCK trn.

selection-screen begin of block tp1 with frame title text-s03.

selection-screen begin of line.

selection-screen comment 1(45) text-s04 for field nwh.

selection-screen position 47.

parameter : nwh radiobutton group rad1 default 'X'.

selection-screen end of line.

selection-screen begin of line.

selection-screen comment 1(45) text-s05 for field tpc.

selection-screen position 47.

parameter : tpc radiobutton group rad1.

selection-screen end of line.

selection-screen begin of line.

selection-screen comment 1(45) text-s06 for field sep.

selection-screen position 47.

parameter : sep radiobutton group rad1.

selection-screen end of line.

SELECTION-SCREEN END OF BLOCK tp1.

AT SELECTION-SCREEN OUTPUT.

loop at screen.

IF SCREEN-GROUP1 = 'SEL'.

SCREEN-active = '0'.

modify screen.

ENDIF.

endloop.

at selection-screen.

if sep = 'X'.

if count = '0'.

pnpstat2-low = '3'.

pnpstat2-sign = 'I'.

pnpstat2-option = 'EQ'.

APPEND pnpstat2.

CLEAR pnpstat2.

pnpstat2-low = '1'.

pnpstat2-sign = 'I'.

pnpstat2-option = 'EQ'.

APPEND pnpstat2.

CLEAR pnpstat2.

I wan to activate selection screen here that I inactivate

above

endif.

or over here is also ok