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

for all entries

hi

while doing FOR ALL ENTRIES what care we should take? can u plz explain it?

thanks in advance

bramara

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 24, 2007 at 12:14 PM

    the Internal table has contains records or not

    IF NOT IT[] is INITIAL>

    select

    .

    .

    .

    for all entries in it

    ENDIF..

    - Selva

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 24, 2007 at 12:21 PM

    Hi,

    In a join, the tables (base tables) are combined to form one results table. The join conditions are applied to this results table. The resulting composite for an inner join logic contains only those records for which matching records exist in each base table.

    Join conditions are not limited to key fields.

    If columns from two tables have the same name, then you have to ensure that the field labels are unique by prefixing the table name or a table alias.

    A table join is generally the most efficient way to read from the database. The database is responsible for deciding which table is read first and which index is used (DB Optimizer).

    At LEFT OUTER JOIN, results tables can also contain entries from the designated left hand table without the presence of corresponding data records (join conditions) from the table on the right. These table fields are filled by the database with null values and are then initialized according to ABAP type.

    It makes sense to use a LEFT OUTER JOIN when data from the table on the left is needed for which there are no corresponding entries in the table on the right.

    The following limitations apply for the Left Outer Join:

    you can only have a table or a view to the right of the JOIN operator, you cannot have another join statement

    Only AND can be used as a logical operator in an ON condition.

    every comparison in the ON condition must contain a field from the table on the right.

    if the FROM clause contains an Outer Join, then all ON conditions must contain at least one 'true' JOIN condition (a condition that contains a field from tab1 and a field from tab2).

    -


    FOR ALL ENTRIES works with a database in a quantity-oriented manner. Initially all data is collected in an internal table. Make sure that this table contains at least one entry (query sy-subrc or DESCRIBE), otherwise the subsequent transaction will be carried out without any restrictions).

    SELECT...FOR ALL ENTRIES IN is treated like a SELECT statement with an external OR condition. The system only selects those table entries that meet the logical condition .

    Using FOR ALL ENTRIES is recommended when data is not being read from the database, that is, it is already available in the program, for example, if the user has input the data. Otherwise a join is recommended.

    The easiest technical option for reading from multiple (dependent) tables is to use nested SELECT statements. The biggest disadvantage of this method is that for every data record contained in the external loop a SELECT statement is run using the database. This leads to a considerably worse performance in client/server systems.

    I think you got some clear idea on this .

    Regds

    Parvathi

    Please reward points if helpful...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 24, 2007 at 12:17 PM

    hi,

    check that internal table should have data on which u giving for all entry by

    If itab[] is not initial.

    select....

    endif.

    othrwise select statement select all the data from database table without matching condition....

    reward if useful....

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 24, 2007 at 12:18 PM

    Also refer to the fields of the internal table in where condition in your select query

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 24, 2007 at 12:20 PM

    Hi Bramara,

    Code the following.......

    for all entries of first int table it will select further.

    If not itab[] is initial.

    select f1 f2 f3 f4

    from table****

    into table itab1

    for all entries in itab

    where f1 = itab-f1

    and f2 = itab-f2.

    endif.

    if it is helpfull pls reward pts.

    Regards

    Srimanta

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 24, 2007 at 12:24 PM

    Hi,

    Functionaly.

    say suppose,

    VBAK (Sales Order Header)

    VBAP (Sales Order Details) tables are there,

    for a sales order number there can be one detail or more than one details.

    ie, sale order number (say) 00001,

    for this sales order number there can be 1 or more line items like. pen, AC, pencil, etc..

    (simply think somebody orders (customer) and somebody sells (company)).

    so, here FOR ALL ENTRIES will come for VBAP why?

    by this what i am trying to explain is for every VBAK (sales order number) select the VBAP(items).

    technically:

    select * from VBAP into internal table for all entries in VBAK where sales order = VBAK-sales order.

    For all entries will be applicable to those tables which has Parent child relationship.

    Edited by: jagannathan krishnan on Dec 27, 2007 2:35 PM

    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.