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

problem with for all entries

Former Member
0 Likes
2,536

Hi all,

When i was trying to use for all entries, i am not able to pull records inside my internal table. Though both of the tables have the common key fields between them(and ofcourse have entries in that). Now what i have analyzed was, the first table is having 7 primary keys and the one i am using for 'for all entries' comes 6th. Does this gives any impact in pulling records inside my internal table?.Else please give me a possible solution for this. The alternate statement(a normal select query with * ) that i had used for this reserved my dialog processor for a while. Which resulted in 'time exceeded' short dump.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,353

Hi Feddie,

Can you kindly paste your code.

Regards,

Nene

9 REPLIES 9
Read only

Former Member
0 Likes
2,354

Hi Feddie,

Can you kindly paste your code.

Regards,

Nene

Read only

Former Member
0 Likes
2,353

Hi,

The WHERE clause of the SELECT statement has a special variant that allows you to derive conditions from the lines and columns of an internal table:

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

<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 each line, the system selects the lines from the database table that satisfy the condition. The result set of the SELECT statement is the union of the individual selections for each line of the internal table. Duplicate lines are automatically eliminated from the 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 be compatible with the column of the database with which it is compared. Do not use the operators LIKE, BETWEEN, and IN in 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 can significantly improve the performance for large sets of selected data.

Hope this is useful

Reema

Read only

0 Likes
2,353

Thanks to all,

I am still analyzing the code for improving the performance. I dropped the idea of using for all entries. I need some more clarifications before modifying the code,

1. When i am trying to use an IDOC for updating my table it is taking very less time to update my table. But in normal abap coding if we are doing why it is taking so much time to update the table. Means how can i optimize my code? When i am debugging the Idoc it is taking me to a BAPI program. Does that mean BAPI are optimized for the code and it is tuned well. How SAP does that? Guys i am also trying to debugg the standard programs to understand(ofcourse R&D), If any one of have an idea about optimizing the code and fine tunning please share your views.

Read only

0 Likes
2,353

And thanks to all of you for your response. Thus I am confident about my code, i am not pasting it here. But improving the performance is the problem. Please anyone of you throw some light on that?

Read only

0 Likes
2,353

I'd suggest you run the SQL Trace while using SAP's code, and then again with yours. You can then compare the different access paths taken to get to the relevant data. From within the SQL Trace you can also drill down to the SAP source code to examine exactly how they have constructed their selects etc.

Read only

0 Likes
2,353

Hi Feddie,

If the BAPI is available then just use it as they are made after lots of research and have the most optimized code.

Regards,

Atish

Read only

0 Likes
2,353

Hi.

I think that your problem in the program is with your sql statement which you use, if it is a simple sql statement then check the syntax or if if it is joining you use then also check that whether you cant join more than 3 tables.

the second thing is that wht you try to use bapi or IDOC if it is using BAPI then i thnk that you have to follow how to create BAPI if you are not using BAPI then also check your function call coz u r parameter is not passing properly thts why it takes less time and also not working properly.

Thanks & Regards

Shambhunath

Read only

Former Member
0 Likes
2,353

Hi

Can i have your select statement here plz. I'll make some modifications

Reward all helpfull answers

Regards

Pavan

Read only

Former Member
0 Likes
2,353

Thanks to all of you