‎2006 Oct 17 1:29 PM
Hi Friends,
I have one query.
My condition is like
In selection screen there are 4 fields like A, B, C & D.
Now requirement is like
I have to ensure that field A, C or D having some value i.e. if none of these selections were entered then display the error message.
Suppose i have to do some conditions like X & Y.
In condition X(Consider as first subroutine)
Do not allow A and C selection to both be selected.
display an error message if both are selected.
Do not allow C & D selection to both be selected.
display an error message if both are selected.
B & C selection is ok.
Then further processing.
Now in condition Y(consider as second subroutine)
Do not allow A & D selection to both be selected.
display an error message if both are selected.
Do not allow C & D selection to both be selected.
display an error message if both are selected.
B & D selection is ok.
Then further processing.
I did my coding but I m not getting my desired result.
Anybody will tell me the pseudo coding for this??????
‎2006 Oct 17 1:44 PM
Hi salil,
Coding for validation in ON SELECTION SCREEN event :-
*****************************************************
if A = ' ' and C = ' ' and D = ' '.
message 'A C D are blank' type 'E'.
endif.
if A = 'X' and C = 'X'.
message 'A & C both selection not allowed' type 'E'.
endif.
if A = 'X' and D = 'X'.
message 'A & D both selection not allowed' type 'E'.
endif.
if necessary ***
if B = ' '.
message 'B must be selected' type 'E'.
endif.
Pl.reward if satisfied.
Thanks & regards
Prammenthiran (Prem)
‎2006 Oct 17 1:47 PM
hi,
try that:
REPORT zzzz111 .
PARAMETERS: a,b,c,d.
AT SELECTION-SCREEN.
*1
IF a = space AND c = space AND d = space.
MESSAGE e001(00) WITH 'E1'.
ENDIF.
*A/C
if a <> space and c <> space.
MESSAGE e001(00) WITH 'X1'.
ENDIF.
*C/D
if d <> space and c <> space.
MESSAGE e001(00) WITH 'X2'.
ENDIF.
*A/D
if a <> space and d <> space.
MESSAGE e001(00) WITH 'Y1'.
ENDIF.
*C/D
if d <> space and c <> space.
MESSAGE e001(00) WITH 'Y2'.
ENDIF.A.
‎2006 Oct 17 1:49 PM
hi can u give us the coding which u have done instead of us simulating the whole scenario, we can just help where you have gone wrong
‎2006 Oct 17 1:56 PM
U can try and use the below logic.
AT SELECTION-SCREEN.
PERFORM CHECK_CONDITION using cond a b c d.
FORM check_condition using icnd ia ib ic id.
if ia = space and ic = space and id = space.
Error.
endif.
if ia = Space.
if ic <> space and id <> space.
Error.
endif.
else.
case icnd.
when 'X'.
if ic <> space. Error. Endif.
when 'Y'.
if id <> space. Error. Endif.
endcase.
endif.
ENDFORM.
‎2006 Oct 17 2:35 PM
Hi,
I am sending my coding..
Plz let me know where I am wrong...
At selection-screen.
If A NE ' ' OR C NE ' ' OR D NE ' '.
ELSE.
ERROR.
ENDIF.
IN FORM DATA.
PERFORM M.
PERFORM N.
FORM M.
IF A NE ' ' AND C NE ' '.
ERROR.
ELSEIF C NE ' ' AND D NE ' '.
ERROR.
ELSE.
PROCESSING.
ENDIF.
ENDFORM.
FORM N.
IF A NE ' ' AND D NE ' '.
ERROR.
ELSEIF C NE ' ' AND D NE ' '.
ERROR.
ELSE.
PROCESSING.
ENDIF.
ENDFORM.
I am getting problem in form N. Whenever i run my prog it will not work properly for for form N.
Will u suggest me what i have to do??
‎2006 Oct 17 3:25 PM
What is the problem you encounter and secondly please let us know which values you are populating in A/B/C and D.
Regards
Anurag