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

Select query or RH_READ_INFTY?

Former Member
0 Likes
894

Hello experts,

I have a report where I am fetching the Work schedule(IT 0007) for all employees for all the period. I have written a select query for the same. I am planning to replace it with FM RH_READ_INFTY. Since I am not using LDB, I cannot use Macros to read data.

I ran a trace using both to find performances of both, but couldnt actually figure out as it doesnt show the time taken by FM. Instead it shows select queries fired on PA0007 table(which I am doing in first place).

So please guide me as to which approach I should follow in this or any general case when it comes to reading IT data without using LDB.

Thanx!,

HOward.

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
767

It really depends on your requirement. If you go for custom select query, you just extract specific information from the system skipping all the authorization checks, the buffering (which might be extra beneficial while doing a query several times for huge population). Taking the standard approach, brings that all to you without any efford and worries from your side. It is also optimized in terms of the performance.

Anyhow I guess you would be calling this fm for each EE separately, which means you open connection to DB for every EE separately. This can have influence on the performance as well. The custom select can be optimzed to establish the communication with DB only once for whole population (which of course means more complicated query to analyze by DB Optimizer but the data would be transported in one run).

So in my opinion taking above considerations and comparing those should lead you to the answer which one is the better choice.

Regards

Marcin

4 REPLIES 4
Read only

MarcinPciak
Active Contributor
0 Likes
768

It really depends on your requirement. If you go for custom select query, you just extract specific information from the system skipping all the authorization checks, the buffering (which might be extra beneficial while doing a query several times for huge population). Taking the standard approach, brings that all to you without any efford and worries from your side. It is also optimized in terms of the performance.

Anyhow I guess you would be calling this fm for each EE separately, which means you open connection to DB for every EE separately. This can have influence on the performance as well. The custom select can be optimzed to establish the communication with DB only once for whole population (which of course means more complicated query to analyze by DB Optimizer but the data would be transported in one run).

So in my opinion taking above considerations and comparing those should lead you to the answer which one is the better choice.

Regards

Marcin

Read only

0 Likes
767

Hello Marcin,

Thankyou for your valuable response.

I guess you would be calling this fm for each EE separately

Yes. I am looping on all PERNRs and have to fetch data for around 4-6 infotypes for each employee.

So I guess I will have to use this FM 4-6 times for each employee. Even with the FM, it must opening a database connection.

I feel, it would be as bad as firing select queries inside a loop.

The custom select can be optimzed to establish the communication 
with DB only once for whole population (which of course means more complicated 
query to analyze by DB Optimizer but the data would be transported in one run).

As you said,

What I have done is, fired queries on all PA tables for respective infotypes and fetched the all the data in one shot.

Later I have used READ statement to get the data I want.

It really depends on your requirement. If you go for custom select query, 
you just extract specific information from the system skipping all the authorization checks,

That might be a crucial issue. What are the authorization checks here we are talking about?

Does the FM read data from any

other tables than we do in select queries?

Thnx!

Howard

Read only

0 Likes
767

You're welcome Howard.

What I have done is, fired queries on all PA tables for respective infotypes and fetched the all the data in one shot.

Later I have used READ statement to get the data I want.

This is really important and good approach. As long as you tranport all data to the program and keep working with them right there, you improve the performance a lot.

That might be a crucial issue. What are the authorization checks here we are talking about?

Does the FM read data from any

other tables than we do in select queries?

When you run the report it is you who will be querying at Infotype tables, so you must have correct authorization to access all these tables for all these EEs. Usually this is a case when you use such stadard fm in some portal application. Here users are attached to different EEs, who might miss the authorization to access EE Master Data. This is most often not a case for reading the data, but for editing them. Anyhow we have faced couple of such issues, where for only certain group we couldn't execute standard fm correctly (due to lack of authorization).

So as long as you are the only person (or some agent who performs montly reporting) runs the report and have correct authorization to access these data, this issue is not relevant. But if you plan to have multiple users of that application/report, the authoraztions should not be treated trivialy. All in all you are accessing sensitive EE data, so you should keep this in mind.

Regards

Marcin

Read only

0 Likes
767

Thank you marcin!

That was really helpful.

I guess I would better stick to my select query for this time atleast.

Thnx,

Howard.