Application Development 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: 

Performance Issue While Fetching Record From MBEW Table

Former Member
0 Kudos

Hi,

We are fetching records from mbew table using key fields matnr,bwkey.

When we use for all entries option in select statement the system gets hang.

So we are using concept of package size to increase the performance.

It works fine for minimum no of records but for large no of records it doesnt work.

Kindly guide us thru efficient way to resolve this issu.

The code is attached herewith for your reference

SELECT * FROM mard

INTO TABLE it_mard_temp package size 400

FOR ALL ENTRIES IN it_s033

WHERE matnr EQ it_s033-matnr

AND werks EQ it_s033-werks.

IF sy-subrc EQ 4.

MESSAGE e002(sy) WITH 'Record not found'.

ENDIF.

IF it_mard_temp[] IS NOT INITIAL.

SELECT matnr

bwkey

verpr FROM mbew

INTO TABLE it_mbew_temp

FOR ALL ENTRIES IN it_mard_temp

WHERE matnr = it_mard_temp-matnr

AND bwkey = it_mard_temp-werks.

ENDIF.

append lines of it_mard_temp to it_mard.

append lines of it_mbew_temp to it_mbew.

refresh: it_mard_temp,it_mbew_temp.

endselect.

With Regards

***************************Point is assured **********************

4 REPLIES 4

Former Member
0 Kudos

HI...

Try using OPEN CURSOR..CLOSE CURSOR...command .

Praveen

Former Member
0 Kudos

Nope,

Try to use Logical Database, if u cant find then let me know then i would give u correct LDB to use. LDB's are way more faster then using our queries. Sorry i dont have the system now. I will also let u know how to fetch data dynamically and with static attribute.

Thanks,

Usman Malik

Former Member
0 Kudos

hi,

use the function module below it resets the runtime.

SELECT * FROM mard

INTO TABLE it_mard_temp package size 400

FOR ALL ENTRIES IN it_s033

WHERE matnr EQ it_s033-matnr

AND werks EQ it_s033-werks.

IF sy-subrc EQ 4.

MESSAGE e002(sy) WITH 'Record not found'.

ENDIF.

CALL FUNCTION 'ARCH_ANA_PROGRESS_INDICATOR'

EXPORTING

TEXT = 'Processing'.

IF it_mard_temp[] IS NOT INITIAL.

SELECT matnr

bwkey

verpr FROM mbew

INTO TABLE it_mbew_temp

FOR ALL ENTRIES IN it_mard_temp

WHERE matnr = it_mard_temp-matnr

AND bwkey = it_mard_temp-werks.

ENDIF.

append lines of it_mard_temp to it_mard.

append lines of it_mbew_temp to it_mbew.

refresh: it_mard_temp,it_mbew_temp.

endselect.

Former Member
0 Kudos

thanks shiv . point has given