2006 Jul 19 9:51 AM
Hi folks.
can you please tell me how to do a select-option field leveln validation, i know how to do incase the filed is defined as parameter. here my field is defined as select-option.
SELECT-OPTIONS: C_CTLPC FOR KNKK-CTLPC.
here i need to check for both low, high intervals?
please help me, thanks in advance.
regards
priya
Hi folks.
can you please tell me how to do a select-option field leveln validation, i know how to do incase the filed is defined as parameter. here my field is defined as select-option.
SELECT-OPTIONS: C_CTLPC FOR KNKK-CTLPC.
here i need to check for both low, high intervals?
please help me, thanks in advance.
regards
priya
2006 Jul 19 9:52 AM
Hi priya,
1. one way is u can do like this
If c_ctlpc-low = 'xyz'.
If c_ctlpc-high = 'xyz'.
regards,
amit m.
2006 Jul 19 9:56 AM
hi,
try this..
at selection-screen on fld_name.
if fld_name-low is initial.
message.
endif.
if fld_name-high is initial.
message.
endif.
reward if useful..
regards,
Madan..
2006 Jul 19 10:00 AM
Hi..
Thanks for your reply , my req is
select-options C_CTLPC FOR KNKK-CTLPC.
here the field may contain values from '01' to '11'.
but incase the user mistaken passed the vlues '1' to '11'
in this case report displaying the wrong data,
so i need to validate that filed should contatin '01' not '1'.
so plese tell me more clearly.
regards.
priya
2006 Jul 19 10:02 AM
Hi again,
1. so i need to validate that filed should contatin '01' not '1'
U can validate like this.
2. Data : myval like knkk-ctlpc.
myval = '01'.
if myval in c_ctlpc.
else.
*----- code for error message
endif.
regards,
amit m.
2006 Jul 19 10:03 AM
u can try like this
length = strlen( c_ctlpc-low ).
if length Ne 2.
error meassage.
endif.Message was edited by: Chandrasekhar Jagarlamudi
2006 Jul 19 10:06 AM
for select-options,
VALIDATIONS :
IF C_CTLPC[] IS NOT INITIAL.
*--Validations,only if select-options is NOT initial.
SELECT CTLPC
INTO V_CTLPC
FROM KNKK
UP T0 1 ROWS
WHERE CTLPC IN C_CTLPC.
IF SY-SUBRC <> 0.
*--No valid value given by user for this field,display err
MESSAGE E000 WITH 'Invalid CTLPC values'.
ENDIF.
ENDIF.
here the intention is, to check whether user entered atleast 1 valid value for that field or not, if we found atleast 1 valid entry,we can proceed further, else we will display error message,
check this.
2006 Jul 19 10:09 AM
Hi Priya,
Best option is use CONVERSION_EXIT_ALPHA_INPUT,
this will convert 1 to 01
select-options C_CTLPC FOR KNKK-CTLPC.
INITIALIZATION.
loop at c_ctlpc.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = C_CTLPC-LOW
IMPORTING
OUTPUT = C_CTLPC-LOW.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = C_CTLPC-HIGH
IMPORTING
OUTPUT = C_CTLPC-HIGH.
modify c_ctlpc index sy-tabix.
clear c_ctlpc.
endloop.
2006 Jul 19 9:57 AM
Hi Priya,
Select option is an internal table of four fields-
SIGN
OPTION
LOW
HIGH
So u can use these fields as C_CTLPC-LOW and C_CTLPC-HIGH using at selection screen event...
At selection-screen on C_CTLPC-low.
and do the validation. U can see these fields even in debugging mode.
Hope this helps u.
Regards,
Seema.
2006 Jul 19 9:57 AM
Hi Priya,
At selection-screen on C_CTLPC-low.
if not C_CTLPC-LOW is initial.
select singl * from KNKK where CTLPC = C_CTLPC -LOW.
if sy-subrc NE 0.
Error Message.
endif.
At selection-screen on C_CTLPC-HIGH.
if not C_CTLPC-HIGH is initial.
select singl * from T691A where CTLPC = C_CTLPC -HIGH.
if sy-subrc NE 0.
Error Message.
endif.
If useful reward.
Vasanth
2006 Jul 19 9:59 AM
Hello,
you can do like this
AT SELECTION-SCREEN on c_CTLPC.
IF c_Ctplc-Low
Conditions
endif.
IF C_ctplc-high.
coniditons
endif.
Reward if helps.
Thanks,
krishna
2006 Jul 19 10:00 AM
Hi
you can validate it as follows for for the whole range of values.
AT SELECTION-SCREEN ON C_CTLPC.
SELECT CTLPC FROM (VALUE TABLE OF CTLPC)
WHERE CTLPC IN C_CTLPC.
IF SY-SUBRC NE 0.
MESSAGE.
ENDIF.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |