‎2008 Apr 09 7:46 AM
Hi all,
I am using the following code for designing the selection screen.
in the following code i am using RB_TAS and RB_POS for radio buttons and S_TASK AND S_OBJID as select options
now if i select RB_TAS then s_objid mist be in display mods and s_task must be visible mode to enter the value. in the same way if i select RB_POS then S_OBJID must be in visible mode so that i can enter some value and same time S_TASK must be in display mode so that not to enter the value.
I must not press enter at any point. if i select the radiobuttons the screen validatiion must happen.
here is the code:
selection-screen begin of block blk1 with frame title text-001.
SELECTION-SCREEN : BEGIN OF LINE.
SELECTION-SCREEN : POSITION 3.
*Radiobutton for task
PARAMETERS : RB_tas RADIOBUTTON GROUP rbg1 DEFAULT 'X' MODIF ID pre.
SELECTION-SCREEN : COMMENT 5(30) text-100 MODIF ID pre.
*Radiobutton for Position.
PARAMETERS : RB_pos RADIOBUTTON GROUP rbg1 MODIF ID pre.
SELECTION-SCREEN : COMMENT 40(12) text-101 MODIF ID pre.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN: SKIP 1.
*&--->selectoptions for task and position
SELECT-OPTIONS: s_task FOR pchdy-objid_str MODIF ID tas,
s_objid FOR pchdy-objid_seq MODIF ID pos.
selection-screen end of block blk1.
how to do the logic in AT SELECTION SCREEN OUTPUT.
CAN ANY BODY SEND THE LOGIC.
NOTE: i must not press enter at any point.
thanks,
giri.
‎2008 Apr 09 8:02 AM
You don't need to add much... try this:
report zlocal_jc_sdn_radio_lock.
tables:
pchdy. "Selection Parameters for Database PCH
selection-screen begin of block blk1 with frame title text-001.
selection-screen: begin of line.
selection-screen: position 3.
*Radiobutton for task
parameters :
rb_tas radiobutton group rbg1 default 'X' modif id pre
user-command rb1. "you need this trigger
selection-screen : comment 5(30) text-100 modif id pre.
*Radiobutton for Position.
parameters :
rb_pos radiobutton group rbg1 modif id pre.
selection-screen : comment 40(12) text-101 modif id pre.
selection-screen : end of line.
selection-screen: skip 1.
*&--->selectoptions for task and position
select-options:
s_task for pchdy-objid_str modif id tas,
s_objid for pchdy-objid_seq modif id pos.
selection-screen end of block blk1.
at selection-screen output.
perform at_selection_screen_output. "lock screen fields before display
*&---------------------------------------------------------------------*
*& Form at_selection_screen_output
*&---------------------------------------------------------------------*
form at_selection_screen_output.
loop at screen.
if screen-name cs 'S_TASK'
and rb_tas is initial.
screen-input = '0'.
endif.
if screen-name cs 'S_OBJID'
and rb_pos is initial.
screen-input = '0'.
endif.
modify screen.
endloop.
endform. "at_selection_screen_output
‎2008 Apr 09 8:02 AM
You don't need to add much... try this:
report zlocal_jc_sdn_radio_lock.
tables:
pchdy. "Selection Parameters for Database PCH
selection-screen begin of block blk1 with frame title text-001.
selection-screen: begin of line.
selection-screen: position 3.
*Radiobutton for task
parameters :
rb_tas radiobutton group rbg1 default 'X' modif id pre
user-command rb1. "you need this trigger
selection-screen : comment 5(30) text-100 modif id pre.
*Radiobutton for Position.
parameters :
rb_pos radiobutton group rbg1 modif id pre.
selection-screen : comment 40(12) text-101 modif id pre.
selection-screen : end of line.
selection-screen: skip 1.
*&--->selectoptions for task and position
select-options:
s_task for pchdy-objid_str modif id tas,
s_objid for pchdy-objid_seq modif id pos.
selection-screen end of block blk1.
at selection-screen output.
perform at_selection_screen_output. "lock screen fields before display
*&---------------------------------------------------------------------*
*& Form at_selection_screen_output
*&---------------------------------------------------------------------*
form at_selection_screen_output.
loop at screen.
if screen-name cs 'S_TASK'
and rb_tas is initial.
screen-input = '0'.
endif.
if screen-name cs 'S_OBJID'
and rb_pos is initial.
screen-input = '0'.
endif.
modify screen.
endloop.
endform. "at_selection_screen_output
‎2008 Apr 09 9:39 AM
Add User Command to radiobutton declaration statement for RB_TAS and write the logic in at selection-screen output