03-20-2008 7:11 AM
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!
03-20-2008 7:16 AM
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.
03-20-2008 7:18 AM
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
03-20-2008 8:31 AM
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
03-20-2008 8:48 AM
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...
03-20-2008 8:56 AM
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.