for all entries

35
RELEVANCY SCORE 2.52 Q: For All Entries-Dupli (http://www.postseek.com/meta/6b70439638c1ec03983b471be393cef5) how to avoid duplicate entries in a table using for all entries A: for all entries-dupli Read All 3 Posts (http://scn.sap.com/thread/301912) Hi, The following are required when you are using FOR ALL ENTRIES.. 1) Remove the duplicate entries for the key that you are selecting on. 2) Check if the internal table is populated before using FOR ALL ENTRIES. 3) Select all the key fields of the table that you are going to select.. Example - DATA: ITAB_VBAK LIKE VBAK OCCURS 0 WITH HEADER LINE. DATA: ITAB_VBAP LIKE VBAP OCCURS 0 WITH HEADER LINE. DATA: ITAB_VBAP_TMP LIKE VBAP OCCURS 0 WITH HEADER LINE. SELECT MANDT VBELN POSNR INTO TABLE ITAB_VBAP FROM VBAP WHERE MATNR IN SO_MATNR.

Upload: zlatil

Post on 21-Dec-2015

39 views

Category:

Documents


7 download

DESCRIPTION

SAP SCN For All Entries

TRANSCRIPT

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 1/35

RELEVANCY SCORE

2.52Q: For All Entries-Dupli(http://www.postseek.com/meta/6b70439638c1ec03983b471be393cef5)

how to avoid duplicate entries in a table using for all entries

A: for all entries-dupli

Read All 3 Posts (http://scn.sap.com/thread/301912)

Hi,

The following are required when you are using FOR ALL ENTRIES..

1)

Remove the duplicate entries for the key that you are selecting on.

2)

Check if the internal table is populated before using FOR ALL ENTRIES.

3)

Select all the key fields of the table that you are going to select..

Example

-

DATA: ITAB_VBAK LIKE VBAK OCCURS 0 WITH HEADER LINE.

DATA: ITAB_VBAP LIKE VBAP OCCURS 0 WITH HEADER LINE.

DATA: ITAB_VBAP_TMP LIKE VBAP OCCURS 0 WITH HEADER LINE.

SELECT MANDT VBELN POSNR INTO TABLE ITAB_VBAP

FROM VBAP

WHERE MATNR IN SO_MATNR.

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 2/35

IF SY-SUBRC = 0.

ITAB_VBAP_TMP = ITAB_VBAP.

SORT ITAB_VBAP_TMP BY VBELN.

DELETE ADJACENT DUPLICATES FROM ITAB_VBAP_TMP

COMPARING VBELN.

IF NOT ITAB_VBAP_TMP[] IS INITIAL.

SELECT MANDT VBELN

INTO TABLE ITAB_VBAK

FROM VBAK

FOR ALL ENTRIES IN ITAB_VBAP_TMP

WHERE VBELN = ITAB_VBAP_TMP-VBELN.

ENDIF.

Thanks,

Naren

RELEVANCY SCORE

