‎2009 Aug 14 5:35 AM
Hi,
As we all know, If the fields in a selection screen are mandatory, there will be a small tick box inside that field. Suppose if a field is not mandatory(obligatory), can we still push a tick box symbol to those fields. Is there a way to push the mandatory symbol into non-mandatory fields??
‎2009 Aug 14 5:36 AM
‎2009 Aug 14 6:12 AM
‎2009 Aug 14 5:40 AM
Thats a weird requirement. So you mean you just want to display a field as obligatory but not mandatory in real?
‎2009 Aug 14 6:13 AM
‎2009 Aug 14 6:21 AM
Wiered...Let the designer know that your a programmer not a magician
‎2009 Aug 14 6:28 AM
Hi Vishnu,
This is not possible.
we can actualy make a field mandatory with out using 'OBLIGATORY' key word, by adding validation on field like
IF field Is INITIAL.
Message .....
ENDIF.
but we cant add tick mark in the field without using 'OBLIGATORY' key work.
Regards
Raj Gupta
‎2009 Aug 14 6:31 AM
hi..
this is not good requirement
still u can try the following logic
create a check box and assign a user command for it
when we change the value of that field in at selection screen event will be trigered
in that loop at screen table and change the required field to 0
i didnt tried this logic. Seems it will work
you have another optio like doing it in program
by giving condition.
‎2009 Aug 14 7:24 AM
IF rb_speci = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'R1'.
screen-active = 1.
screen-display_3d = 1.
screen-value_help = 1.
screen-request = 1.
screen-values_in_combo = 0.
screen-color = 100.
MODIFY SCREEN.
ENDIF.Any idea which field i have to change?
‎2009 Aug 14 6:41 AM
I think the requirement is misunderstood.
Vishnu , The mandatory check in requirement may be context specific i.e. The field is set mandatory based on the value of some other influencing fields.
If thats the case,you can change the property by loop at screen.endloop. in at selection screen output event.
we cannot have an optional filed with mandatory property.
Thanks,
AJR
‎2009 Aug 14 7:25 AM
IF rb_speci = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'R1'.
screen-active = 1.
screen-display_3d = 1.
screen-value_help = 1.
screen-request = 1.
screen-values_in_combo = 0.
screen-color = 100.
MODIFY SCREEN.
ENDIF.Any idea which field i have to change?
‎2009 Aug 14 7:42 AM
‎2009 Aug 14 7:39 AM
PARAMETER p_field TYPE char10.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'P_FIELD'.
screen-required = '2'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
‎2009 Aug 14 7:53 AM
I think the program still requires slight correction. Please find the below code and help.
REPORT ztest_prg.
TABLES : estrh, plko.
DATA : c_speci TYPE c,
c_insp TYPE c.
SELECTION-SCREEN: BEGIN OF BLOCK bal WITH FRAME TITLE txt3.
PARAMETERS: rb_speci RADIOBUTTON GROUP rd1 . "USER-COMMAND abc
PARAMETERS: rb_inspl RADIOBUTTON GROUP rd1 DEFAULT 'X'.
SELECTION-SCREEN: END OF BLOCK bal.
SELECTION-SCREEN: BEGIN OF BLOCK val WITH FRAME TITLE txt1.
SELECT-OPTIONS : s_specif FOR estrh-subid OBLIGATORY MODIF ID r1.
SELECT-OPTIONS : s_plant FOR plko-werks MODIF ID r1 .
PARAMETER : p_chgnum TYPE aenr-aennr MODIF ID r1.
SELECTION-SCREEN: END OF BLOCK val.
SELECTION-SCREEN: BEGIN OF BLOCK upd WITH FRAME TITLE txt2.
SELECT-OPTIONS: s_insp FOR plko-plnnr OBLIGATORY MODIF ID r2.
SELECT-OPTIONS: s_plan FOR plko-werks MODIF ID r2.
PARAMETERS: p_chgn TYPE aenr-aennr MODIF ID r2.
SELECTION-SCREEN: END OF BLOCK upd.
INITIALIZATION.
txt1 = 'Specifications'.
txt2 = 'Inspection Plans'.
txt3 = 'Selection'.
AT SELECTION-SCREEN OUTPUT.
IF rb_speci = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'R1'.
screen-active = 1.
IF screen-name = 'S_SPECIF'.
screen-required = '2'.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'R2'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF
rb_inspl = 'X'.
REFRESH screen.
MODIFY SCREEN.
LOOP AT SCREEN.
IF screen-group1 = 'R2'.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'R1'.
IF screen-name = 'S_SPECIF'.
screen-required = '1'.
* MODIFY SCREEN.
ENDIF.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
START-OF-SELECTION.
PERFORM f_validation.
IF rb_speci = 'X'.
CHECK c_speci IS INITIAL.
ENDIF.
IF rb_inspl = 'X'.
CHECK c_insp IS INITIAL.
ENDIF.
WRITE:/10(10) 'ITS DONE'.