‎2008 Mar 28 4:25 PM
Hi Friends ,
I have the following SELECT to get data from a ztable . I checked the table for the same criteria and there is data . Any idea why it is returning with SY-SUBRC = 4 ?
S_DISP and S_DISP1 are the 2 diff selection criteria on the same selection screen .
I also checked there is data in T_NORMT with plan plate .
Thanks for all your help !
Teresa.
Loop at t_normt.
SELECT WERKS
MATNR
BUILDING_I
NORMT
DISPO
z1
z2
FROM ztable
INTO TABLE itab
WHERE ZWERKS = P_PWWRK
AND NORMT = T_NORMT-NORMT
AND BUILDING_I = P_BLDGI
AND DISPO IN S_DISP
AND DISPO IN S_DISP1.
endloop.
‎2008 Mar 28 4:33 PM
hi,
AND DISPO IN S_DISP
AND DISPO IN S_DISP1.
change it to:
AND DISPO IN S_DISP
OR DISPO IN S_DISP1.
hope this helps
ec
‎2008 Mar 28 4:31 PM
use select single * or select upto 1 row inside the loop end loop
‎2008 Mar 28 4:31 PM
in your where statement you are checking 1 field with 2 different select options (DISPO). Just put both selections in the same select option. (or perhaps you meant to check 2 different fields
‎2008 Mar 28 4:33 PM
hi,
AND DISPO IN S_DISP
AND DISPO IN S_DISP1.
change it to:
AND DISPO IN S_DISP
OR DISPO IN S_DISP1.
hope this helps
ec
‎2008 Mar 28 4:49 PM
Hi Eric ,
Though I am checking for the same field DISPO . I need to check against 2 different selections S_DISP1 and S_DISP on the selection screen . How do I combine them ?
Thanks
‎2008 Mar 28 4:33 PM
Try to test the select statement before looping. Also, check by testing where condition in your select statement individually.
Thanks,
siddu
‎2008 Mar 28 5:03 PM
Hi,
The problem is with the select statement.
Because you are comparing the field dispo with s_disp and s_disp1, the condition gets false eventhough the data exists in the table. Because you are using AND the dispo value at the same time cannot hold two values from two fields i.e. at a any particular instance the dispo field should contain both the values from s_disp and s_disp1 if you use AND.
If you use OR then you will get both the records.
Remember that for AND both the s_disp and s_disp1 must have same values to satisfy condition.
For OR either s_disp or s_disp1 can have values.
Inorder to get single record using or, use select single stmt.
<REMOVED BY MODERATOR>
Thanks and Regards.
Edited by: Ammavajjala Narayana on Mar 28, 2008 6:03 PM
Edited by: Ammavajjala Narayana on Mar 28, 2008 6:05 PM
Edited by: Alvaro Tejada Galindo on Mar 28, 2008 6:16 PM
‎2008 Mar 28 5:42 PM
hi,
use multiple select option, it may solve u'r problem.
there is extension box , use that to give u'r two selection ctiteria's
don't use wo select options
regards,
chandu