2007 Sep 05 12:00 PM
Hi Experts,
for the following code,
SELECT-OPTIONS : I_VBELN FOR VBAK-VBELN DEFAULT 4563 TO 4965.
at run time, the low and high value range input boxes should accept only numeric values not any other values. How can I restrict that?.
Waiting for your kind reply.
Thanks in advance.
Hi Experts,
for the following code,
SELECT-OPTIONS : I_VBELN FOR VBAK-VBELN DEFAULT 4563 TO 4965.
at run time, the low and high value range input boxes should accept only numeric values not any other values. How can I restrict that?.
Waiting for your kind reply.
Thanks in advance.
2007 Sep 05 12:03 PM
2007 Sep 05 12:05 PM
2007 Sep 05 12:12 PM
Hi,
Could you please let us know what is exact scenario.
If you want to validate for numeric values only, if can use CA for pattern checking.
Use the code provided by others.
Thanks,
Sriram Ponna.
2007 Sep 05 12:14 PM
Do the validation like this -
SELECT VBELN up to 1 rows
from VBAK
into table t_tmp
where VBLEN in S_VBELN
if sy-subrc ne 0.
message s000(oo) with 'Invalid Sales Ord no'.
LEAVE LIST-PROCESSING.
endif.If you want to do it at input level , then u ll have to shift to PARAMETERS instead of select-options. because in SELECT-OPTIONS u have the option of Wild card seraching.
if u use parameter then <b>VALUE CHECK</b> statement will do the trick for you. For select-options I guess u cant achieve it.
2007 Sep 05 12:16 PM
2007 Sep 05 12:05 PM
Hi,
In the At SELCETION SCREEN event.
IF not I_VBELN -LOW CA '0123456789'.
" Raise the error message
ENDIF.
IF not I_VBELN -HIGH CA '0123456789'.
" Raise the error message
ENDIF.Regards
Sudheer
2007 Sep 05 12:10 PM
2007 Sep 05 12:06 PM
Use CA operator as in
if i_vbeln-low CA 'abcdefghijklmnopqrstuvwxyz'.
...Display here your error message...
endif.
or
if i_vbeln-low CN '1234567890'.
...Display here your error message...
endif.
Test also the i_vbeln-high.
But in case they entered a multiple single values that cannot be validate using high and low, you should use loop to validate each.
2007 Sep 05 12:08 PM
ya you can do validation for VBAK-VBELN
select-options: s_vbeln for vbak-vbeln.
In main program add
AT SELECTION-SCREEN ON s_vbeln.
PERFORM sub_valid_vbeln.
FORM sub_valid_vbeln.
DATA lv_vbeln TYPE vbuk-vbeln.
Validation for company Code
IF s_vbeln-low IS INITIAL.
IF NOT s_vbeln-high IS INITIAL.
MESSAGE w001. "low should be added
ENDIF.
ELSE.
SELECT SINGLE vbeln FROM vbuk INTO lv_vbeln
WHERE vbeln = s_vbeln-low.
IF sy-subrc NE 0.
MESSAGE e007 WITH s_vbeln-low. " Invalid value
ENDIF.
ENDIF.
IF NOT s_vbeln-high IS INITIAL.
SELECT SINGLE vbeln FROM vbuk INTO lv_vbeln
WHERE vbeln = s_vbeln-high.
IF sy-subrc NE 0.
MESSAGE e007 WITH s_vbeln-high. " Invalid value
ENDIF.
ENDIF.
ENDFORM.
Rewards if useful....
2007 Sep 05 12:14 PM
Hi Minal,
Your code is working at validation level, but i need at entry or input level.
2007 Sep 05 12:17 PM
Hi,
Copy paste this code .. you will understand.
<b>parameter : I_VBELN(20) type c.
data : l_len type i,
l_count type i.
initialization .
clear l_count.
At selection-screen on I_VBeLN.
l_len = STRLEN( I_VBELN ).
Do l_len times.
If I_VBELN+l_count(1) CA sy-abcde.
Message 'error' type 'E'.
endif.
l_count = l_count + 1.
enddo.
start-of-selection.
write I_VBELN.</b>
rewards if useful.
regards,
nazeer
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |