on 04-13-2006 4:16 PM
Hi,
I have a selection screen ..select option : Company Code.
I need to do this validation for the range . If the user enters values on the screen and also using the puchbutton, I need to check against this table for all the ranges entered in the selection table. However this code is not working for this. What else i need to add to make sure that it checks all the ranges entered.?
when i debug the value for the S_c_code changes and fetches the next range in the table but it doesnt change the value for sy-subrc , even if the range is invalid !!
SELECT SINGLE * FROM ZMAXCODE INTO ZMAXCODE
WHERE MX_COMP_CODE IN S_C_CODE.
IF SY-SUBRC <> 0.
MESSAGE E008.
ENDIF.
Thanks
Hi ABAP..:P,
Validating a select option is meaningless to say the least. Because even if both the values on LOW and HIGH are invalid, there might be valid values in between them.
For example 0 may be an invalid comp code, 1000 may be an in valid comp code, but there may be 100 valid companies in betwen the range you have mentioned.
If you have single values to be validated, one value may be valid, and the other invalid, the select will be succesful no matter 9 out of 10 single values are invalid.
Hence convince your Lead that its a waste of time to validate a select option.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i dont know what exartly the requriement is
you can do one thing in the selection screen for S_C_CODE remove the extension button then user can only enter the ranges then u only have the option of LOW & HIGH of that particular field.Then u can loop and u can validate for each and every value.
Thanks
Vikranth Khimavath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think this will not work.
For example if user enters 1 to 10 range.if all the condition fails then you will not get any output.if any of the above condition is valid then u will get the report output.
or loop the select-option table.
Thanks
Vikranth Khimavath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Have you looked this FM <b>SELECT_OPTIONS_RESTRICT</b>?
Please check the function module documentation.
Hope it will help.
Regards,
Ferry Lianto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could loop at the select options table and for each entry:
refresh a range table.
put the single entry of the select option into the range table.
use the range table in the validation.
Rob
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this way...
SELECT * up tp 1 rows FROM ZMAXCODE INTO ZMAXCODE
WHERE MX_COMP_CODE IN S_C_CODE.
endselect.
IF SY-SUBRC <> 0.
MESSAGE E008.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
SELECT SINGLE * FROM ZMAXCODE INTO ZMAXCODE
WHERE MX_COMP_CODE IN S_C_CODE.
IF SY-SUBRC <> 0.
MESSAGE E008.
ENDIF
generally it will check the conditions which you give in selection screen. check any data that falls in that mentioned Range that might be the reason it is giving sy-subrc = 0.
Regards
vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.