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: 

Checking of the selection screen

Former Member
0 Kudos

Hello, on the selection-screen I have 4 date intervals. The are radiobuttons for each date intervals. The date field should be obligatory, but only if I select the radiobutton belonging to it on the selection-screen. How can I do that?

Radiobuttons are: r1, r2, r3, r4

intervals, are: s_date1, s_date2, s_date3, s_date4

1 ACCEPTED SOLUTION

Former Member
0 Kudos
at selection-screen.
 
  if r1 = 'X'.
     if s_date1[] is initial.
        *display error message
     endif.
  elseif r2 = 'X'.
 if s_date2[] is initial.
        *display error message
     endif.
  elseif r3 = 'X'..
if s_date3[] is initial.
        *display error message
     endif.
  elseif r4 = 'X'..
if s_date4[] is initial.
        *display error message
     endif.
endif.

  

Message was edited by:

chandrasekhar jagarlamudi

7 REPLIES 7

Former Member
0 Kudos

hi Jacob,

Write your logic at AT SELECTION-SCREEN OUTPUT. event

Regards,

Santosh

Former Member
0 Kudos
at selection-screen.
 
  if r1 = 'X'.
     if s_date1[] is initial.
        *display error message
     endif.
  elseif r2 = 'X'.
 if s_date2[] is initial.
        *display error message
     endif.
  elseif r3 = 'X'..
if s_date3[] is initial.
        *display error message
     endif.
  elseif r4 = 'X'..
if s_date4[] is initial.
        *display error message
     endif.
endif.

  

Message was edited by:

chandrasekhar jagarlamudi

Former Member
0 Kudos

IN the AT SELECTION OUTPUT for the required select option do the following

LOOP AT SCREEN.

IF rb_pc = 'X' AND screen-name = 'S_DATE!'.

screen-required = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

This will set the Select option to be mandatory

Former Member
0 Kudos

Hi

AT SELECTION-SCREEN OUTPUT.

if radio1 = 'X'.

if s_date1 is initial.

message <give some error message>

endif.

endif.

if radio2 = 'X'.

if s_date2 is initial.

message <give some error message>

endif.

endif.

Do the same for other buttons too.

Regards

Surya.

Former Member
0 Kudos

Hi,

You can do it the following way.

parameter: r_1 radiobutton group g1 user-command radio1 default 'X',

r_2 radiobutton group g1 .

parameter:s_date1 like sy-datum modif id gr1,

s_date2 like sy-datum modif id gr2.

at selection-screen output.

if r_1 = 'X' .

loop at screen.

if screen-group1 = 'GR2'.

screen-input = '0'.

modify screen.

endif.

endloop.

Hope this helps.

Regards,

Kinshuk

Former Member
0 Kudos

PARAMETERS: P_RB1 RADIOBUTTON GROUP 123 USER-COMMAND UCOMM default 'X',

P_F1 TYPE D MODIF ID 123 ,

P_RB2 RADIOBUTTON GROUP 123,

P_F2 TYPE D MODIF ID 234 ,

P_RB3 RADIOBUTTON GROUP 123,

P_F3 TYPE D MODIF ID 456 ,

P_RB4 RADIOBUTTON GROUP 123,

P_F4 TYPE D MODIF ID 567.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

CASE SCREEN-GROUP1.

WHEN '123'.

IF P_RB1 = 'X'.

SCREEN-INPUT = 1.

SCREEN-REQUIRED = 1.

MODIFY SCREEN.

ELSE.

SCREEN-INPUT = 0.

SCREEN-REQUIRED = 0.

MODIFY SCREEN.

ENDIF.

WHEN '234'.

IF P_RB2 = 'X'.

SCREEN-INPUT = 1.

SCREEN-REQUIRED = 1.

MODIFY SCREEN.

ELSE.

SCREEN-INPUT = 0.

SCREEN-REQUIRED = 0.

MODIFY SCREEN.

ENDIF.

WHEN '456'.

IF P_RB3 = 'X'.

SCREEN-INPUT = 1.

SCREEN-REQUIRED = 1.

MODIFY SCREEN.

ELSE.

SCREEN-INPUT = 0.

SCREEN-REQUIRED = 0.

MODIFY SCREEN.

ENDIF.

WHEN '567'.

IF P_RB4 = 'X'.

SCREEN-INPUT = 1.

SCREEN-REQUIRED = 1.

MODIFY SCREEN.

ELSE.

SCREEN-INPUT = 0.

SCREEN-REQUIRED = 0.

MODIFY SCREEN.

ENDIF.

ENDCASE.

Former Member
0 Kudos

Thanks for the answers.