2.44Q: Since Joining Icloud I Have Duplicate Entries For All Diary Entries:Help(http://www.postseek.com/meta/bcff91cfacb90a22aeb7be395f3fbbc2)Since joining Icloud I have duplicate entries for all diary entries: help

Start Download1. Click to Begin 2. Download

App 3. Get Free Maps &Directions

A: Since joining Icloud I have duplicate entries for all diary entries: help

Read All 8 Posts (https://discussions.apple.com/thread/3438895)

These last suggestions worked! Thank you! However, I still have duplicate entries in the Reminder list and can't seem toget rid of them.

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 3/35

RELEVANCY SCORE

2.44Q: For All Entries(http://www.postseek.com/meta/797df346591ca4615131562c0f7ebc1c)

Hi,

When will we use for all entries?

A: for all entries

Read All 8 Posts (http://scn.sap.com/thread/495359)

Hi,

ubFor all entries/b/u

The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number ofentries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit thelength of the WHERE clause.

The plus

Large amount of data

Mixing processing and reading of data

Fast internal reprocessing of data

Fast

The Minus

Difficult to program/understand

Memory could be critical (use FREE or PACKAGE size)

Some steps that might make FOR ALL ENTRIES more efficient:

Removing duplicates from the the driver table

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 4/35

Sorting the driver table

If possible, convert the data in the driver table to ranges so a BETWEEN statement is used instead of and OR statement:

FOR ALL ENTRIES IN i_tab

WHERE mykey = i_tab-low and

mykey = i_tab-high.

Regards,

Bhaskar

RELEVANCY SCORE

2.44Q: For All Entries(http://www.postseek.com/meta/b8a720ae39a645087f44ba93b36eb7f2)

How to use for all entries

A: for all entries

Read All 6 Posts (http://scn.sap.com/thread/320505)

Hi,

SELECT vbeln posnr matnrFROM vbapINTO TABLE it_vbap FOR ALL ENTRIES IN it_vbakWHERE vbeln = it_vbak-vbeln.

RELEVANCY SCORE

2.19Q: For All Entries(http://www.postseek.com/meta/cf3b110eb4a380243775357743df441a)

hello all

what are the pre-requisites to the for all entries

A: for all entries

Read All 5 Posts (http://scn.sap.com/thread/872275)

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 5/35

Hi ,

the table which is joining should not be empty

use all the key fields for joining

if the key fields having duplicate entries

copy the values into another internal table which is having the same structure and then using

delete adjasent duplicates by comparing the key fields

it_masterhd[] = it_master[].

IF it_masterhd[] IS NOT INITIAL.

SORT it_masterhd ASCENDING BY gmid.

DELETE ADJACENT DUPLICATES FROM it_masterhd COMPARING gmid.

SELECT gmid gm_descrip FROM z_gmid INTO TABLE it_gmid

FOR ALL ENTRIES IN it_masterhd WHERE gmid = it_masterhd-gmid.

SORT it_gmid ASCENDING BY gmid.

ENDIF.

RELEVANCY SCORE

2.17Q: " Query Regarding For-All-Entries "(http://www.postseek.com/meta/e00c8dce709bcee221c494f5bdebdbec)

Dear guys ,

What is the pre-requiste for For-all entries .

A: " query regarding For-all-entries "

Read All 2 Posts (http://scn.sap.com/thread/1623051)

HI,

Internal table 1 should contain reconds ...IF IT1 is NOT INITIAL -- This condition should be satisfy then only FOR ALLENTRIES will work.

Hope this information will help.

-Manohar

RELEVANCY SCORE

2.16

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 6/35

Q: For All Entries(http://www.postseek.com/meta/9a693cda921ab53ab7c0258cb8137a86)Hi Gurus,Is there any aditions to SELECT FOR ALL ENTRIES Query which would accept Duplicate Entries also?ThanksRegards,Vijaya.

A: For All Entries

Read All 10 Posts (http://scn.sap.com/thread/1113480)

Hi Gurus,Problem was solved,wrong with my code,only solution is we have to use all key fields.

RELEVANCY SCORE

2.14Q: For All Entries(http://www.postseek.com/meta/c2f204c1a7fc05ad859cce70f77b94a0)WHY WE USE FOR ALL ENTRIES IS IT USED INSTEAD OF INNER JOINS

A: FOR ALL ENTRIES

Read All 7 Posts (http://scn.sap.com/thread/479292)

INNER-JOINS AND FOR-ALL-ENTRIES BOTH ARE USED TO JOIN 2 TABLES AND GET DATA FROM THAT 2 TABLES BUT IN THEPERFORMANCE WAY FOR-ALL-ENTRIES IS BETTER THAN INNER-JOIN IF YOU USE 2 OR 3 TABLES INNER-JOIN IS OK , BUT IFUSE MORE THAN THAT IT WILL CREATE PERFORMANCE ISSUE FOR YOU BUT IN FOR ALL ENTRIES YOU CAN JOIN ANYNUMBER OF TABLES YOU WON'T GET ANY PERFORMANCE ISSUE IN THIS REGARDS NARESH

RELEVANCY SCORE

2.14Q: Sample Programs Reports With For All Entries(http://www.postseek.com/meta/02b376cff8cde5cf688af47722bb9cbd)send me sample programs reports with for all entries

A: sample programs reports with for all entries

Read All 7 Posts (http://scn.sap.com/thread/885475)

HiJust check this out - DATA: tab_spfli TYPE TABLE OF spfli, tab_sflight TYPE SORTED TABLE OF sflight WITH UNIQUE KEYtable_line, wa LIKE LINE OF tab_sflight.SELECT carrid connidINTO CORRESPONDING FIELDS OF TABLE tab_spfliFROMspfliWHERE cityfrom = 'NEW YORK'.SELECT carrid connid fldate INTO CORRESPONDING FIELDS OF TABLE tab_sflight FROM

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 7/35

sflight FOR ALL ENTRIES IN tab_spfli WHERE carrid = tab_spfli-carrid AND connid = tab_spfli-connid.LOOP AT tab_sflightINTO wa. AT NEW connid. WRITE: / wa-carrid, wa-connid. ENDAT. WRITE: / wa-fldate.ENDLOOP.Hope it helps.Reward ifuseful.RegardsMegha Sharma

RELEVANCY SCORE

2.14Q: For All Entries(http://www.postseek.com/meta/d8c961a02f5df026753d484d7066e1be)

dear exparts

could u explain about 'for all entries' key word?

A: for all entries

Read All 6 Posts (http://scn.sap.com/thread/825460)

Hi,

Outer join can be created using this addition to the where clause in a select statement. It speeds up the performancetremendously, but the cons of using this variation are listed below

Duplicates are automatically removed from the resulting data set. Hence care should be taken that the unique key of thedetail line items should be given in the select statement.

If the table on which the For All Entries IN clause is based is empty, all rows are selected into the destination table. Henceit is advisable to check before-hand that the first table is not empty.

If the table on which the For All Entries IN clause is based is very large, the performance will go down instead of improving.Hence attempt should be made to keep the table size to a moderate level.

Not Recommended

Loop at mat_gp.

Select single * from mara into itab

where matnr = itab-matnr.

Append itab.

Endloop.

Recommended

Select * from mara appending table itab

For all entries in mat_gp

Where matnr = mat_gp-matnr.

Thanks,

A.Melchizedek

RELEVANCY SCORE

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 8/35

2.14Q: For All Entries(http://www.postseek.com/meta/1050459e6bb617125cf7f62307ecacf0)

what is main purpose of for all entries?

Regards,

swathi.

A: for all entries

Read All 5 Posts (http://scn.sap.com/thread/531318)

The main reason to use for all entries is that it provides some better performance than join or especially better than innerselects.

Instead of using joins or inner selects, try to use for all entries.

bReward if helpful./b

RELEVANCY SCORE

2.14Q: For All Entries(http://www.postseek.com/meta/0d63b3d2ee16a5bb0edc93f3003b62a5)

hey, i have sm prob in using for all entries

A: for all entries

Read All 4 Posts (http://scn.sap.com/thread/449390)

hi

bSelect matnr from mara

into table itab1.

check itab1 is not initial.

sort itab1 by matnr.

select matnr lgnum from badasetable

into table itab2

for all entries in itab1

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 9/35

where matnr = itab1-lgnum./b

regards

ravish

breward points if useful/b

RELEVANCY SCORE

2.14Q: For All Entries(http://www.postseek.com/meta/8981578302561efeded23bd170f2eb13)Hi SDNs, when we use FOR ALL ENTRIES in select statement..Regards,aravind.

A: for all entries

Read All 8 Posts (http://scn.sap.com/thread/253600)

Hi aravind,When ever we want to Combine data from two data base table then we use For all Entries. Similar to that ofInner Joins concept.the advange of this For all entries is that it checks the condition first and then retrieves the data. Butwhere in inner joins the Data is retrieved first and then the condition is checked.ByeMurthy

RELEVANCY SCORE

2.14Q: For All Entries(http://www.postseek.com/meta/13e11fb6c4d746b469a0b8e97d584a1e)

Send me an example of For all entries with 3 or more tables.

A: FOR ALL ENTRIES

Read All 5 Posts (http://scn.sap.com/thread/681400)

hai,

useing for all entries we can select single table values but we can able to validate previous int table all values.

we need to use 3 int table for 3 db table and finaly do loop at final table move value from int table to final int table andappent final int table....

this is the process to do the for all entries...

it giving better performance becose we dont fetch all value from single select qurey and we populate all values in to finaltable through source code thats why its giving better performance......

plzz reward if useful..

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 10/35

regards,

jai.m

RELEVANCY SCORE

2.14Q: For All Entries Use And Syntax(http://www.postseek.com/meta/cb5ab05a3e8b59392387f5f0abbaf7db)

can help out in the using for all entries

A: for all entries use and syntax

Read All 10 Posts (http://scn.sap.com/thread/101259)

Hi franklin galz,

Effect:

When U use for all entries it takes all the data according to ur criteria.

Example:

SELECT avkorg avtweg aspart afkdat aerdat avbeln a~kunag

bname1 arfbsk

FROM vbrk AS a

JOIN kna1 AS b ON akunag = bkunnr

INTO CORRESPONDING FIELDS OF TABLE it1

WHERE a~fkdat IN p_fkdat

AND a~vbeln IN p_vbeln

AND a~vkorg IN p_vkorg

AND a~vtweg IN p_vtweg

AND a~spart IN p_spart.

SELECT vbeln vgbel

INTO CORRESPONDING FIELDS OF TABLE it2

FROM vbrp

FOR ALL ENTRIES IN it1

WHERE vbeln = it1-vbeln.

Here IT1 is filled with all VBELN Entries.

Now For all IT1-VBELN entry instead of using select statement in loop, u can use for all entries statement.

So it2 is filled from VBRP according to it1-vbeln entries.

Advantage : Number of database trip is reduced. It will increase the performance of ur report by reducing execution time.

Regards,

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 11/35

Digesh Panchal

RELEVANCY SCORE

1.94Q: For All Entries(http://www.postseek.com/meta/37f577ae7c2db310fd4e7aaccc6c338b)

Can i use five join statement or else shall v go to for all entries which is efficient and send the coding for for all entries

thanks for replying all

A: for all entries

Read All 3 Posts (http://scn.sap.com/thread/475849)

Hi Ramesh,

Join is more efficient when you join 2 to 3 tables.

But for 5 tables, its not advisable to use join, its better to use FOR ALL ENTRIES.

Ex:

SELECT qmnum

FROM QMEL

INTO TABLE it_qmel.

if sy-subrc eq 0.

select qmnum manum

into table it_qmsm

from qmsm

for all entries in it_qmel

where qmnum = it_qmel-qmnum.

endif.

RELEVANCY SCORE

1.89Q: Driver Table In Select For All Entries(http://www.postseek.com/meta/432c94923652def3a088b5bba08fc3e1)

anyone please let me what is driver table in select for all entries and when do we go for select for all entries

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 12/35

A: driver table in select for all entries

Read All 4 Posts (http://scn.sap.com/thread/375571)

Here is something from help

FOR ALL ENTRIES WHERE

Syntax

... FOR ALL ENTRIES IN itab WHERE ... col operator itab-comp ...

Effect

If the addition FOR ALL ENTRIES is specified before the language element WHERE, then the components comp of theinternal table itab can be used as operands when comparing with relational operators.

The internal table itab must have a structured line type and the component comp must be compatible with the columncol.

The logical expression sql_cond of the WHERE condition can comprise various logical expressions by using AND and OR.However, if FOR ALL ENTRIES is specified, there must be at least one Comparison with a column of the internal table itab,which can be specified either statistically or dynamically (Release 6.40 and higher). In a statement with a SELECTstatementwith FOR ALL ENTRIES, the addition ORDER BY can only be used with the addition PRIMARY KEY.

The whole logical expression sql_cond is evaluated for each individual line of the internal table itab. The resulting set ofthe SELECT statement is the union of the resulting sets from the individual evaluations. Duplicate lines are automaticallyremoved from the resulting set. If the internal table itab is empty, the whole WHERE statement is ignored and all lines inthe database are put in the resulting set.

Notes

In Release 6.10 and higher, the same internal table can be specified after FOR ALL ENTRIES and after INTO.

The addition FOR ALL ENTRIES is only possible before WHERE conditions of the SELECT statement.

Example

Exporting all flight data for a specified departure city. The relevant airlines and flight numbers are first put in an internaltable entry_tab, which is evaluated in the WHERE condition of the subsquent SELECT statement.

PARAMETERS p_city TYPE spfli-cityfrom.

TYPES: BEGIN OF entry_tab_type, carrid TYPE spfli-carrid, connid TYPE spfli-connid, END OF entry_tab_type.

DATA: entry_tab TYPE TABLE OF entry_tab_type, sflight_tab TYPE SORTED TABLE OF sflight WITH UNIQUE KEY carrid connid fldate.

SELECT carrid connid FROM spfli INTO CORRESPONDING FIELDS OF TABLE entry_tab WHERE cityfrom = p_city.

SELECT carrid connid fldate FROM sflight INTO CORRESPONDING FIELDS OF TABLE sflight_tab FOR ALL ENTRIES IN entry_tab WHERE carrid = entry_tab-carrid AND connid = entry_tab-connid.

RELEVANCY SCORE

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 13/35

1.89Q: For All Entries(http://www.postseek.com/meta/33f4c19bda959f288d103da85b53fbf3)

Hello GURU'S,

What are the pre-considerations for the common "FOR ALL ENTRIES" and How many Select queries will be fired in "FORALL ENTRIES"?

help me.

with regards

K.Saravanakumar.

A: FOR ALL ENTRIES

Read All 7 Posts (http://scn.sap.com/thread/819580)

hi,

1. You got to sort the table whenever you use for all entries statement .

2. Check if the table is initial or not .... i.e,

if not it_mara[] is initial.select * from marc into table it_marc for all entries in it_mara ...endif.

RELEVANCY SCORE

1.89Q: For All Entries In(http://www.postseek.com/meta/2556c182c73fe5ac670fd1bf051516c5)

How can i justify to use FOR ALL ENTRIES IN insteded of INNERJOIN ?

when i can go for FOR ALL ENTRIES?

A: For ALL ENTRIES IN

Read All 8 Posts (http://scn.sap.com/thread/738666)

Hi,

If you join two or three tables, then you use inner joins.

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 14/35

But if the tables are more than three, then there is performance issue. For that use for all entries to get betterperformance.

regards,

kamala.

RELEVANCY SCORE

1.89Q: For All Entries(http://www.postseek.com/meta/2e82bd89659fa53cc80c97ce2a4304d5)

Hello GURU'S,

What are the pre-considerations for the common "FOR ALL ENTRIES" and How many Select queries will be fired in "FORALL ENTRIES"?

help me.

with regards

K.Saravanakumar.

A: FOR ALL ENTRIES

Read All 5 Posts (http://scn.sap.com/thread/819579)

thanks u so much amiya..

In interactive ALV how many sublist can be created??

RELEVANCY SCORE

1.88Q: For All Entries(http://www.postseek.com/meta/fb2383675dfbaf340e78a0e8d0f48c2d)

Hi...

When retrieving data using for all entries from a DB table, it is not retrieving all the records?

A: For all entries

Read All 3 Posts (http://scn.sap.com/thread/1343721)

Check whether the Key Defenitions are properly Done in the query so that the query will work.

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 15/35

with Regards,

S.Saravanan

RELEVANCY SCORE

1.88Q: For All Entries(http://www.postseek.com/meta/a3fa6d9704cc0dc3041bc7c1916ad150)

hi all,

When do we use "for all entries" and is it a good practice of programming?

A: for all entries

Read All 8 Posts (http://scn.sap.com/thread/451770)

hi,

for all entries can be used in place of joins when joining more than 2 tables. as joins degrades the performance of selectstatements when they are incresaed. at such situations u can go for for all entries. while using for all entries u shold havea minimum of one common field in tables.

if useful reward some points.

withregards,

suresh.

RELEVANCY SCORE

1.88Q: Type Mismatch In For All Entries(http://www.postseek.com/meta/b719e0d4f40196e91d72d9105467541d)

hi to all experts,

how to avoid type mismatch in for all entries.

A: TYPE MISMATCH IN FOR ALL ENTRIES

Read All 2 Posts (http://scn.sap.com/thread/1041955)

HI

Check this thread

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 16/35

SELECT Query - Data Type and Length problem

regards

pavan

RELEVANCY SCORE

1.87Q: For All Entries(http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7)

Hi,

Can anyone explain FOR ALL ENTRIES concept with Example

And what is the difference between for all entries and inner join

Thanks Regards,

Maya

A: FOR ALL ENTRIES

Read All 6 Posts (http://scn.sap.com/thread/382926)

Hi,

FOR ALL ENTRIES are usefull while going for somany inner joins.

insted of making big query fetching all records from database, we are fetching minimum records in first query, then thenext query we are using output of first query recordset in where clause.

But before using for all entries we have to eleminate redundent records and make sure that first query output Internaltable is having any data. otherwise it will fetch all the records in the tabel.

if Itab1 is not Initial.

execute second query with FOR ALL ENTRIES.

endif.

if u have more doubts reply, i will send examples.

regards

V.Rajesh

RELEVANCY SCORE

1.87Q: Use Of For All Entries(http://www.postseek.com/meta/2b6a5033df9cc4380b272f8fc8b069c5)

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 17/35

can i use an inequality option in for all entries, i mean....

select * from ZTABLE

into table itab

for all entries in itab2

where field1 NE itab2-field2.

Regards

Pratyusha

A: use of for all entries

Read All 8 Posts (http://scn.sap.com/thread/438545)

Hi,

Performance wise FOR ALL ENTRIES IS USEFUL

You can only use FOR ALL ENTRIES IN ...WHERE ...in a SELECT statement.

SELECT ... FOR ALL ENTRIES IN itab WHERE cond returns the union of the solution sets of all SELECT

statements that would result if you wrote a separate statement for each line of the internal table replacing the symbol

itab-f with the corresponding value of component f in the WHERE condition.Duplicates are discarded from the result

set. If the internal table itab does not contain any entries, the system treats the statement as though there were

no WHERE cond condition, and selects all records (in the current client).

for example:

SELECT * FROM sflight INTO wa_sflight

FOR ALL ENTRIES IN ftab

WHERE CARRID = ftab-carrid AND

CONNID = ftab-connid AND

fldate = '20010228'.

this condition, return all entries of the sflight

Regards

RELEVANCY SCORE

1.86Q: For All Entries(http://www.postseek.com/meta/c4592b5d4b060f2312f6f7df563a93c3)

CAN I USE 2 FOR ALL ENTRIES IN A SINGLE SELECT STATMENT

FOR JOINING 3 DATABASE TABLE

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 18/35

A: FOR ALL ENTRIES

Read All 6 Posts (http://scn.sap.com/thread/487775)

Hi Ashok,

No. You can use for all entries only one time in select.

If you want to join 3 tables.logic should be.

1. select data into first table

2. select data into second table for all entries in first table

3. select data into third table for all entries in first or second table.

Reward points if useful,

Aleem.

RELEVANCY SCORE

1.83Q: For All Entries In Select Clause(http://www.postseek.com/meta/4b340d8214b3d404f5b8c6e8fdc0c5e8)for all entries in select clause,can u tell use of this one?

A: for all entries in select clause

Read All 6 Posts (http://scn.sap.com/thread/846673)

Hi Vinay, For all entries is used to retrieve data from two or more tables.In some cases , one of the table may be a clustertable .So we can't use the inner or outer join.For example we have invoice details in VBRK and condition values inKONV.we can fetch invoice details in one internal table.eg;Select vbeln fkdat knumv posnr from vbrk into table it_vbrkwhere vbeln in so_vbeln.The corresponding condition values for the invoices can be fetched from KONV table by writing aquery with for all entries.select knumv Kposn kschl kwert from konv in to table it_konv for all entries in it_vbrk-vbeln whereknumv eq it_vbrk-knumv.Regards,Charumathi.B

RELEVANCY SCORE

1.83Q: When We Will Use For All Entries(http://www.postseek.com/meta/ecf720dc69aebb3048f0c3dbedd9d646)

Hi Friend,

Pls tell me when we will use FOR ALL ENTRIES.

THANX IN ADVANCE

Regards,

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 19/35

Parvez

A: When we will use for all entries

Read All 4 Posts (http://scn.sap.com/thread/228195)

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.

RELEVANCY SCORE

1.83Q: Difference Between Inner Join And For All Entries(http://www.postseek.com/meta/33502546aee8d804aa933dbe5a013d29)

hi

experts

please answer me

difference between inner join and for all entries

A: difference between inner join and for all entries

Read All 3 Posts (http://scn.sap.com/thread/750620)

Hi,

Inner Join: Retrieves data from Data base tables based on the 'WITH KEY' fields which you have mentioned in your 'SELECT'query. It also depends on the 'WHERE' condition. In total the 'Inner Join' is filtering the data at DATABASE LEVEL.

for all entries: let us take a simple example to disclose the beauty of 'FOR ALL ENTRIES'.

IT_KNA1 is an internal table which has been used to retrieve the customers from KNA1 table.

IT_VBAK is an internal table which, you are going to use to retrieve the sales orders from VBAK table for the IT_KNA1internal table customers.

slect vbeln

erdat

from VBAK

for all entries IT_KNA1

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 20/35

where erdat in s_erdat.

the above select query can extracts the Sales Orders for the customers in IT_KNA1 based on the selection screen inputS_ERDAT.

if IT_KNA1 is empty....what would happend to the above select query.

The above select query will work fine, provided it will extract all the data(for all customers in KNA1 table) in between theselection screen input S_ERDAT, which is one way or other way burden on the data base.

SO WHILE USING 'FOR ALL ENTRIES', ITS USERS RESPONSIBILITY TO CHECK THE INITIALITY OF THE FIRST INTERNAL TABLE.(IT_KNA1 IN OUR CASE).

RELEVANCY SCORE

1.83Q: Diff Of Innerjoin For All Entries(http://www.postseek.com/meta/c9b7540eef800b510ac7f2c701a2e5cf)

hi friends.

what is the diffrence b/w inner join and for all entries.

A: diff of innerjoin for all entries

Read All 7 Posts (http://scn.sap.com/thread/104311)

hi vijay

thank u

u have cleared my doubt.

regards ,

surekha

RELEVANCY SCORE

1.83Q: For All Entries(http://www.postseek.com/meta/27a99febf212fdd21832f515d3893802)

what is the purpose of keyword for all entries and the various issues of it.

A: for all entries

Read All 5 Posts (http://scn.sap.com/thread/862346)

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 21/35

Hi Sandeep,

for all entries is the key word used insted of wrting a select statement in loop and endloop.

for example see

in one intrenal table u have some fields based on that field values u want to retrive the data then u will do like this ..

loop itab.

select * from table into itab1 where field1 eq itab-field1.

append itab1.

endselect.

endloop.

instead of the u can write

select * from table into itab1 for all entries in itab where field1 = itab-field1.

but ...

in u r quer either in select clause or where clause u should manintin the entire key this is the mandatory or else it will notthrow any syntactical error but data loss will be there it will be blunder hope i am making sense ..

plzz reward if useful..

Thanks and regards

Sunil Kumar Mutyala

RELEVANCY SCORE

1.83Q: For All Entries(http://www.postseek.com/meta/26efb488bc8b0e1cd2c3971851da4073)

Hi Friends,

I need some information about for all entries. what does this function do exactly?

Thanks in advance,

chandu

A: for all entries

Read All 7 Posts (http://scn.sap.com/thread/721151)

Hi

We can use FOR ALL ENTRIES to replace the Inner Joins in order to fetch data from 2 or more tables.

FOR ALL ENTRIES improves the performance over Inner Joins

Narendra

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 22/35

RELEVANCY SCORE

1.83Q: Hi Guru's What Is The Diff Between For All Entries Joins(http://www.postseek.com/meta/1126996c18e5978076e01022704ececc)hi guru's what is the diff between for all entries joins

A: hi guru's what is the diff between for all entries joins

Read All 5 Posts (http://scn.sap.com/thread/723864)

Hi Vasu,Joins are used to fetch data fast from Database tables:Tables are joined with the proper key fields to fetch thedata properly.If there are no proper key fields between tables don't use Joins;Important thing is that don't USE JOINS FORCLUSTER tableslike BSEG and KONV.Only use for Transparenmt tables.You can also use joins for the database VIews tofetch the data.JOINS... FROM tabref1 [INNER] JOIN tabref2 ON cond Effect The data is to be selected from transparentdatabase tables and/or views determined by tabref1 and tabref2. tabref1 and tabref2 each have the same form as invariant 1 or are themselves Join expressions. The keyword INNER does not have to be specified. The database tables orviews determined by tabref1 and tabref2 must be recognized by the ABAP Dictionary. In a relational data structure, it isquite normal for data that belongs together to be split up across several tables to help the process of standardization (seerelational databases). To regroup this information into a database query, you can link tables using the join command. Thisformulates conditions for the columns in the tables involved. The inner join contains all combinations of lines from thedatabase table determined by tabref1 with lines from the table determined by tabref2, whose values together meet thelogical condition (join condition) specified using ONcond. Inner join between table 1 and table 2, where column D in bothtables in the join condition is set the same: Table 1 Table 2 ABCDDEFGH a1b1c111e1f1g1h1 a2b2c213e2f2g2h2a3b3c324e3f3g3h3 a4b4c43 |--|||--| \ / \ / \ / \ / \/ Inner Join ABCDDEFGH a1b1c111e1f1g1h1 a2b2c211e1f1g1h1a4b4c433e2f2g2h2 |--||||||||--| Example Output a list of all flights from Frankfurt to New York between September10th and 20th, 2001 that are not sold out: DATA: DATE LIKE SFLIGHT-FLDATE, CARRID LIKE SFLIGHT-CARRID, CONNID LIKESFLIGHT-CONNID. SELECT FCARRID FCONNID F~FLDATE INTO (CARRID, CONNID, DATE) FROM SFLIGHT AS F INNER JOINSPFLI AS P ON FCARRID = PCARRID AND FCONNID = PCONNID WHERE P~CITYFROM = 'FRANKFURT' AND P~CITYTO ='NEW YORK' AND F~FLDATE BETWEEN '20010910' AND '20010920' AND FSEATSOCC FSEATSMAX. WRITE: / DATE, CARRID,CONNID. ENDSELECT. If there are columns with the same name in both tables, you must distinguish between them byprefixing the field descriptor with the table name or a table alias. Note In order to determine the result of a SELECTcommand where the FROM clause contains a join, the database system first creates a temporary table containing thelines that meet the ON condition. The WHERE condition is then applied to the temporary table. It does not matter in aninner join whether the condition is in the ON or WHEREclause. The following example returns the same solution as theprevious one. Example Output of a list of all flights from Frankfurt to New York between September 10th and 20th, 2001that are not sold out: DATA: DATE LIKE SFLIGHT-FLDATE, CARRID LIKE SFLIGHT-CARRID, CONNID LIKE SFLIGHT-CONNID.SELECT FCARRID FCONNID F~FLDATE INTO (CARRID, CONNID, DATE) FROM SFLIGHT AS F INNER JOIN SPFLI AS P ONFCARRID = PCARRID WHERE FCONNID = PCONNID AND P~CITYFROM = 'FRANKFURT' AND P~CITYTO = 'NEW YORK' ANDF~FLDATE BETWEEN '20010910' AND '20010920' AND FSEATSOCC FSEATSMAX. WRITE: / DATE, CARRID, CONNID.ENDSELECT. Note Since not all of the database systems supported by SAP use the standard syntax for ON conditions, thesyntax has been restricted. It only allows those joins that produce the same results on all of the supported databasesystems: Only a table or view may appear to the right of the JOIN operator, not another join expression. Only AND ispossible in the ON condition as a logical operator. Each comparison in the ON condition must contain a field from theright-hand table. If an outer join occurs in the FROM clause, all the ON conditions must contain at least one "real" JOINcondition (a condition that contains a field from tabref1 amd a field from tabref2. Note In some cases, '*' may be specifiedin the SELECT clause, and an internal table or work area is entered into the INTO clause (instead of a list of fields). If so, thefields are written to the target area from left to right in the order in which the tables appear in the FROM clause, accordingto the structure of each table work area. There can then be gaps between table work areas if you use an AlignmentRequest. For this reason, you should define the target work area with reference to the types of the database tables, notsimply by counting the total number of fields. For an example, see below: Variant 3 ... FROM tabref1 LEFT [OUTER] JOINtabref2 ON cond Effect Selects the data from the transparent database tables and/or views specified in tabref1 andtabref2. tabref1 und tabref2 both have either the same form as in variant 1 or are themselves join expressions. Thekeyword OUTER can be omitted. The database tables or views specified in tabref1 and tabref2 must be recognized by the

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 23/35

ABAP-Dictionary. In order to determine the result of a SELECT command where the FROM clause contains a left outer join,the database system creates a temporary table containing the lines that meet the ON condition. The remaining fields fromthe left-hand table (tabref1) are then added to this table, and their corresponding fields from the right-hand table arefilled with ZERO values. The system then applies the WHERE condition to the table. Left outer join between table 1 andtable 2 where column D in both tables set the join condition: Table 1 Table 2 ABCDDEFGH a1b1c111e1f1g1h1a2b2c213e2f2g2h2 a3b3c324e3f3g3h3 a4b4c43 |--|||--| \ / \ / \ / \ / \/ Left Outer Join ABCDDEFGH a1b1c111e1f1g1h1a2b2c211e1f1g1h1 a3b3c32NULLNULLNULLNULLNULL a4b4c433e2f2g2h2 |--||||||||--| Example Output a list of allcustimers with their bookings for October 15th, 2001: DATA: CUSTOMER TYPE SCUSTOM, BOOKING TYPE SBOOK. SELECTSCUSTOMNAME SCUSTOMPOSTCODE SCUSTOM~CITY SBOOKFLDATE SBOOKCARRID SBOOKCONNID SBOOKBOOKIDINTO (CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY, BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID, BOOKING-BOOKID) FROM SCUSTOM LEFT OUTER JOIN SBOOK ON SCUSTOMID = SBOOKCUSTOMID ANDSBOOK~FLDATE = '20011015' ORDER BY SCUSTOMNAME SBOOKFLDATE. WRITE: / CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY, BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID, BOOKING-BOOKID. ENDSELECT.If there are columns with the same name in both tables, you must distinguish between them by prefixing the fielddescriptor with the table name or using an alias. Note For the resulting set of a SELECT command with a left outer join inthe FROM clause, it is generally of crucial importance whether a logical condition is in the ON or WHERE condition. Sincenot all of the database systems supported by SAP themselves support the standard syntax and semantics of the left outerjoin, the syntax has been restricted to those cases that return the same solution in all database systems: Only a table orview may come after the JOIN operator, not another join statement. The only logical operator allowed in the ON conditionis AND. Each comparison in the ON condition must contain a field from the right-hand table. Comparisons in the WHEREcondition must not contain a field from the right-hand table. The ON condition must contain at least one "real" JOINcondition (a condition in which a field from tabref1 as well as from tabref2 occurs). Note In some cases, '*' may bespecivied as the field list in the SELECT clause, and an internal table or work area is entered in the INTO clause (instead ofa list of fields). If so, the fields are written to the target area from left to right in the order in which the tables appear in thellen in der FROM clause, according to the structure of each table work area. There can be gaps between the table workareas if you use an Alignment Request. For this reason, you should define the target work area with reference to the typesof the database tables, as in the following example (not simply by counting the total number of fields). Example Exampleof a JOIN with more than two tables: Select all flights from Frankfurt to New York between September 10th and 20th, 2001where there are available places, and display the name of the airline. DATA: BEGIN OF WA, FLIGHT TYPE SFLIGHT, PFLITYPE SPFLI, CARR TYPE SCARR, END OF WA. SELECT * INTO WA FROM ( SFLIGHT AS F INNER JOIN SPFLI AS P ON FCARRID= PCARRID AND FCONNID = PCONNID ) INNER JOIN SCARR AS C ON FCARRID = CCARRID WHERE P~CITYFROM ='FRANKFURT' AND P~CITYTO = 'NEW YORK' AND F~FLDATE BETWEEN '20010910' AND '20010920' AND FSEATSOCCFSEATSMAX. WRITE: / WA-CARR-CARRNAME, WA-FLIGHT-FLDATE, WA-FLIGHT-CARRID, WA-FLIGHT-CONNID.ENDSELECT.And for all entries,this will help u.use of FOR ALL ENTRIES:1. INNER JOINDBTAB1 ---- DBTAB2It is used to JOINtwo DATABASE tableshaving some COMMON fields.2. WhereasFor All Entries,DBTAB1 ---- ITAB1is not at all related to twoDATABASE tables.It is related to INTERNAL table.3. If we want to fetch datafrom some DBTABLE1but we want to fetchforonly some recordswhich are contained in some internal table,then we use for alll entries.*----1. simple example of for allentries.2. NOTE THATIn for all entries,it is NOT necessary to use TWO DBTABLES.(as against JOIN)3. use this program (justcopy paste)it will fetch datafrom T001FOR ONLY TWO COMPANIES (as mentioned in itab)4REPORT abc.DATA : BEGIN OFitab 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 t001INTO TABLE t001FOR ALL ENTRIES INitabWHERE bukrs = itab-bukrs.*----LOOP AT t001.WRITE :/ t001-bukrs.ENDLOOP.cheers,Hema.

RELEVANCY SCORE

1.83Q: Join Vs For All Entries??(http://www.postseek.com/meta/25e55f0b85d6f186729e38f23cf7c635)

HI,

what is the difference between FOR ALL ENTRIES and JOINS?

Bent.

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 24/35

A: JOIN VS FOR ALL ENTRIES??

Read All 5 Posts (http://scn.sap.com/thread/345958)

Hi,

When using FOR ALL ENTRIES the number of matching records is restricted to the number of records in the internal table.If the number of records in the database tables is too large then join would cause overheads in performance. Additionallya JOIN bypasses the table buffering.

regards,

keerthi

Q: connection a sqlplus avec la 8i lite (http://www.postseek.com/meta/56e9dcbec8d7b06e2277a1dc015bc7ae) Q: When saving Excel files it is defaulting to the OneDrive Cloud rather than the local drive after moving to Office 365(http://www.postseek.com/meta/80eee2bfb3625e58edc253fc8a11b252) Q: SCOM 2007 (http://www.postseek.com/meta/3a159a061e24b8e23bd93be676b07f87) Q: Domain shutdown for extended time frame (http://www.postseek.com/meta/1079497cc899cb95c5973316442547ec) Q: How to run Java in an application (http://www.postseek.com/meta/d98689fa885cc9f8bf1875a2ae19108e) Q: How to activate my account apple id (http://www.postseek.com/meta/5a8b46ba09cf5887e873ab302f0fcee4) Q: Airport extremes/speakers lose signal (http://www.postseek.com/meta/c35736ac9fca59f659ccb83bbc1ba1e9) Q: How do i import pictures from  a SanDisk memory stick pro duo?(http://www.postseek.com/meta/8bc9ece92caa4b02de08e0a1a516dd4a)

RELEVANCY SCORE

1.83Q: Left Outer Join Using For All Entries(http://www.postseek.com/meta/43690a252e37b00fcba317f89fd77555)

how to implement left outer join using for all entries In REPORTS.

A: left outer join using For All Entries

Read All 7 Posts (http://scn.sap.com/thread/1599725)

performance is a different case... it not correct to say which one is the best in every situation...

check this thread for details...

and any ways...

please be clear with your requirements... if you are using joins then why for all entries are needed??

and i guess you want to use a tables content to compare during join of another two tables.. in that case.. you can create arange table for that particular field and pass the value from your internal table to this range table...

and while writing the join you can use like : vblen in GT_VBELN -- this being a range table..

but 1 more constraint is this range table should not contain more than 5K records..

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 25/35

RELEVANCY SCORE

1.83Q: For All Entries(http://www.postseek.com/meta/8ffa79d4a641c3151638777fd60b0a32)

What are the prerequisites to be checked before we apply 'for all entries concept'?

A: FOR ALL ENTRIES

Read All 8 Posts (http://scn.sap.com/thread/429910)

hi mrutyunjaya,

thanks for the answer.

regards

raju

RELEVANCY SCORE

1.83Q: About For All Entries(http://www.postseek.com/meta/952858fcea23064ca71816048d86727a)

can u give the information abt the FOR ALL ENTRIES and the conditions.

A: about for all entries

Read All 11 Posts (http://scn.sap.com/thread/166921)

HI

FOR ALL ENTRIES is really useful when u want to restrict selections bassed on the fields already present in anotherinternal table.

Lets say u have selected some data from some header table and u want to restrict the line items select. u can use for allentries to filter out the line items form the header table.

Performance wise it might just be better than using nested joins .

PL reward points for helpful posts.

RELEVANCY SCORE

1.83

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 26/35

Q: Inner Join With For All Entries(http://www.postseek.com/meta/a059734dc36a33469acd89b927a45303)

Inner join with for all entries is possible if possible pls forward the syntax.

A: inner join with for all entries

Read All 4 Posts (http://scn.sap.com/thread/534365)

Hi,

yes its possible..

If not it_lfb1[] is initial.

SELECT lfa1lifnr lfa1land1

lfa1~name1

lfa1~ort01

lfa1~regio

lfm1~ekorg

FROM lfa1 INNER JOIN lfm1

ON lfa1lifnr = lfm1lifnr

for all entries in it_lfb1

where lifnr = it_lfb1-lifnr.

ENDIF.

Regards,

nagaraj

RELEVANCY SCORE

1.83Q: How To Print The Matter In For All Entries(http://www.postseek.com/meta/d5971270186d08b1ddec16fe3091f050)

HI HOW T PRINT THE FOR ALL ENTRIES MATTER

A: HOW TO PRINT THE MATTER IN FOR ALL ENTRIES

Read All 4 Posts (http://scn.sap.com/thread/495841)

Hello Naresh,

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 27/35

Move the contents into a final table with all the required fields and then display that table.

Chk this..

SELECT * FROM S677 INTO TABLE T_S677FOR ALL ENTRIES IN TBL_MARCWHERE SSOUR EQ GC_SSOUR AND SPMON EQ GC_SPMON AND SPTAG EQ GC_SPTAG .

loop at T_S677.read table TBL_MARC with key matnr eq T_S677-matnr.if sy-subrc eq 0.else.delete table T_S677.endif.endloop.

RELEVANCY SCORE

1.83Q: For All Entries(http://www.postseek.com/meta/fc5f1c940929cb5ac1e22b7450ec1527)

hi exerts,

What is necessary step before writing the for all entries statement? Give the syntax?

A: for all entries

Read All 5 Posts (http://scn.sap.com/thread/518466)

Hi,

bPoints to note are :-/b

1. Duplicates are discarded from the result set.

2. If the internal table itab does not contain any entries, the system treats the statement as though there were no WHEREcond condition, and selects all records.

3. If you use FOR ALL ENTRIES IN itab, you cannot use ORDER BY f1 ... fn in the ORDER-BY clause.

bSample Code :-/b

SELECT * FROM SFLIGHT INTO WA_SFLIGHT

FOR ALL ENTRIES IN FTAB

WHERE CARRID = FTAB-CARRID AND

CONNID = FTAB-CONNID AND

FLDATE = '19950228'.

RATIO = WA_SFLIGHT-SEATSOCC / WA_SFLIGHT-SEATSMAX.

WRITE: / WA_SFLIGHT-CARRID, WA_SFLIGHT-CONNID, RATIO.

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 28/35

ENDSELECT.

Enjoy SAP.

Pankaj Singh.

RELEVANCY SCORE

1.83Q: Select Join And For All Entries(http://www.postseek.com/meta/e4e4668111363617467bd6fba97eb76f)

how i can use

select sum(XX)

from join tables with the statment for all entries...

A: select join and for all entries

Read All 4 Posts (http://scn.sap.com/thread/1218097)

Hi, Sikken

Have a look at the following Thread it will halp you while using "for all entries in"

[Inner join with for-all entries |Re: Inner join with for-all entries]

Kind Regards,

Faisal

RELEVANCY SCORE

1.83Q: Read Data : For All Entries(http://www.postseek.com/meta/26202f43a1b09ab9f4681d2a341b05b7)

wht happens if v read data using FOR ALL ENTRIES in select statement

A: read data : for all entries

Read All 7 Posts (http://scn.sap.com/thread/843166)

hi

SELECT ... FOR ALL ENTRIES IN itab WHERE cond ...

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 29/35

cond may be formulated as described above. If you specify a field of the internal table itab as an operand in a condition,you address all lines of the internal table. The comparison is then performed for each line of the internal table. For eachline, the system selects the lines from the database table that satisfy the condition. The result set of the SELECT statementis the union of the individual selections for each line of the internal table. Duplicate lines are automatically eliminated fromthe result set. If itab is empty, the addition FOR ALL ENTRIES is disregarded, and all entries are read.

The internal table itab must have a structured line type, and each field that occurs in the condition cond must becompatible with the column of the database with which it is compared. Do not use the operators LIKE, BETWEEN, and INin comparisons using internal table fields. You may not use the ORDER BY clause in the same SELECT statement.

You can use the option FOR ALL ENTRIES to replace nested select loops by operations on internal tables. This cansignificantly improve the performance for large sets of selected data.

RELEVANCY SCORE

1.83Q: For All Entries(http://www.postseek.com/meta/4dd66ee8a544e02c70d5cae4c5791c68)

hi SDNs,

what is the concept of SELECT ..... FOR ALL ENTRIES?

Thanks and regards,

aravind.

A: for all entries

Read All 5 Posts (http://scn.sap.com/thread/188545)

hi aravind,

check this is from help,

... FOR ALL ENTRIES IN itab WHERE cond

Effect

Only selects the records that meet the logical condition cond when each replacement symbol itab-f is replaced with thevalue of component f of the internal table itab for at least one line of the table. SELECT ... FOR ALL ENTRIES IN itab WHEREcond returns the union of the solution sets of all SELECT statements that would result if you wrote a separate statementfor each line of the internal table replacing the symbol itab-f with the corresponding value of component f in the WHEREcondition.Duplicates are discarded from the result set. If the internal table itab does not contain any entries, the systemtreats the statement as though there were no WHERE cond condition, and selects all records (in the current client).

Example

Displaying the occupancy of flights on 28.02.2001:

TYPES: BEGIN OF ftab_type,

carrid TYPE sflight-carrid,

connid TYPE sflight-connid,

END OF ftab_type.

DATA: ftab TYPE STANDARD TABLE OF ftab_type WITH

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 30/35

NON-UNIQUE DEFAULT KEY INITIAL SIZE 10,

free TYPE I,

wa_sflight TYPE sflight.

Suppose FTAB is filled as follows:

CARRID CONNID

--------------

LH 2415

SQ 0026

LH 0400

SELECT * FROM sflight INTO wa_sflight

FOR ALL ENTRIES IN ftab

WHERE CARRID = ftab-carrid AND

CONNID = ftab-connid AND

fldate = '20010228'.

free = wa_sflight-seatsocc - wa_sflight-seatsmax.

WRITE: / wa_sflight-carrid, wa_sflight-connid, free.

ENDSELECT.

The statement has the same effect as:

SELECT DISTINCT * FROM sflight INTO wa_sflight

WHERE ( carrid = 'LH' AND

connid = '2415' AND

fldate = '20010228' ) OR

( carrid = 'SQ' AND

connid = '0026' AND

fldate = '20010228' ) OR

( carrid = 'LH' AND

connid = '0400' AND

fldate = '20010228' ).

free = wa_sflight-seatsocc - wa_sflight-seatsmax.

WRITE: / wa_sflight-carrid, wa_sflight-connid, free.

ENDSELECT.

Notes

You can only use ... FOR ALL ENTRIES IN itab WHERE cond in a SELECT statement.

In the logical condition cond, the symbol itab-f is always a replacement symbol, and should not be confused with thecomponent f of the header line of the internal table itab. The internal table itab does not need to have a header line.

Each component of the internal table that occurs in a replacement symbol in the WHERE condition must have exactly thesame type and length as the corresponding component in the database table.

You cannot use replacement symbols in comparisons in LIKE, BETWEEN, or IN expressions.

If you use FOR ALL ENTRIES IN itab, you cannot use ORDER BY f1 ... fn in the ORDER-BY clause.

If you use FOR ALL ENTRIES IN itab, you cannot use a HAVING clause as well.

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 31/35

For All Entries

For all entries

FOR ALL ENTRIES

RELEVANCY SCORE

1.83Q: For All Entries(http://www.postseek.com/meta/1dda6d5504b75a8c5dc7b22a19aa38b2)

hi

is FOR ALL ENTRIES same as LEFT OUTER JOINS or INNER JOINS?

thanks in advance

bramara

A: for all entries

Read All 5 Posts (http://scn.sap.com/thread/681717)

Hi Bramara,

Please check:

http://blogs.ittoolbox.com/sap/db2/archives/for-all-entries-vs-db2-join-8912

and

JOINS vs. FOR ALL ENTRIES - Which Performs Better?

/people/rob.burbank/blog/2007/03/19/joins-vs-for-all-entries--which-performs-better

JOINs almost always outperform FOR ALL ENTRIES

and go through below thread ...

will really help u a lot..

inner join Vs View Vs for all entries

Hope it will solve ur doubt..

Thanks Regards

ilesh 24x7

RELEVANCY SCORE

1.83Q: For All Entries(http://www.postseek.com/meta/2ebd4359f3b10bcb08c3cddc7a659877)

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 32/35

is it possible to use like this.

data:itab....

select ..... from ... into itab for all entries in itab where....

A: for all entries

Read All 7 Posts (http://scn.sap.com/thread/689227)

Hi,

look at this once,

SELECT MARA~MATNR

MARA~ERSDA

MARC~WERKS

MARD~LGORT

INTO CORRESPONDING FIELDS OF TABLE IT_MAR

FROM ( ( MARA INNER JOIN MARC ON MARAMATNR = MARCMATNR )

INNER JOIN MARD ON MARAMATNR = MARDMATNR )

WHERE MARA~MATNR IN S_MATNR AND

MARA~ERSDA IN S_ERSDA AND

MARC~WERKS IN S_WERKS.

IF NOT IT_MAR[] IS INITIAL.

SORT IT_MAR.

SELECT MATNR

MAKTX

INTO CORRESPONDING FIELDS OF TABLE IT_MAK

FROM MAKT

FOR ALL ENTRIES IN IT_MAR

WHERE MATNR = IT_MAR-MATNR AND

SPRAS = SY-LANGU.

ENDIF.

DELETE ADJACENT DUPLICATES FROM IT_MAR.

RELEVANCY SCORE

1.81Q: How To Delete All Or A Range Of Calendar Entries?(http://www.postseek.com/meta/7aa2a5824bac37d2a8508ddbbe1401ad)Is it possible (as a regular user) to delete all or a range of calendar entries (e.g. all entries for july 2002)?

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 33/35

RegardsKlaus

A: How to delete all or a range of calendar entries?

Read All 1 Posts (https://community.oracle.com/thread/2007625)

Is it possible (as a regular user) to delete all or a range of calendar entries (e.g. all entries for july 2002)?

RegardsKlaus

RELEVANCY SCORE

1.78Q: Abap(http://www.postseek.com/meta/e6012707ec8cbf5ea6d52e1c2fd9f690)what are the two conditions for select for all entries?

A: ABAP

Read All 3 Posts (http://scn.sap.com/thread/619230)

here u go..1st Condition -- Press F12nd Condition -- use the search option~Suresh

RELEVANCY SCORE

1.78Q: For All Entries(http://www.postseek.com/meta/e04db3af954a3588cdf44881ec6b46e6)

HI All,

1. What is ment by for all entries in SAP ABAP.

2. How to write code for for all entries.

3. What is main pre-requisite for for all entries.

Bye,

Srinivas

A: For All Entries

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 34/35

Read All 7 Posts (http://scn.sap.com/thread/840898)

Hi Srinu,

For all entries is used to replace complex and time taking Joins.

2.

select vbeln from vbak

into table i_vbeln

where vblen in s_vbeln.

if sy-subrc = 0.

select vbeln posnr

from vbap

into table i_vbap

for all entries in i_vbak

where vbeln = i_vbap-vbeln.

endif.

3. pre requisites

make sure the driver table(in the ex: i_vbak), is not initial

sort the internal table before deleting duplicate entries.

delete the duplicate entries before using for all entries.

in the ex. above, vbeln is unique and hence no duplicate entries.

regards,

madhu

RELEVANCY SCORE

1.78Q: Api For Non-Standard Element Entries(http://www.postseek.com/meta/d7912d14ed0a70d96998cc48ee6e9536)Hi All

Can anyone specify API for creating non-standard element entries?

pay_element_entry_api.create_element_entry documentation tells that this is for creating standard entries.

Regards

- Saira

A: API for non-standard element entries

Read All 6 Posts (https://community.oracle.com/thread/641954)

You can use pay_element_entry_api.CREATE_ELEMENT_ENTRY for any element entry creation.

4/20/2015 For All Entries

http://www.postseek.com/meta/78679ba8b57ea2628875b99ab5b06fc7 35/35

RELEVANCY SCORE

1.77Q: Difference(http://www.postseek.com/meta/c2a5d087dfe66dc543b458bb7e6ccefb)

hi experts

what is the difference between

1)for all entries in

2)for correspondinf entries in

3)read table with key fields

A: difference

Read All 4 Posts (http://scn.sap.com/thread/206357)

Kunal,

First of all logically you can`t correlate all the three points. Let me explain u them :

1. FOR ALL ENTRIES IN ITAB : -- You use this option so that you can base select query`s where condition on all records ofone internal table. This option can be used to instead of the below said option :

LOOP AT ITA_MARA.

Select single maktx from makt into .... where mara = itanb-mara.

endloop.

Now your query will hit the db N times, where N = Total entries in the internal table. This affects the performanceconsiderably, hence you can use :

SELECT SINGLE MAKTX FROM MAKT INTO .....for all entries in it_mara where matnr = it_mara-matnr.

2. Read table with key fields: --- Using this syntax you can read a internal table with respect to any of its column.

Reward if helpful.

Regards