The period closing program has an extremely long runtime or terminates after several hours.
Implementing this note can considerably reduce the runtime of the period closing program if only one client exists in the R/3 System or if almost all materials are contained in a single client.
The more company codes a company has, the less the runtime will improve with the installation of this note. If you are using many company codes, we recommend that you implement Note 24948 instead.
This note replaces Note 16215.
If you have performance problems with
database systems INFORMIX, ADABAS, SQL server or DB2/600, you should apply Note 25024 and not Note 24948.
A large number of material master records exist at valuation area level or storage location level. (Technically speaking, tables MBEW and/or MARD as well as table MCHB contain a very large number of entries if you use batches.)
For Release 2.2:
================
The performance of the period closing program on ORACLE and INFORMIX database systems has been improved as of Release 2.2H.
For ADABAS, the enhanced version for all 2.2 Releases can be picked up from sapserv3 (see below for description).
For SQL server, DB2/600, and AS400 customers, no period closing program with improved performance is available for Release 2.2.
If you are using Release 2.2H or a later release on either INFORMIX or ORACLE, you already have a system version with improved performance. In this case, all you have to do is replace the command
SWITCH_ON_TUNE(1) VALUE ' '. "Performance-Tuning-Flag
with the command
SWITCH_ON_TUNE(1) VALUE 'X'. "Performance-Tuning-Flag
in Include program MM13QTOP.
In addition, use Transaction SE11 to check whether tables T001W and T001K are transparent tables. If required, change both tables to transparent tables. Otherwise the enhanced version does not become active.
If you are using an earlier release than 2.2H (or the ADABAS database system), you can import the 2.2H Version of the period closing program to your system as described in Note 13719 and then carry out the above steps. The objects concerned are stored on SAPSERV3 or SAPSERV4 in path /general/R3server/abap/note.25024. Import transport request '016491' (cofile K016491.P22 and datafile R016491.P22) from this directory.
Do not change Include MM13QTOP before you have installed the system version with improved performance because any changes you have made would otherwise be reversed.
For Release 3.0/3.1/4.0
=======================
In a Release >4.0A, you no longer need to import transports from SAPSERV3 or SAPSERV4. These transports are intended for a Release < 4.0A only. They cause syntax errors.
For customers using the INFORMIX or ORACLE database, an improved version of the system is available as of Release 3.0D.
For customers using ADABAS, SQL server, DB2/600, or AS400, an improved version of the system is available as of Release 3.1I.
In these cases, you only have to replace the command
SWITCH_ON_TUNE(1) VALUE ' '. "Performance-Tuning-Flag
with the command
SWITCH_ON_TUNE(1) VALUE 'X'. "Performance-Tuning-Flag
in Include program MM13QTOP.
Caution:
If you do not yet have an improved version of the system for the database system you are using, import the improved version as described in Note 13719.
The objects concerned are stored on SAPSERV3 or SAPSERV4 in path /general/R3server/abap/note.0025024. Import transport request '163933' (cofile K163933.P30 and datafile R163933.P30) from this directory.
Do not change Include MM13QTOP before you have installed the system version with improved performance because any changes you have made would otherwise be reversed.
For ORACLE customers, a new feature 'hash join' is available as of ORACLE Version 7.3.3.3. Up to now, this feature has been implemented in three customer systems for MMPV and has highly improved the performance.
If the material master is very large (1 million, 2 million or more rows in MBEW, MARD), it is worth implementing 'hash join'. As a result, sorts are no longer executed on ORACLE side (no PSAPTEMP anymore!).
A transport for this will be available in the near future.
Until then, simply replace the ORACLE optimizer hint
/*+ FULL(MBEW) */
with
/*+ FULL(MBEW) USE_HASH(MBEW) */
in report MM13QFSQ
The same applies to table MARD:
/*+ FULL(MARD) */
is replaced by:
/*+ FULL(MARD) USE_HASH(MARD) */
The same applies to table MCHB:
/*+ FULL(MCHB) */
is replaced by:
/*+ FULL(MCHB) USE_HASH(MCHB) */
If you are using DB2/390 or DB2/400, proceed as follows:
1) If your release is earlier than 3.1I, import transport request '163933' from SAPXERV3 bzw. SAPSERV4 as desribed above.
2) Replace in Include program MM13QTOP the command
SWITCH_ON_TUNE(1) VALUE ' '. "Performance-Tuning-Flag
by the command
SWITCH_ON_TUNE(1) VALUE 'X'. "Performance-Tuning-Flag
3) Add two lines in Include program MM13QFSQ:
.....
FORM DB_SPERRE.
IF SY-DBSYS(3) = 'INF' OR
SY-DBSYS(3) = 'SQL' OR
SY-DBSYS(3) = 'ADA' OR
SY-DBSYS(3) = 'DB2' OR "<------ Insert
SY-DBSYS(3) = 'DB4' OR "<------ Insert
SY-DBSYS(3) = 'DB6' OR
.....
4) Add two lines in Include program MM13QF00:
Dependent from your release you will not find at the beginning
of Form ARBEITEN the lines below which are not marked with 'Insert'
In this case you don't have to enter the two lines which are
marked with 'Insert'
.....
FORM ARBEITEN.
* kugl, 30.12.96. switch of tuning on only for database platforms
* ORACLE, INFORMIX, ADABAS (ADA, SQL) and SQL Server (MSS)
* all other platforms should only be used in case of emergency
IF SY-DBSYS(3) <> 'ORA' AND SY-DBSYS(3) <> 'INF' AND
SY-DBSYS(3) <> 'DB2' AND "<----- Insert
SY-DBSYS(3) <> 'DB4' AND "<----- Insert
SY-DBSYS(3) <> 'SQL' AND SY-DBSYS(3) <> 'ADA' AND
.....
5) If you are using DB2/400, implement the
corrections described down beloweith the heading: 'Special
corrections for DB2/400'.
For Releases 4.5A/4.5B/4.6A
==========================
Please also consider note 193646, if you use Release 4.5B or 4.6A.
In these releases, the note is only still relevant for the year change, since in those period changes that are not year changes at the same time, no more material master tables can be converted.
In the above-mentioned releases, replace command
SWITCH_ON_TUNE(1) VALUE ' '. "Performance-Tuning-Flag
with command
SWITCH_ON_TUNE(1) VALUE 'X'. "Performance-Tuning-Flag
im Include program MM13QTOP.
In addition, add 14 lines in program MM13QFSQ at the end of FORM routine INVENTUR_SPERREN:
. . . . . . . . .
MOVE BUKRS_TAB-BUKRS TO AUSNAHME_TAB-BUKRS.
APPEND AUSNAHME_TAB.
ENDIF.
IF SWITCH_ON_TUNE NE SPACE. "<--- Insert
IF SY-DBSYS(3) = 'INF' OR "<--- Insert
SY-DBSYS(3) = 'SQL' OR "<--- Insert
SY-DBSYS(3) = 'ADA' OR "<--- Insert
SY-DBSYS(3) = 'DB2' OR "<--- Insert
SY-DBSYS(3) = 'DB4' OR "<--- Insert
SY-DBSYS(3) = 'DB6' OR "<--- Insert
SY-DBSYS(3) = 'MSS' . "<--- Insert
IF MBEW_LOCK = SPACE. "<--- Insert
MBEW_LOCK = MARC_LOCK = 'X'. "<--- Insert
PERFORM SPERREN. "<--- Insert
ENDIF. "<--- Insert
ENDIF. "<--- Insert
ENDIF. "<--- Insert
ENDFORM.
In addition, in program MM13QFSQ in FORM routine SPERREN two lines are to be deleted und 4 lines to be added:
a) in Release 4.5A:
FORM SPERREN.
CLEAR FEHLERFLAG.
CLEAR: MBEW_LOCK, MARC_LOCK.
* IF RM03Q-KZINV NE SPACE. "<--- Delete
IF RM03Q-KZINV NE SPACE "<--- Insert
OR MARC_LOCK NE SPACE. "<--- Insert
* Nur noch bei Initialiserung sperren
. . . . . . . . .
* if t001k-mlbwa ne space or rm03q-kzinv ne space. "<--- Delete
if t001k-mlbwa ne space or rm03q-kzinv ne space "<--- Insert
or mbew_lock ne space. "<--- Insert
call function 'ENQUEUE_EMMBEWE'
exceptions
foreign_lock = 2
system_failure = 3.
if sy-subrc = 2.
. . . . . . . . .
b) in Release 4.5B or 4.6A
FORM SPERREN.
CLEAR FEHLERFLAG.
CLEAR: MBEW_LOCK, MARC_LOCK.
* IF RM03Q-KZINV NE SPACE. "<--- Delete
IF RM03Q-KZINV NE SPACE "<--- Insert
OR MARC_LOCK NE SPACE. "<--- Insert
* Nur noch bei Initialisierung sperren
. . . . . . . . .
*F T001K-MLBWA NE SPACE OR RM03Q-KZINV NE SPACE.
* IF RM03Q-KZINV NE SPACE. "<--- Delete
IF RM03Q-KZINV NE SPACE "<--- Insert
OR MBEW_LOCK NE SPACE. "<--- Insert
CALL FUNCTION 'ENQUEUE_EMMBEWE'
EXCEPTIONS
FOREIGN_LOCK = 2
SYSTEM_FAILURE = 3.
. . . . . . . . .
Finally, add a line in Release 4.5A in program MM13QFSQ in FORM routine DB_SPERRE:
form db_sperre.
if sy-dbsys(3) = 'INF' or
sy-dbsys(3) = 'SQL' or
sy-dbsys(3) = 'ADA' or
sy-dbsys(3) = 'DB2' or "<----- Insert
sy-dbsys(3) = 'DB6' or
sy-dbsys(3) = 'MSS' .
. . . . . . . . .
Special corrections for DB2/400 (for all releases as of Release .0)
============================================================
Delete one line and add two lines in the following FORM routines in program MM13QFSQ:
- FORM MARD_UPDATE_JW_DB2DB4
- FORM MCHB_UPDATE_JW_DB2DB4
- FORM MSKA_UPDATE_JW_DB2DB4
- FORM MSKU_UPDATE_JW_DB2DB4
- FORM MARD_UPDATE_DB2DB4 (only for Release 4.0)
- FORM MCHB_UPDATE_DB2DB4 (only for Release 4.0)
- FORM MSKA_UPDATE_DB2DB4 (only for Release 4.0)
- FORM MSKU_UPDATE_DB2DB4 (only for Release 4.0)
- FORM MSSA_UPDATE_DB2DB4 (only for Release 4.0)
Depending on the level of your Hot Package and what the source code looks like, implement either Correction A) or alternatively, Correction B) :
Correction A):
. . . . . .
AND WERKS IN ( SELECT WERKS FROM T001W WHERE BWKEY IN
( SELECT BWKEY FROM T001K WHERE BUKRS
* = :BUKRS_TAB-BUKRS ) ) <---- Delete
= :BUKRS_TAB-BUKRS GROUP BY BWKEY ) <---- Insert
GROUP BY WERKS ) <---- Insert
ENDEXEC.
. . . . . .
Correction B):
. . . . . .
AND WERKS IN ( SELECT WERKS FROM T001W
WHERE MANDT = :SY-MANDT AND BWKEY IN
( SELECT BWKEY FROM T001K
WHERE MANDT = :SY-MANDT AND
* BUKRS = :BUKRS_TAB-BUKRS ) ) <-- Delete
BUKRS = :BUKRS_TAB-BUKRS GROUP BY BWKEY ) <-- Insert
GROUP BY WERKS ) <-- Insert
ENDEXEC.
. . . . . .
Delete a line and add two in program MM13QFSQ in the following FORM routines:
- FORM MBEW_UPDATE_JW_DB2DB4 (only for Release 4.0)
- FORM MBEW_UPDATE_DB2DB4 (only for Release 4.0) Depending on the level of your Hot Package and what the source code looks like, implement either Correction A) or alternatively, Correction B):
Correction A):
. . . . . .
AND BWKEY IN ( SELECT BWKEY FROM T001K WHERE BUKRS
= :BUKRS_TAB-BUKRS ) <-- Delete
= :BUKRS_TAB-BUKRS GROUP BY BWKEY ) <-- Insert
ENDEXEC.
. . . . . .
Correction B):
. . . . . .
AND BWKEY IN ( SELECT BWKEY FROM T001K
WHERE MANDT = :SY-MANDT AND
* BUKRS = :BUKRS_TAB-BUKRS ) <-- Delete
BUKRS = :BUKRS_TAB-BUKRS GROUP BY BWKEY ) <-- Insert
ENDEXEC.
. . . . . .
Additional key words
Transaction MMPV, program RMMMPERI,
databases INFORMIX/ORACLE, INFTUNE, DBTUNE, ADATUNE, ORATUNE, PSAPTEMP
overflow
No comments:
Post a Comment