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

When we will use for all entries

Hi Friend,

Pls tell me when we will use FOR ALL ENTRIES.

THANX IN ADVANCE

Regards,

Parvez

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 04, 2006 at 05:23 AM

    Hi pervez,

    what is the use of FOR ALL ENTRIES

    1. INNER JOIN

    DBTAB1 <----


    > DBTAB2

    It is used to JOIN two DATABASE tables

    having some COMMON fields.

    2. Whereas

    For All Entries,

    DBTAB1 <----


    > ITAB1

    is not at all related to two DATABASE tables.

    It is related to INTERNAL table.

    3. If we want to fetch data

    from some DBTABLE1

    but we want to fetch

    for only some records

    which are contained in some internal table,

    then we use for alll entries.

    *----


    1. simple example of for all entries.

    2. NOTE THAT

    In for all entries,

    it is NOT necessary to use TWO DBTABLES.

    (as against JOIN)

    3. use this program (just copy paste)

    it will fetch data

    from T001

    FOR ONLY TWO COMPANIES (as mentioned in itab)

    4

    REPORT abc.

    DATA : BEGIN OF itab OCCURS 0,

    bukrs LIKE t001-bukrs,

    END OF itab.

    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.

    *----


    itab-bukrs = '1000'.

    APPEND itab.

    itab-bukrs = '1100'.

    APPEND itab.

    *----


    SELECT * FROM t001

    INTO TABLE t001

    FOR ALL ENTRIES IN itab

    WHERE bukrs = itab-bukrs.

    *----


    LOOP AT t001.

    WRITE :/ t001-bukrs.

    ENDLOOP.

    regards,

    amit m.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 04, 2006 at 05:23 AM

    hi,

    FOR ALL ENTRIES is an effective way of doing away with using JOIN on two tables.

    You can check the below code -

    SELECT BUKRS BELNR GJAHR AUGDT

    FROM BSEG

    INTO TABLE I_BSEG

    WHERE BUKRS = ....

    SELECT BUKRS BELNR BLART BLDAT

    FROM BKPF

    INTO TABLE I_BKPF

    FOR ALL ENTRIES IN I_BSEG

    WHERE BUKRS = I_BSEG-BUKRS

    AND BELNR = I_BSEG-BELNR

    AND BLDAT IN SO_BLDAT.

    Hope this helps!

    Regards,

    anver

    if helped amrk points

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 04, 2006 at 05:25 AM

    Lets say u have data in itnernal table......1000 lines...

    now u want to select data from a databse table based on the values of any field of that internal table.

    select * from mara into table t1

    for all entries in internal_table

    where plant = internal_table-plant.

    now this will select data from databse table MARA into internl table t1 for all the values of the plant in internal_table.

    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.