‎2007 Apr 18 1:19 PM
as i am using single in this statement it is fetching only one record but in select options only low value is taking into consideration not high value what i need to do for high value .
IF NOT s_route IS INITIAL.
SELECT SINGLE route FROM tvro
INTO tvro-route
WHERE route IN s_route.
IF sy-subrc NE 0.
MESSAGE e001(8i) WITH text-009.
ENDIF.
ENDIF.
‎2007 Apr 18 1:22 PM
That is not considering low value...
That will check with the BETWEEN LOW and HIGH values condition and selects any value which comes first....
Also we will use SELECT SINGLE ... in Select-opitons in order to validate the data. I mean just to check whether there are any records for that selection- or not. So the functionality is correct in that case.
‎2007 Apr 18 1:23 PM
IF NOT s_route IS INITIAL.
SELECT <b>SINGLE(remove)</b> route FROM tvro
INTO tvro-route
WHERE route IN s_route.
IF sy-subrc NE 0.
MESSAGE e001(8i) WITH text-009.
ENDIF.
ENDIF.
Regards
prabhu
‎2007 Apr 18 1:23 PM
Hi,
The logic is even if you find atleast one record btw the values entered by the user in low and high the user can view the report or can proceed.
if you want explicit check of each value in low and high then u need to write two selects
at selection-screen on s_route-low.
select single from ...where route = s_route-low.
at selection-screen on s_route-high.
select single from ...where route = s_route-high.
‎2007 Apr 18 1:23 PM
hi,
in this case its better not to use select single , select all records base on the condition.
regards,
Navneeth.K
‎2007 Apr 18 1:23 PM
hi
IF NOT s_route IS INITIAL.
SELECT SINGLE route FROM tvro
INTO table tvro-route
WHERE route IN s_route.
ENDIF.
praveen
‎2007 Apr 18 1:24 PM
Hi
U need to store the data in an internal table:
IF NOT s_route IS INITIAL.
DATA: T_ROUTE LIKE TVRO-ROUTE OCCURS 0.
SELECT route FROM tvro
INTO TABLE T_ROUTE
WHERE route IN s_route.
IF sy-subrc NE 0.
MESSAGE e001(8i) WITH text-009.
ENDIF.
Max
‎2007 Apr 18 1:29 PM
Hai,
Jusy a small change is needed in your coded.
See the High lighted one.
IF NOT s_route IS INITIAL.
SELECT SINGLE route FROM tvro
<b>INTO corresponding fields of tvro</b>
WHERE route IN s_route.
IF sy-subrc NE 0.
Hope the problem is solved.
<b>Reward points if it helps you.</b>
Regds,
Rama chary.Pammi
‎2007 Apr 18 1:34 PM
Hi,
You can use two select single statements. One or High and other for low value.
Eg.
DATA : v_route type tvro-route,
v_route1 type tvro-route.
IF NOT s_route IS INITIAL.
SELECT SINGLE route FROM tvro
INTO v_route
WHERE route EQ s_route-low.
if sy-subrc = 0.
SELECT SINGLE route FROM tvro
INTO v_route1
WHERE route EQ s_route-high.
IF sy-subrc NE 0.
MESSAGE e001(8i) WITH text-009.
ENDIF.
endif.
ENDIF.
Rewards Point if helpful
Sourabh