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

for all entires with join

experts, help needed

itab has following fields,

vbeln erdat erzet vkorg vtweg

kunnr posnr matnr bmeng.

i have written like this

if itab is not initial.

SELECT avbeln aerdat aerzet avkorg a~vtweg

akunnr bposnr b~matnr

FROM vbak AS a INNER JOIN vbap AS b

ON avbeln = bvbeln

INTO TABLE itab1

FOR ALL ENTRIES IN itab

WHERE a~vbeln = itab-vbeln.

endif.

i need to fetch confirm quantity from vbep ie bmeng filed for the items in vbap into table itab1.

so do i need to add this as well in the above join or seperately i need to select it after the above select query.

pls suggest the modifications in the above select query accordingly.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Aug 17, 2009 at 05:48 AM

    Hi,

    You can include it within the same join statement itself like

    
    if itab is not initial.
    SELECT a~vbeln a~erdat a~erzet a~vkorg a~vtweg
    a~kunnr b~posnr b~matnr c~bmeng
    FROM vbak AS a INNER JOIN vbap AS b
    ON a~vbeln = b~vbeln
    INNER JOIN vbep as c 
    ON a~vbeln = c~vbeln
    INTO CORRESPONDING FIELDS OF TABLE itab1
    FOR ALL ENTRIES IN itab
    WHERE a~vbeln = itab-vbeln.
    endif.
    
    

    Regards,

    Vik

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 17, 2009 at 05:53 AM

    Hi,

    By keeping the below statement as it is, and would like to add sepately for VBEP, then again after fetching the data from VBEP, again looping on ITAB1, you need to modify the Quantity field. It becomes poor in performance.

    So you can do as below.

    1. Either add even the field in the below SELECT statement only for VBEP too.

    2. If the number of entries are more in VBEP, then it is suggested to select only from VBAK into table ITAB, then using for all entries go for VBAP and then VBEP and looping on ITAB again, on the internal table using the READ commands, build the final internal table.

    Regards,

    Santhosh.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 17, 2009 at 06:20 AM

    if itab is not initial.

    SELECT avbeln aerdat aerzet avkorg a~vtweg

    akunnr bposnr bmatnr cbmeng

    FROM ( ( vbak AS a INNER JOIN vbap AS b ON avbeln = bvbeln )

    INNER JOIN vbep AS c ON bvbeln = cvbeln )

    INTO CORRESPONDING FIELDS OF TABLE itab1

    for all entries in itab

    WHERE a~vbeln = itab-vbeln.

    endif.

    Thanks,

    Gaurav

    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.