07-20-2007 6:47 AM
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...
07-20-2007 6:49 AM
Hi,
Check wether data is there in bkpf table or not.
Query is right.
Regards
Azad.
07-20-2007 6:51 AM
i tried with join its working... but if i use for all entries its not giving any output
07-20-2007 6:52 AM
Just check whethere I_SKB1 is having any entries or not after the first select statement (from SKB1).
07-20-2007 6:55 AM
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
07-20-2007 6:58 AM
Hey,
try using into correponding fields of
Just check if it works
Azad.
07-20-2007 7:00 AM
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.
07-20-2007 7:04 AM
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.
07-20-2007 7:10 AM
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.
07-20-2007 6:58 AM
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
07-20-2007 7:12 AM
<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.