‎2007 Apr 26 6:18 AM
hi friends, can any body tell me when ever the selection criteria in where clause is zero can i get data from database. pls following code
SELECT SINGLE * FROM zproto_jobs
INTO CORRESPONDING FIELDS OF itab_bills
WHERE requestno = itab_bills-requestno AND
requestyear = itab_bills-requestyear.
here request no is a zero and also itab_bills-requestno is a zero. but there is some value for itab_bills-requestyear. can i get data from database.
its urgent pls.
kumar.
‎2007 Apr 26 6:24 AM
u have to code like this
if itab1 is not initial.
select * from mara into corresponding fields of itab2
for all entries in itab1
where matnr = itab1-matnr.
endif.
<b>ur code is complete wrong.
here u are fetching the data from table into itab_bills at the same time u are using in where clause , which is wrong.
SELECT SINGLE * FROM zproto_jobs
INTO CORRESPONDING FIELDS OF itab_bills
WHERE requestno = itab_bills-requestno
AND requestyear = itab_bills-requestyear.</b>
Regards
Prabhu
‎2007 Apr 26 6:30 AM
WRITE A IF CONDITION N SPECIFY IF < ITAB> NOT INITIAL IT HELPS U..
INITIAL CHECKS FOR BLANKS.. IF IT IS NOT BLANK IT GETS OTHER DATA ALSO.. IN UR QUES U HAVE VALUE 0 SO THIS SOLVES UR PROBLEM...
‎2007 Apr 26 6:45 AM
Hi,
You can get the data.
In itab_bills internal table just unpack the requestno and pass it to the select statement.
‎2007 Apr 26 7:02 AM
Hi Kumar,
I am absoltely agree with Prabhu. Your selecting the data from data base table into itab_bills and u mentioned in where cluase that internal table, which is controdution.
Reply for quiereis, shall post the updates.
Regards,
KUmar.