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

Selection screen: Mandatory fields

Former Member
0 Likes
15,932

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??

13 REPLIES 13
Read only

former_member156446
Active Contributor
0 Likes
6,474

nope.

why do you want to do that?

Read only

0 Likes
6,474

Functional designer's requirement.

Read only

Former Member
0 Likes
6,474

Thats a weird requirement. So you mean you just want to display a field as obligatory but not mandatory in real?

Read only

0 Likes
6,474

Functional designer's requirement.

Read only

0 Likes
6,474

Wiered...Let the designer know that your a programmer not a magician

Read only

Former Member
0 Likes
6,474

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

Read only

Former Member
0 Likes
6,474

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.

Read only

0 Likes
6,474
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?

Read only

Former Member
0 Likes
6,474

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

Read only

0 Likes
6,474
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?

Read only

0 Likes
6,474

hi

change the requird field to 0

Read only

Former Member
0 Likes
6,474
PARAMETER p_field TYPE char10.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF screen-name = 'P_FIELD'.
      screen-required = '2'.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
Read only

0 Likes
6,474

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'.