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: 

inner join

Former Member
0 Kudos
87

hi,

can any one tell me where i went wrong..

if not matnr is initial.

wa_matnrrange-sign = 'I'.

wa_matnrrange-option = 'EQ'.

wa_matnrrange-low = MATNR.

APPEND wa_matnrrange to r_matnrrange.

endif.

  • if sales order number is the selection criteria

if not salesorder_no is initial.

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.

  • wa_daterange-high = date_to.

APPEND wa_daterange TO r_daterange.

endif.

select avbeln aauart bposnr cettyp

into table t_vbak

from vbak as a

inner join vbap as b

on avbeln = bvbeln

inner join vbep as c

on bvbeln = cvbeln

where a~vbeln = salesorder_no

and a~erdat in r_daterange

and a~kunnr = partner_number

and b~matnr in r_matnrrange

and b~abgru EQ ' '

and c~etenr = lv_etenr_0001.

there is no syntax error..

here i'm not passing any date,matnr..

there is data in vbak,vbap,vbep against vbeln...but when i debug i dont find any data in t_vbak..

please help me in resolving thhis...

thanks,

Challa.

1 ACCEPTED SOLUTION

former_member583013
Active Contributor
0 Kudos
63

Have you checked if partner_number got a value?

Greetings,

Blag.

5 REPLIES 5

former_member583013
Active Contributor
0 Kudos
64

Have you checked if partner_number got a value?

Greetings,

Blag.

0 Kudos
63

hi,

i gave the partner number too....

0 Kudos
63

What is <b>salesorder_no</b> ? are you passing the value to salesorder_no ?

if so then use leading zero's to salesorder_no ..

if not paste your whole code here

if not matnr is initial.

wa_matnrrange-sign = 'I'.

wa_matnrrange-option = 'EQ'.

wa_matnrrange-low = MATNR.

APPEND wa_matnrrange to r_matnrrange.

endif.

  • if sales order number is the selection criteria

if not salesorder_no is initial.

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.

  • wa_daterange-high = date_to.

APPEND wa_daterange TO r_daterange.

endif.

select avbeln aauart bposnr cettyp

into table t_vbak

from vbak as a

inner join vbap as b

on avbeln = bvbeln

inner join vbep as c

on bvbeln = cvbeln

where a~vbeln = salesorder_no

and a~erdat in r_daterange

and a~kunnr = partner_number

and b~matnr in r_matnrrange

and b~abgru EQ ' '

and c~etenr = lv_etenr_0001.

Thanks

Seshu

Former Member
0 Kudos
63

Hi

I am sure that data is not there in one of the parameter which you are passing in where condition.

Keep a break point on the select and check whether values are correctly coming into the parameters like daterange, materialrange and salesorder no which you are passing in the where condition. Sales order is Select-options or parameter if it is SO give IN in where condition.

if not matnr is initial.

wa_matnrrange-sign = 'I'.

wa_matnrrange-option = 'EQ'.

wa_matnrrange-low = MATNR.

APPEND wa_matnrrange to r_matnrrange.

endif.

  • if sales order number is the selection criteria

if not salesorder_no is initial.

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.

  • wa_daterange-high = date_to.

APPEND wa_daterange TO r_daterange.

endif.

select avbeln aauart bposnr cettyp

into table t_vbak

from vbak as a

inner join vbap as b

on avbeln = bvbeln

inner join vbep as c

on bvbeln = cvbeln and bposnr = cposnr

where a~vbeln in salesorder_no

and a~erdat in r_daterange

and a~kunnr = partner_number

and b~matnr in r_matnrrange

and b~abgru EQ ' '

and c~etenr = lv_etenr_0001.

Regards

Anji

0 Kudos
63

Hi,

My SO number is 1020015701,

Patner number is A00202120.

i'm not passing any date or material number.

I have already pasted the whoe code..

Thanks,

Challa.