‎2007 Aug 11 11:49 PM
Hi Everybody,
can anybody help me regarding selection-screen.
My requirement is
in Selection screen iam having the following fields with condition
A-...... to .......
B-...... to .......
C-...... to .......
D-...... to .......
E-...... to .......
F-...... to .......
here condition is either A or D were mandatory
and if 'D' is populated then 'E','F' are mandatory.
Thanking you,
‎2007 Aug 12 12:48 AM
Hi Sunil,
Instead of making a selection screen like this the best way is do this validaion in AT SELECTION SCREEN.
There you can check for these conditions and it is only the best way to do this.
Regards,
Atish
‎2007 Aug 12 1:57 AM
Agreed - this is best done in the "at selection-screen" event... one thing to be careful of is that since you appear to be using select-options for each criterion, you need to code you validation to check the body of the range, not just the screen elements i.e.
if s_bukrs[] is initial.
set cursor field 'S_BUKRS-LOW'.
message e398(00) with 'Company Code must be provided'
space space space.
endif.
‎2007 Aug 12 6:43 PM
Hi Guys,
iam asking how to write code for looping the screen.
i.e., we must give value either 'A' or 'D' ('A' or 'D' is Mandatory)
if we give any value for 'A' then 'B', 'C' should be mandatory( if 'A' is populated)
if we give any value for 'D' then 'E', 'F' should be mandatory( if 'D' is populated)
I think this condition will be done on AT Selection-Screen OUTPUT.
‎2007 Aug 12 11:14 PM
Hi Sunil
This validation is done in AT SELECTION-SCREEN event.
Your Code:
AT SELECTION-SCREEN.
IF A[] IS INITIAL AND D[] IS INITIAL.
Message 'Error' TYPE e. " Sunil replace this by your message class.
ENDIF.
IF NOT A[] IS INITIAL.
IF B[] IS INITIAL OR C[] IS INITIAL.
Message 'Error' TYPE e. " Sunil replace this by your message class.
ENDIF.
ENDIF.
IF NOT D[] IS INITIAL.
IF E[] IS INITIAL OR F[] IS INITIAL.
Message 'Error' TYPE e. " Sunil replace this by your message class.
ENDIF.
ENDIF.