04-12-2007 11:03 AM
Hi friends,
I am having a Parameter P_STATUS which will refer the Ztable and Zdataelement.
P_STATUS holds only 3 values like ' ALL' , 'ACT', 'INV' .
For validation of P_STATUS how should i worte the code like this but it is not working correctly.
IF P_STATUS IS INITIAL..
IF P_STATUS NE ' ALL' or
P_STATUS NE 'ACT' or
P_STATUS NE 'INV' .
error message
ENDIF.
ENDIF.
other than 3 any value should be error.
Reward is sure.
Thanks.
04-12-2007 2:17 PM
Hi,
U just try this code, I think it will work fine.
AT SELECTION-SCREEN.
VALIDATION FOR Major brand status
IF NOT p_status IS INITIAL.
IF p_status NE 'ALL' AND
p_status NE 'ACT' AND
p_status NE 'INV'.
SET CURSOR FIELD 'P_STATUS'.
MESSAGE e398 WITH
'No Records exist for this Major brand status'(e42).
else.
MESSAGE s398 WITH
'Success Records exist for this Major brand status'(e49).
ENDIF.
ENDIF.
**Reward if this helps
Thanks,
Anil.
04-12-2007 11:04 AM
at selection-screen on p_status
iF P_STATUS NE ' ALL' and
P_STATUS NE 'ACT' and
P_STATUS NE 'INV' .
error message
ENDIF.
04-12-2007 11:05 AM
04-12-2007 11:05 AM
Use the below code
At selection-screen on P_STATUS.
IF P_STATUS NE ' ALL' or
P_STATUS NE 'ACT' or
P_STATUS NE 'INV' .
error message
ENDIF.
04-12-2007 11:06 AM
you have to code
at selection-screen.
IF P_STATUS NE ' ALL' or
P_STATUS NE 'ACT' or
P_STATUS NE 'INV' .
error message
ENDIF.
regards
shiba dutta
Message was edited by:
SHIBA DUTTA
null
04-12-2007 11:06 AM
try this..
IF NOT P_STATUS EQ 'ALL' or
NOT P_STATUS EQ 'ACT' or
NOT P_STATUS EQ 'INV' .
error message
ENDIF.
ENDIF.
Message was edited by:
Chandrasekhar Jagarlamudi
04-12-2007 11:07 AM
hi,
U need to make a small change to your code check below.
IF not P_STATUS IS INITIAL..
IF P_STATUS NE 'ALL' and
P_STATUS NE 'ACT' and
P_STATUS NE 'INV' .
write:/ 'invalid'.
ENDIF.
ENDIF.
regards,
Navneeth.K
Message was edited by:
Navneeth Bothra
Message was edited by:
Navneeth Bothra
04-12-2007 11:07 AM
Hi,
Please use the below code for your validation.
at selection-screen.
Validate Status
if p_status ne 'ALL' and
p_status ne 'ACT' and
p_status ne 'INV' .
Message 'Invalid Status'.
message e000(zz) with 'Invalid Status'.
endif.
thanks,
sksingh
04-12-2007 11:07 AM
hi
i think u should write like
IF P_STATUS IS INITIAL..
IF P_STATUS NE ' ALL' <b>and</b>
P_STATUS NE 'ACT' <b>and</b>
P_STATUS NE 'INV' .
error message
ENDIF.
ENDIF.
regards
gaurav
<b>reward points if useful</b>
04-12-2007 11:08 AM
hi,
Just remove the outer if condition in your code and it should work fine. Or else just make it IF NOT p_status IS INITIAL.
regards,
chaitanya
04-12-2007 11:12 AM
Hi,
at selection-screen on p_status.
if p_status ne 'ALL' and p_status ne 'ACT' and p_status ne 'INV'.
message.
leave list-processing.
endif.
04-12-2007 11:14 AM
IF P_STATUS IS not INITIAL..
IF P_STATUS <> 'ALL' and
P_STATUS <> 'ACT' and
P_STATUS <> 'INV' .
message s000(at) with 'error'.
ENDIF.
ENDIF.
04-12-2007 11:24 AM
Hi Friends,
Here if i put AND operator all the conditions should satisfy, which is not correct.
My case any one among these 3 is valid one.
Reward is sure.
Thanks.
04-12-2007 11:24 AM
Try this out,
at selection-screen on p_status
iF P_STATUS NE ' ALL' and
P_STATUS NE 'ACT' and
P_STATUS NE 'INV' .
message
ENDIF.
04-12-2007 11:28 AM
hi,
Ur initial reqmt was if any other value is given other than those 3 a error should be displayed
so the below code
parameters p_status(3).
IF not P_STATUS IS INITIAL..
IF P_STATUS NE 'ALL' and
P_STATUS NE 'ACT' and
P_STATUS NE 'INV' .
write:/ 'invalid'.
ENDIF.
ENDIF.
should work perfectly. It checks incase the value is not the one of three u wanted.
regards,
Navneeth.K
04-12-2007 11:36 AM
hi,
just replace IF P_STATUS IS INITIAL. with IF P_STATUS IS not INITIAL.
remaing same.
IF P_STATUS IS not INITIAL.
IF P_STATUS NE ' ALL' or
P_STATUS NE 'ACT' or
P_STATUS NE 'INV' .
error message
ENDIF.
ENDIF.
04-12-2007 2:17 PM
Hi,
U just try this code, I think it will work fine.
AT SELECTION-SCREEN.
VALIDATION FOR Major brand status
IF NOT p_status IS INITIAL.
IF p_status NE 'ALL' AND
p_status NE 'ACT' AND
p_status NE 'INV'.
SET CURSOR FIELD 'P_STATUS'.
MESSAGE e398 WITH
'No Records exist for this Major brand status'(e42).
else.
MESSAGE s398 WITH
'Success Records exist for this Major brand status'(e49).
ENDIF.
ENDIF.
**Reward if this helps
Thanks,
Anil.
04-12-2007 2:30 PM