Application Development 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: 

for all entries

Former Member
0 Kudos

DATA:I_SKB1 LIKE SKB1 OCCURS 2 WITH HEADER LINE,

I_BKPF LIKE BKPF OCCURS 2 WITH HEADER LINE.

SELECT BUKRS SAKNR

FROM SKB1

INTO TABLE I_SKB1

WHERE BUKRS IN COMPCODE

AND SAKNR IN GLACCT.

IF NOT I_SKB1[] IS INITIAL.

SELECT BUKRS BELNR BLART

FROM BKPF

INTO TABLE I_BKPF

FOR ALL ENTRIES IN I_SKB1

WHERE BUKRS = I_SKB1-BUKRS.

ENDIF.

i have written the above query, syntactically its correct but its not giving any output

anybody help me pls..

Regards,

pandu...

10 REPLIES 10

Former Member
0 Kudos

Hi,

Check wether data is there in bkpf table or not.

Query is right.

Regards

Azad.

0 Kudos

i tried with join its working... but if i use for all entries its not giving any output

Former Member
0 Kudos

Just check whethere I_SKB1 is having any entries or not after the first select statement (from SKB1).

Former Member
0 Kudos

Hi

Have youd eclared COMPCODE and GLACCT as select options

first manually goto SE16 enter this company code and GL account and check whether data is there in SKB1 table or not

then for that company code check for the data in BKPF table also in Se16.

and try to give some more conditions like BLART and BUDAT for the BKPF where condition.(Though it is concerned with data fetching)

<b>Reward points for useful Answers</b>

Regards

Anji

0 Kudos

Hey,

try using into correponding fields of

Just check if it works

Azad.

0 Kudos

ya i declared....

but its working with inner join....

and the data is also there.. its not giving any output with for all entries only...

Regards,

pandu.

0 Kudos

Change your select statements as below.

SELECT * FROM SKB1
INTO TABLE I_SKB1
WHERE BUKRS IN COMPCODE
AND SAKNR IN GLACCT.

IF NOT I_SKB1[] IS INITIAL.
SELECT BUKRS BELNR BLART
FROM BKPF
INTO CORRESPONDING FIELDS OF TABLE I_BKPF
FOR ALL ENTRIES IN I_SKB1
WHERE BUKRS = I_SKB1-BUKRS.
ENDIF.

0 Kudos

i got it now..

how to write for all entries.. if have more than two internal tables..

but all the internal tables not having commmon fields.. its having like 1 & 2 is having common and 2 & 3 is having common.. but i have to print it out all the three internal table fields..

if possible any eq pls..

Regards,

pandu.

Former Member
0 Kudos

Hi,

Try this -

Use Corresponding

SELECT BUKRS BELNR BLART

FROM BKPF

INTO <b>corresponding fields of</b> TABLE I_BKPF

FOR ALL ENTRIES IN I_SKB1

WHERE BUKRS = I_SKB1-BUKRS.

Hope this helps.

Regds

Seema

Ashutosht09
Participant
0 Kudos

<b>Use of FOR ALL Entries</b>

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

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

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

3. 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.

Your problem might be because of point 1.

Award points if this is helpful.