cancel
Showing results for 
Search instead for 
Did you mean: 

Regardinf selection-screen validation

Former Member
0 Kudos

Hi All,

I have a issue in selection screen.

First of all i have 2 radio buttons <b>[Rad1, Rad2]</b>.

below that i have a frame in that i had created one <b>sales document field as select-option</b>.

What i want is when i press 1st radio button the sales document field should not be mandatory. And when i select 2nd radio button the sales document field should be mandatory.

Can anybody tell me how can i solve above issue.

Please note that i should be able to select any of radio buttons when other being selected.

Please solve my issue.

Thanks in advance.

Thanks & Regards,

Rayeez.

Accepted Solutions (1)

Accepted Solutions (1)

former_member181962
Active Contributor
0 Kudos

In the

at selection-screen output event,

do the following,

if p_rb1 = 'X'.

loop at screen.

if screen-group = <modif id of your parameter>.

screen-required = '1'.

modify screen.

endif.

endloop.

endif.

Declare the parameter as not obligatory by default.

Regards,

Ravi

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Shaik Rayeezuddin,

Try this sample code :

PROGRAM abap.

tables : mara.

SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH FRAME TITLE TEXT-BL1.

PARAMETERS : r1 RADIOBUTTON GROUP g1,

r2 RADIOBUTTON GROUP g1.

SELECT-OPTIONS : matnr for mara-matnr.

SELECTION-SCREEN END OF BLOCK BL1.

At Selection-screen.

IF r1 = 'X'.

message e999(ys01) with 'MATNR is mandetory field'.

ENDIF.

start-of-selection.

write 'OK'.

This one definately match ur requirement.

Regards,

Digesh Panchal

Former Member
0 Kudos

Hi Shaik,

I would rather suggest as below assuming rad1 is your first radio button:

PARAMETERS:

rad1 RADIOBUTTON GROUP g1 DEFAULT 'X',

rad2 RADIOBUTTON GROUP g1.

SELECT-OPTIONS:

s_doc FOR vbap-vbeln.

AT SELECTION-SCREEN.

IF rad1 IS INITIAL AND

s_doc[] IS INITIAL.

MESSAGE ennn(mm). "Give a error message here.

ENDIF.

Regards,

Srikanth

Former Member
0 Kudos

Hi

You can loop at screen and modify the properties for the fields in <b>AT SELECTION-SCREEN OUTPUT</b>.

For eg:

LOOP AT SCREEN.

IF SCREEN-NAME = 'S_CDATE-HIGH' OR

SCREEN-NAME = 'S_CDATE-LOW'.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Regards,

Raj

Former Member
0 Kudos

Hi,

Try following logic

at selection-screen .

loop at screen.

if rad1 = 'x'.

if screen-name = 'S_VBELN'.

screen-input = 1.

endif.

elseif rad2 = 'X'.

if screen-name = 'S_VBELN'.

screen-input = 0.

endif.

endif.

modify screen.

endloop.

Regards,

Amole