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

how to sepearte five or more table joins into different select statement to retrieve same data.

I have these tables VBUK, VBAP, VBUP, LIPS, LIKP that I used to retrieve data from tables in a report program.

I have to avoid join condition in order to improve performance.

The join condition in select statement is below.

select LIKP~VBELN LIKP~LFART LIKP~ERDAT LIKP~ERZET LIKP~ERNAM LIKP~VKORG LIKP~KUNAG LIKP~KUNNR LIKP~VSTEL LIKP~WADAT_IST
LIKP~WADAT LIPS~VTWEG LIPS~SPART LIPS~POSNR LIPS~PSTYV LIPS~MATNR LIPS~MATWA LIPS~WERKS LIPS~LFIMG LIPS~VRKME LIPS~LGORT
LIPS~CHARG LIPS~SHKZG LIPS~VGBEL LIPS~VGPOS LIPS~VBELN VBUP~WBSTA VBUP~KOSTA VBUP~VBELN VBUP~POSNR VBAP~ERDAT VBAP~VBELN
VBAP~POSNR VBAP~NETPR VBAP~WAERK VBAP~KZWI1 VBAP~VRKME VBAP~KMEIN VBAP~KWMENG VBAP~KZWI3 VBUK~CMGST VBUK~VBELN
into CORRESPONDING FIELDS OF TABLE itab3
from ( LIKP
inner join LIPS
on LIPS~VBELN = LIKP~VBELN
inner join VBUP
on VBUP~VBELN = LIPS~VBELN
and VBUP~POSNR = LIPS~POSNR
inner join VBAP
on VBAP~VBELN = LIPS~VGBEL
and VBAP~POSNR = LIPS~VGPOS
inner join VBUK
on VBUK~VBELN = LIKP~VBELN )
where LIKP~ERDAT in StDate
and LIKP~VKORG = SaleOrg
AND LIPS~WERKS = Plant1 .

How I can effectively split this code to retrieve same data.

Thank You.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 28, 2013 at 11:57 AM

    Hi Mr. Toby tom,

    I would suggest, please avoid the selects ( either inner join or for all entries )! better to use the below FM!

    FM BAPI_DELIVERY_GETLIST : You can pass the select parameters like below)

    Pass the Parameters ( ERDAT , VKORG, WERKS)

    it will return the parameters : read the documentation


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 27, 2013 at 07:51 PM

    Hi,

    You should do your first SELECT to LIKP joined to LIPS. Then you can SELECT the other tables using FOR ALL ENTRIES with the result of the first SELECT.

    Martin

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 28, 2013 at 03:59 AM

    Toby

    Joon are anydau better than for all entries. Please search scn for the same. Secondly how did you know this is the select statement where issue is?

    Nabheet

    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.