‎2010 Jan 09 3:54 PM
Hello Gurus,
I am having a strange situation. I am pulling data from COEP table and I found out its not pulling all the data (missing thousands).
This is the Select statement I used:
IF i_objnum[] IS NOT INITIAL.
SELECT belnr perio wogbtr objnr kstar gkont matnr
FROM coep INTO TABLE i_inicoep
FOR ALL ENTRIES IN i_objnum
WHERE objnr = i_objnum-objnr AND
lednr = '00' AND
gjahr = p_fyear AND
kokrs = '9999' AND
werks = p_werks AND
perio IN s_perio.
When I used the same criteria and selection to go to check the results in the database (SE11). I was missing thousands of data.
Is there something I'm doing wrong. A good example is from the last debug, i was missing almost 6,000 data.
Thanks.
‎2010 Jan 09 4:24 PM
In for all entries
Duplicate lines are automatically eliminated from the result set.
So try passing all the key fields.
‎2010 Jan 09 4:24 PM
In for all entries
Duplicate lines are automatically eliminated from the result set.
So try passing all the key fields.
‎2010 Jan 09 5:36 PM
Thanks for the prompt reply. I tried that and used all the key fields. It took a while to retrieve the data and it was a lot of data.
Then when i did a loop to to filter the results to take out data not in the i_objnum it takes a long time and eventually time out into a dump saying its reached its 2400s time limit.
‎2010 Jan 10 8:40 AM
Appears that you are using objnr only to fetch records from database table.
Can you try inner join or view and check .
Hope this helps you.
‎2010 Jan 10 9:09 AM
Dear Basil,
there might be problem with the structure of ur internal tables.
I faced a problem somewhat like this and found that there is missmatch in the defination of one of the fields of 2 internal tables.
check objnr is same tyee as i_objnum-objnr AND
lednr is of char type (= '00')
gjahr and p_fyear are of same type
kokrs is char '('9999')
werks and p_werks are of same type
perio and s_perio are of same type.
‎2010 Jan 11 9:13 PM
check the below code
try to fetch all the key field while using for all entries
IF i_objnum[] IS NOT INITIAL.
SELECT KOKRS
belnr
BUZEI
perio
wogbtr
objnr
kstar
gkont
matnr
FROM coep INTO TABLE i_inicoep
FOR ALL ENTRIES IN i_objnum
WHERE perio IN s_perio and
kokrs = '9999' AND
lednr = '00' AND
objnr = i_objnum-objnr AND
gjahr = p_fyear AND
werks = p_werks.
Now you will get all the entries from the table
Please let me know if you face any problem still
Regards
Satish Boguda
.
‎2010 Jan 25 6:24 AM
hi,
try to trigger the primary index of this table by using the key fields in the sequence they are in the table you can pass a constant GE to these key fields whose value is initial for which you dont have any where condition also while using for all enrties try to select all the key fields.
rgds
shivraj
‎2010 Jan 25 6:36 AM
hi,
On using the FOR ALL ENTRIES must remember on thing that select all the primary fields of that table.
in you condition you are not selcting all the primary fields from the COEP Table , try this..
hope this helps
Regards
Ritesh
‎2010 Jan 27 12:00 PM
Hi Basil Balogun,
please check with above suggestions and also check with Read statement in the Loop.
It will consume lot of time to read the Internal table with whatever conditions you have specified.
Check the READ statement that you are using in the program.
Make sure that you are sorting the Internal table by key field and using Binary search.
This will fix the issue in many cases.
Ex :
SORT T_PRT BY GUID_PR.
READ TABLE T_PRT INTO WA_PRT WITH KEY GUID_PR = WA_PR-GUID_PR BINARY SEARCH.This should help resolve the performance issue.
Regards,
KIttu