Application Development and Automation 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: 
Read only

help in join

Former Member
0 Likes
412

hi,

i do this join and i wont to add

and pa0040~subty <> '20' or '80' or '100'

how i can do it right because when i move the asterisk i have error.

Regards

SELECT pa0040~pernr pa0040~lobnr t591s~stext
   FROM ( pa0040
   INNER JOIN t591s
     ON pa0040~subty = t591s~subty
*     and pa0040~subty  <> '20' or '80' or '100'
     AND t591s~infty = '0070'
     AND t591s~sprsl = 'B' )
     INTO CORRESPONDING FIELDS OF TABLE it_p40
    WHERE pernr = per
     AND pa0040~begda LE to
     AND pa0040~endda GE to.

1 ACCEPTED SOLUTION
Read only

vinod_vemuru2
Active Contributor
0 Likes
380

Hi Ricardo,

Modify ur code like this.

SELECT pa0040pernr pa0040lobnr t591s~stext

FROM ( pa0040

INNER JOIN t591s

ON pa0040subty = t591ssubty

INTO CORRESPONDING FIELDS OF TABLE it_p40

WHERE pernr = per

AND pa0040~begda LE to

AND pa0040~endda GE to,

and pa0040~subty IN ('20', '80', '100')

AND t591s~infty = '0070'

AND t591s~sprsl = 'B' ).

put ur where clause fields in the proper order(As they appear in the data base table or in the INDEX)

Thanks,

Vinod.

Edited by: Vinod Kumar Vemuru on Mar 16, 2008 5:50 PM

2 REPLIES 2
Read only

Former Member
0 Likes
380

SELECT pa0040-pernr pa0040-lobnr t591s-stext

FROM pa0040 INNER JOIN t591s

ON pa0040-subty = t591s-subty

INTO CORRESPONDING FIELDS OF TABLE it_p40

WHERE pernr = per AND pa0040~begda LE to

AND pa0040-endda GE to AND pa0040-subty EQ '20'

OR pa0040-subty EQ '80' OR pa0040-subty EQ '100'

AND t591s-infty = '0070' AND t591s-sprsl = 'B' .

I think this may work fine.

If u have any error reply me

Read only

vinod_vemuru2
Active Contributor
0 Likes
381

Hi Ricardo,

Modify ur code like this.

SELECT pa0040pernr pa0040lobnr t591s~stext

FROM ( pa0040

INNER JOIN t591s

ON pa0040subty = t591ssubty

INTO CORRESPONDING FIELDS OF TABLE it_p40

WHERE pernr = per

AND pa0040~begda LE to

AND pa0040~endda GE to,

and pa0040~subty IN ('20', '80', '100')

AND t591s~infty = '0070'

AND t591s~sprsl = 'B' ).

put ur where clause fields in the proper order(As they appear in the data base table or in the INDEX)

Thanks,

Vinod.

Edited by: Vinod Kumar Vemuru on Mar 16, 2008 5:50 PM