Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

problem is select/inner join

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

former_member195698
Active Contributor
0 Kudos

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

3 REPLIES 3

former_member195698
Active Contributor
0 Kudos

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

Rodrigo-Giner
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Challa - what's the period doing after DELIVERY_NO?

Rob