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

performance query

Former Member
0 Likes
982

HI,

Im a newbie in SAP-ABAP so am requiring some guidance from you.

Ive to develop a complex report which spans more than 20-25 tables.

Is it necessary to bring all these tables in internal tables at the start of program or should i go & fetch from database as & when required.

Will fetching of all these tables into internal tables slow my report (as i believe it will increase the memory load) or fetching frequently from database will slow my report ?

For e.g if i want to have material description as one field in my report , now should i fetch entire makt table in my internal table ? Assuming my report only has 5 distinct materials , wouldnt it be more affordable to fire select query five times on the database table.

Kindly help as it is very critical & your experience is going to help me

BYe

9 REPLIES 9
Read only

GauthamV
Active Contributor
0 Likes
961

hi,

you don't require to retrive data related to all the records in the table.

Based on certain conditions you can retrive for specific fields which will not

effect system performance.

Also you can use SE30 and ST05 transactions to check your program performance

and change the statements acordingly which is consuming much amount of time.

Read only

peter_ruiz2
Active Contributor
0 Likes
961

Hi Mac,

You report would run much faster if you do the processing on Internal Tables.

- First, you need to retrieve all the data needed for the report. (Do not include other fields which will not be used)

- Do the processing of data on your Internal Tables

- Display the report output.

regards,

Peter

Read only

Former Member
0 Likes
961

Types : Begin of Itab,

Matnr type mara-matnr,

maktx type makt-maktx,

werks type mard-werks,

end of itab.

In his way you can combine all your required fields in one work area and can use that further..

Hope this is what you are looking for..

Edited by: Harini Krishna on Jan 12, 2009 6:33 AM

Read only

0 Likes
961

hey guys ,

thanks for your prompt replies.

Assuming my item master makt table has 15000 records , and i want to display descriptions of only 5 records in my report. Then should i fetch all 15000 records in internal table and then loop at internal table 5 times to get descriptions or should i fire select query on table 5 times ?

Kindly help guys.

Bye

Read only

0 Likes
961

you can restrict in the select query itself to retrive only those 5 reocrd details

into internal table and read them into final table.

Read only

Former Member
0 Likes
961

You should be having a condition for selecting the fields..

Eg..Select Maktx from makt where CONDITION...

Read only

0 Likes
961

Thanks once again guys for your time & prompt replies, let me stretch my query,

Assuming i have following data in my internal table,

Proj1 Matr1

proj1 matr2

proj2 matr1

proj2 matr3

proj3 matr2

proj3 matr3

Can any one please help me how can i populate my internal table for material descriptions? I mean the materials are repeating at different lines of report.

I understand that i should bring only those records from internal table which are relevant , but in above scenario can anyone tell me how should i write my select query ?

Read only

0 Likes
961

Hi,

make a temporary internal tables for your table with entries you mentioned.

- assign the entries to the temporary internal tables

- sort by matnr

- delete all adjacent duplicates

you will have only one entry per material. use this temporary internal table to do a for all entries in table MAKT.

e.g:

i_temp [ ] = your_table [ ] .

sort i_temp by matnr.

delete adjacent duplicates from i_temp comparing matnr.

select * from makt for all entries in i_temp where matnr = i_temp-matnr.

Regards,

Dev.

Read only

SujeetMishra
Active Contributor
0 Likes
961

Hello Mac,

create one STRUCTURE and create all your required fileds in it.

and use this structure in your program.

Use WHERE condition of all your selection screen parameters.and fetch data accordingly.

select your material description in SELECT statement and put WHERE matnr = so_matnr.

so_matnr is for User's Input.

Regards,

Sujeet

Edited by: Sujeet on Jan 12, 2009 6:50 AM