Application Development 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: 

Making Mandatory fields on Screen and vice versa

Former Member
0 Kudos

Hi,

I've developed a screen on which i've a field say X. Initially when the screen is shown the field is not mandatory as user may or may not enter its value.

But when he enters its value, then i've to make field Y and field Z mandatory also.

For this in PBO i've called a module which would make the necessary screen change.

LOOP AT SCREEN.

IF X IS NOT INITIAL.

IF ( screen-name = 'Y' OR

screen-name = 'Z' ).

screen-required = '1'.

ENDIF.

ELSE.

IF ( screen-name = 'Y' OR

screen-name = 'Z' ).

screen-required = '0'.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Though the above code makes the field Y and Z mandatory but when the user clears the field X value still it shows them mandatory which i don't want

How can i handle this?

PLZ HELP!

5 REPLIES 5

Former Member
0 Kudos

Hi,

do like this.


PARAMETERS:x(10),Y(10),Z(10).

AT SELECTION-SCREEN ON x.
  IF X IS NOT INITIAL.
    LOOP AT SCREEN.
      IF ( screen-name = 'Y' OR
        screen-name = 'Z' ).
        screen-required = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
  
start-of-selection.
write:/ x,y,z.

rgds,

bharat.

ak_upadhyay
Contributor
0 Kudos

HI,

Try this....

IF X IS NOT INITIAL.

IF ( screen-name = 'Y' OR

screen-name = 'Z' ).

screen-required = '1'.

MODIFY SCREEN.

ELSE.

IF ( screen-name = 'Y' OR

screen-name = 'Z' ).

screen-required = '0'.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

Reward points if useful....

Regards

AK

Former Member
0 Kudos

Hi

What everyone described is using code block..

why not you should define it while designing the screen.

on defining the field Input/Output Field Attributes of Y & Z , define program-> input -> Required.

In detail :

INPUT/OUTPUT Field of Y & Z

Attributes

Dict | Program | Display

*Under Attributes -> Program -> Input (drop down list) -select as Required.*Hope it will work fine.

Rewards Points if useful

Former Member
0 Kudos

Hi Annie,

try this...

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF X IS NOT INITIAL.

IF ( screen-name = 'Y' OR

screen-name = 'Z' ).

screen-required = '1'.

ENDIF.

ELSE.

IF ( screen-name = 'Y' OR

screen-name = 'Z' ).

screen-required = '0'.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

reward points if useful...

Former Member
0 Kudos

Hi ,

If it is the case of report use addition 'OBLIGATORY' with Paramters or select-options: Else if it is the case of module pool in the attributes of the screen fieldgoto program and select input as 'Required'.

Reward points if it is helpful.

Regards,

Sankar.