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

inner join prb

Former Member
0 Likes
887

hi

plz rectify the error,

there is some prob with my inner join select stmt which i am unable to identify

here is the code.

tables: lfa1, ekko,

select-options: vend for lfa1-lifnr.

data: begin of itab occurs 0,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

land1 like lfa1-land1,

ebeln like ekko-ebeln,

end of itab.

select lfa1lifnr lfa1name1 lfa1land1 ekkoebeln into table itab from lfa1 inner join ekko on lfa1lifnr = ekkolifnr where lfa1~lifnr in vend.

loop at itab.

write: itab.

endloop.

i am not getting the required output.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
862

Your SELECT is working fine for me, the only thing I changed was your WRITE statement. Works good.

loop at itab.
  write:/ itab-lifnr, itab-name1, itab-land1, itab-ebeln.
endloop.

Regards,

Rich Heilman

6 REPLIES 6
Read only

Former Member
0 Likes
862

Hi!

What is exactly the output, your program provides?

You might try out the "INTO CORRESPONDING FIELDS OF TABLE itab" statement also...

Regards

Tamá

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
863

Your SELECT is working fine for me, the only thing I changed was your WRITE statement. Works good.

loop at itab.
  write:/ itab-lifnr, itab-name1, itab-land1, itab-ebeln.
endloop.

Regards,

Rich Heilman

Read only

0 Likes
862

hi,

thank you,

but still it is not working , when i pass the values in selection screen and execute.

it is just stoping there it self.

( mine is IDES SYSTEM , can that be the reason)

Read only

0 Likes
862

Well, then I would say that you do not have any POs in that system for the particular vendor numbers that you may be entering into the selection-screen. You can create some POs via ME21N(of course the master data must all be there as well)

Regards,

Rich Heilman

Read only

0 Likes
862

Hi!

Are there any entries in the LFA1 or EKKO tables? Check it out in SE16 transaction.

Regards

Tamá

Read only

Former Member
0 Likes
862

Hi,

I check your code..It is bringing the Pos for the corresponding input..If it is a display you should WRITE: / instead of WRITE: ..Marked in bold..

TABLES: lfa1, ekko.

SELECT-OPTIONS: vend FOR lfa1-lifnr.

DATA: BEGIN OF itab OCCURS 0,

lifnr LIKE lfa1-lifnr,

name1 LIKE lfa1-name1,

land1 LIKE lfa1-land1,

ebeln LIKE ekko-ebeln,

END OF itab.

SELECT lfa1lifnr lfa1name1

lfa1land1 ekkoebeln

INTO TABLE itab

FROM lfa1 INNER JOIN ekko ON lfa1lifnr = ekkolifnr

WHERE lfa1~lifnr IN vend.

LOOP AT itab.

<b> WRITE:/ itab.</b>

ENDLOOP.

Thanks,

Naren