11-01-2007 8:25 AM
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 **********************
11-01-2007 8:35 AM
11-01-2007 8:41 AM
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
11-01-2007 8:42 AM
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.
01-23-2008 6:35 AM