Skip to Content
author's profile photo Former Member
Former Member

Inner Join

Hi gurus,

I have a condition where I need to use Inner join to join three of the tables, (ekko,ekpo and Eket)

I need to select PO number, item no, matnr, and Price based on the following condition:

Ekko-bsart-> 'NB',

Ekko-ekgrp-> 234

Ekpo-elikz-> ' '

ekpo-afnam-> 'z'

and

Eket-eindt-> '10/10/2007'

can you please help me out.....

Thanks

Rajeev

Message was edited by:

Rajeev Gupta

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2007 at 12:07 AM

    It is not a good idea to join these 3 tables specially when you do not have primary keys to pass in WHERE Condition.

    I suggest you first get data from EKPO - you can use standard index "A" while extracting data. You need to pass AFNAM and BSTYP in WHERE Condition. I believe you are populating PO data so BSTYP should be equal to "F". Get data into internal table IT_EKPO. Filter this based upon condition ELIKZ = space.

    Then use IT_EKPO to get data from EKKO, get data into IT_EKKO, filter this based upon

    Ekko-bsart-> 'NB',

    Ekko-ekgrp-> 234

    Then get data from EKET for all entries in IT_EKPO.

    At the end you can combine these 3 tables.

    Using JOIN in such case will increase runtime and program will be slow.

    Hope this helps.

    ashish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2007 at 12:07 AM

    Hi Rajeev,

    Can you paste your code. Will modify it if something wrong.

    Regards,

    Atish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2007 at 01:30 AM

    Hi,Rajeev.

    EKKO,EKPO and EKET are Purchase Orders Tables,I found the relationship between them.

    EKPO(Purchasing Document Item) includes Purchasing Doc(EBELN),Item(EBELP).

    EKKO(Purchasing Document Header) includes Purchasing Doc(EBELN).

    EKET(Delivery Schedules) includes Purchasing Doc(EBELN),Item(EBELP),Delivery Schedule(ETENR).

    You can inner join three tables based this relationship.And I think it's no need to join three tables,because EKPOEBELN is PO number, EKPOEBELP is item no,EKPOZZITEM1 is matnr,and EKPONETPR is Price.Am I right?If there is something wrong,please reply me.

    Regards,

    feng.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.