‎2006 Jan 27 12:13 PM
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.
‎2006 Jan 27 12:20 PM
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.
‎2006 Jan 27 12:25 PM
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
‎2006 Jan 27 12:30 PM
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.
‎2006 Jan 27 12:44 PM
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
‎2006 Jan 27 12:44 PM
dont use obligatory,
when u want to make it obligatory, u can make it at runtime itself by screen-required = 1