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

FOR ALL ENTRIES IN with two tables

Hi Guy's,

I have two int. tables, gt_likp, gt_lips.

I need to use "FOR ALL ENTRIES IN" with this two tables.

SELECT matnr

vkorg

vtweg

ypcogsl

FROM mvke

INTO TABLE gt_mvke

<b> "FOR ALL ENTRIES IN gt_likp gt_lips"</b>

WHERE matnr = gwa_liefpos_tab-matnr

AND vkorg = gt_likp-vkorg

AND vtweg = gt_lips-vtweg.

How to do this?

Please Help.

Thanks in Advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on May 02, 2007 at 12:52 PM

    HI,

    if gt_likp[] is not initial.

    select <your fields>

    into table gt_lips

    from lips

    for all entries in gt_likp

    where matnr = gt_likp-matnr

    AND vkorg = gt_likp-vkorg

    AND vtweg = gt_lips-vtweg.

    if sy-subrc = 0.

    sort gt_lips by matnr vkorg..

    endif.

    endif.

    rewards if useful

    regards,

    nazeer

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 02, 2007 at 12:51 PM

    OK

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2008 at 09:20 PM

    I hope so, some common key between gt_likp and gt_lips table. Based on that common key, you have to merge these two table into new internal table say gt_lips_likp.

    or when you are selecting the data from likp and lips , that time you can use join statment with common primary key and fill the new internal table say gt_lips_likp.

    Then you can use for all entries statment.

    I hpoe this would be helpful for you.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2008 at 08:00 AM

    Hi,

    Fill gt_likp-vkorg values in a range(r_vkorg). Use gt_lips in FOR ALL ENTRIES.

    Basically you can use only 1 internal table with FOR ALL ENTRIES statement.

    SELECT matnr

    vkorg

    vtweg

    ypcogsl

    FROM mvke

    INTO TABLE gt_mvke

    FOR ALL ENTRIES IN gt_lips

    WHERE matnr = gwa_liefpos_tab-matnr

    AND vkorg in r_vkorg

    AND vtweg = gt_lips-vtweg.

    - SRao

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2008 at 11:40 AM

    Hi,

    Define an internal table IT_TAB having fields matnr, vkorg and vtweg.

    Get the values for these fileds into IT_TAB from both the internal tables by using LOOP and say FOR ALL ENTRIES IN IT_TAB.

    Since u need to filter the data on the basis of these three fields, there is no point in keeping other fileds in third internal table.

    Hope this will helpful...Points are welcome

    Ashish

    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.