Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

for all entries

Former Member
0 Likes
734

hi ,

when we are using 2 internal tables in program, we have decided to use for all entries statement to retrieve data but unfortunately there are no records in the first internal table. what will be the result ? ( 2nd internal table contains records).

regards

Raghava

hi ,

when we are using 2 internal tables in program, we have decided to use for all entries statement to retrieve data but unfortunately there are no records in the first internal table. what will be the result ? ( 2nd internal table contains records).

regards

Raghava

6 REPLIES 6
Read only

Former Member
0 Likes
711

Hi,

The SELECT query will retrieve all the records into 2nd internal table.

Rgds,

Bujji

Read only

Former Member
0 Likes
711

hi,

The total record wil be fetched in to second internal table.

Regards

Sandeep Reddy

Edited by: Sandeep Reddy on Jun 3, 2008 2:04 PM

Read only

Former Member
0 Likes
711

Hi...

If there's no record in the first internal table, then it will retrieve all the records from the Database table mentioned in the SELECT Query .

For that purpose only, It was asked to do some prerequiste check before using the FOR ALL ENTRIES..

Sort the internal table..

check internal table is not initial.

Reward Maximum Points if useful..

Read only

Former Member
0 Likes
711

HI.

it will give dump only.so u sholud chck first table has record or not.if yes then put your second select statment,

refer this code.

IF it_bill_data[] IS NOT INITIAL.

SELECT vbeln

kunnr

tzonis

FROM likp

INTO TABLE it_deli_data1

FOR ALL ENTRIES IN it_bill_data

WHERE vbeln = it_bill_data-vgbel.

endif.

REward all helpfull answers

regards.

Jay

Read only

Former Member
0 Likes
711

WHENEVER U USE FOR ALL ENTRIES

ALWAYS DO A CHECK WHETHER THE FIRST INTERNAL TABLE IS INITIAL OR NOT

EQ

SELECT  MATNR
        MTART
        MATKL
        MBRSH
        MEINS FROM MARA INTO TABLE IT_MARA
        WHERE MATNR IN S_MATNR
            AND  MTART IN  S_MTART
            AND  MATKL IN S_MAKTL.

IF IT_MARA IS NOT INITIAL.
SELECT MATNR
       MAKTX
       FROM MAKT INTO TABLE IT_MAKT
       FOR ALL ENTRIES IN IT_MARA
       WHERE MATNR EQ IT_MARA-MATNR
            AND SPRAS EQ SY-LANGU.

ENDIF.

IF SUPPOSE IF WE DON'T USE THE IF CONDITION HERE ALL THE ALL THE RECORDS OF THE SECOND SELECT STATEMENT WILL BE SELECTED IT IGNORES THE WHERE CONDITION.

SO IT IS MANDATORY TO CHECK THIS CONDITION WHENEVER U USE FOR ALL ENTRIES

REWARD POINTS IF HELPFUL

Read only

Former Member
0 Likes
711

hi ragavendra,

we have to use for all entries in the case if we want to selct data from more than two tables but u said that there is no data in the first internal table and also so there is no need to use for all entries if you use select query we can get the details form only the second table.

rewards if usefull,

thanks,

kalyan.