10-29-2007 4:59 PM
Hi,
I have defined ranges table...
if ( not date_from is initial and not date_to is initial ).
wa_daterange-sign = 'I'.
wa_daterange-option = 'BT'.
wa_daterange-low = date_from.
wa_daterange-high = date_to.
APPEND wa_daterange TO r_daterange.
elseif ( not date_from is initial and date_to is initial ).
wa_daterange-sign = 'I'.
wa_daterange-option = 'EQ'.
wa_daterange-low = date_from.
APPEND wa_daterange TO r_daterange.
endif.
My select statement is
select avbeln bposnr
into table t_likp
from likp as a
inner join lips as b
on avbeln = bvbeln
where a~vbeln = DELIVERY_NO.
and a~erdat in r_daterange
and a~kunag = PARTNER_NUMBER
and b~matnr in r_matnrrange.
in the debug mode, when i see table t_likp,it is initial..but there are values for the delivery number,vendor,and date....
any one please correct me where i went wrong...
Thanks,
Challa.
10-29-2007 5:38 PM
The query seems to be correct.
what you can do is, goto LIKP and select any entry.
Get the VBELN, KUNAG and the ERDAT.
Also check that for the selected VBELN, corresponding entry exists in the table LIPS.
Then pass the same information to your program.
If the data is coming in the internal table, then the query is fine.
One more thing you can check is the Dealer Number might not be appended with Zero's in the start.
You can use the CONVERSION ROUTINE To convert the dealer number and then you can check the query.
Regards
Abhishek
10-29-2007 5:38 PM
The query seems to be correct.
what you can do is, goto LIKP and select any entry.
Get the VBELN, KUNAG and the ERDAT.
Also check that for the selected VBELN, corresponding entry exists in the table LIPS.
Then pass the same information to your program.
If the data is coming in the internal table, then the query is fine.
One more thing you can check is the Dealer Number might not be appended with Zero's in the start.
You can use the CONVERSION ROUTINE To convert the dealer number and then you can check the query.
Regards
Abhishek
10-29-2007 6:59 PM
The problem is that if you use a "IN" in the where clause. You should do the same with the rest of the fields.
Pass the values of this variables just like u did
PARTNER_NUMBER
DELIVERY_NO
wa_daterange-sign = 'I'.
wa_daterange-option = 'EQ'.
wa_daterange-low = date_from.
APPEND wa_daterange TO r_daterange.
The select should be:
select a~vbeln
b~posnr
into table t_likp
from likp as a inner join lips as b on avbeln = bvbeln
where a~vbeln IN s_delivery
and a~erdat IN r_daterange
and a~kunag IN s_partner
and b~matnr IN r_matnrrange.
10-29-2007 7:03 PM