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

Obligatory Fields

Former Member
0 Likes
631

I am having two select options and two option buttons. one select option is obligatory and other is optional. If i click the option button 1 all the two select options should be disabled and if i select the option button 2 all the two select options should be enabled. When i am trying to disable it is asking for obligatory fields to enter.

Below is my coding

REPORT ytest_subbu010.

TABLES mara.

SELECT-OPTIONS : s_matnr FOR mara-matnr MODIF ID m,

s_meins FOR mara-meins MODIF ID m.

PARAMETERS: rb_ena TYPE c RADIOBUTTON GROUP g1 DEFAULT 'X'

USER-COMMAND ac,

rb_dis TYPE c RADIOBUTTON GROUP g1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF rb_dis NE 'X'.

IF screen-group1 EQ 'M'.

screen-input = 0.

IF ( screen-name EQ 'S_MATNR-LOW' OR

screen-name EQ 'S_MATNR-HIGH' ).

screen-required = 0.

ENDIF.

ENDIF.

ENDIF.

IF rb_dis EQ 'X'.

IF screen-group1 EQ 'M'

AND ( screen-name EQ 'S_MATNR-LOW' ).

screen-required = 1.

ENDIF.

ENDIF.

MODIFY SCREEN.

5 REPLIES 5
Read only

Former Member
0 Likes
572

Hi kumaraswamy,

1. One way is that don't use

obligatory.

2. Instead, check if INITIAL

in your code for start-of-selection.

3. eg.

if field is initial.

message I..

leave list-processing.

endif.

regards,

amit m.

Read only

Former Member
0 Likes
572

Hi Kumar,

Use following logic instead of mandatory.

if button1 is initial.

loop at screen.

endloop.

elseif button2 is initial.

loop at screen.

endloop.

endif.

Regards

Amole

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
572

Hi,

Fill the obligatory with default value '0'.

SELECT-OPTIONS : s_matnr FOR mara-matnr default '0' MODIF ID m,

s_meins FOR mara-meins MODIF ID m.

Kindly reward points by clicking the star on the left of reply,if it helps.

Read only

Former Member
0 Likes
572

Hi kumar,

you just enter some thing in matnr and choose other radiobutton , it will solve your problem.

or check the initial condition instead of making it obligatory, and check the initial condition and accordingly give the error message if it is initial.

regards

vijay

Read only

hymavathi_oruganti
Active Contributor
0 Likes
572

dont use obligatory,

when u want to make it obligatory, u can make it at runtime itself by screen-required = 1