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 issue

Former Member
0 Likes
744

i have a program which is extracting large amount data like some tables mseg,mkpf its performance is very low because its getting a large amount of data into internal tables is there a solution to solve the issue.

7 REPLIES 7
Read only

Former Member
0 Likes
713

Hi,

Keep given points in mind while fetching data.

1. Always prefer SELECT rather that SELECT...ENDSELECT.

2. Always prefer INTO TABLE than INTO CORRESPONDING

FIELDS OF TABLE

3. Take only required fields into internal table and

define internal table accordingly.

4. Use all possible key fields in WHERE condition.

5. If you are specifying non-key fields in WHERE condition

then create secondary INDEX for them.

I think this will help you a lot.

Let me know if any specific reuqirement is there.

*REWARD if this helps

Read only

former_member283648
Participant
0 Likes
713

Hi chayaarungupta,

It is not a good idea to play with MSEG or MKPF tables. Instead use standard function modules which are available to read databases based on the document category. For instance MB_READ_GOODS_MOVEMENT Function module to read goods movement.

Read only

0 Likes
713

if i use the function module is it possible for me to check the condition as we check in select statement

Read only

Former Member
0 Likes
713

Hi,

use transaction SLIN & execute the same giving ur program name. U'll get all kinds of performance degrading errors/ warnings there.

Read only

Former Member
0 Likes
713

hi

for tables such as vbak mseg and mkpf its better to use function modules to retrieve data from those tables so that it improves ur performance

Read only

Former Member
0 Likes
713

I would say you can use select statments on MKPF and MSEG, but it will depend on the fields you are specifying in your WHERE clause.

If you posted your select statement may help.

Read only

Former Member
0 Likes
713

can any one tell me what function modules do i need to use for MKPF , MSEG , I am using this code

*Get MSEG data

IF i_mara[] IS NOT INITIAL.

SELECT mblnr

mjahr

zeile

bwart

matnr

werks

lgort

sobkz

bwtar

menge

wempf

bukrs

grund

INTO TABLE i_temp_mseg

FROM mseg

FOR ALL ENTRIES IN i_mara

WHERE bwart IN s_bwart AND

matnr EQ i_mara-matnr AND

werks EQ p_werks AND

lgort IN s_lgort .

IF sy-subrc EQ 0.

DELETE ADJACENT DUPLICATES FROM i_temp_mseg.

ENDIF.

ENDIF.

*Get MKPF data

IF i_temp_mseg[] IS NOT INITIAL.

SELECT mblnr

mjahr

budat

usnam

INTO TABLE i_temp_mkpf

FROM mkpf

FOR ALL ENTRIES IN i_temp_mseg

WHERE mblnr = i_temp_mseg-mblnr

AND mjahr = i_temp_mseg-mjahr

AND budat IN s_budat.

IF sy-subrc EQ 0.

DELETE ADJACENT DUPLICATES FROM i_temp_mkpf.

ENDIF.

ENDIF.

can u tell me how to improve the performance.