14.9.11

SAP Note 27416 - Standard Hierarchy Repair

Symptom:

Error message: None
Description:
The standard hierarchy (cost centers, profit centers, business processes) is inconsistent:

  • Nodes are missing in the hierarchy or nodes are included which do not belong to the hierarchy.
  • Individual values (cost centers, profit centers, business processes) are missing or too many individual values are included or they are assigned to an incorrect node.

Transactions: KSH1 KCH1 CPH1 KSH1 KCH1 CPH1
KSH2 KCH2 CPH2
KSH3 KCH3 CPH3
Program name: SAPLGRZZ

Cause and prerequisites

In general, inconsistent data imports from other clients or systems (client copy; up to and including Release 2.2: transports of Report Writer objects linked to standard hierarchies; object imports from different clients/systems).
With client copy, "empty" standard hierarchies are created in a client which does not contain master data.
Important note: The assignment between master data and standard hierarchy is carried out exclusively when creating/changing master data. Therefore, always transport master data and standard hierarchy only from the system in which this data was created.

Solution

There are different options for repairing hierarchies.
If the structure of the standard hierarchy is correct but does not contain individual values (cost centers, profit centers, or business processes) or includes them at an incorrect location, use the appropriate master data transactions ("Change") for the repair. If an incorrect node is entered in the master record (field hierarchy area), you must enter and save the correct node in the master record. If, however, the correct node is specified in the master record but this hierarchy node does not contain the value, you must make the master record change twice. The first time, you enter any other hierarchy node and save the change. You then enter the original node again and save this change as well.
Remark:
Values contained in the hierarchy for which no master record exists cannot be removed from the hierarchy this way.
If, however, your standard hierarchy has greater discrepancies both concerning the hierarchy structure and with respect to the contained individual values, you must choose another procedure:

    1. Check whether there is another client in which the respective standard hierarchy exists correctly. On the condition that the quantity of the master records, including their assignments to the hierarchy nodes, is identical, you can import the respective standard hierarchy from the other client.

To do this, use the Report Writer transport tools (transaction GS02 -> "Environment -> Transport ..."). The "Copy from client" function is available within the same system. For all systems, you must first write the standard hierarchy to a sequential file in the source system using the "Export" function. Then use the "Import" function in the import system to create the standard hierarchy there again. With the import, existing nodes are overwritten. Missing nodes are created. Unnecessary nodes are not deleted but removed from the standard hierarchy.
The input values for the Report Writer transport tools can be found in note 17940.
Note for Release 2.2: In order to use the Report Writer transport tools successfully, the protection of the standard hierarchy must be cancelled temporarily with a small program in the target system (!) and must be restored again after the import (!!!).
The procedure is described in detail in note 17940.

    2. If a correct standard hierarchy does not exist anymore in any system, correction program RKCORRH1 can help repair the standard hierarchy.

You can find the program on SAPSERV3 under the directory
dist/permanent/Note.0027416 .
The file names are
R922685.Q30 und K922685.Q30 "<<< 3.0-Version
R900074.Z2A und K900074.Z2A "<<< 2.2-Version
Have your system administrator import the program into the required system (the procedure is described in note 13719). You must adapt the program code for a 2.1 release (see below). In 2.2 and 3.0, the programs can be run immediately.
The program has the following input parameters:
Controlling area (controlling area in question)
HierTyp (KOSTL-PRZNR-PRCTR) KOSTL (for cost centers)
PRZNR (for business processes, as of 2.2)
PRCTR (for profit center, Release <= 2.2)
RPRCTR (for profit center, Release >= 3.0)
Test run X (yes) / ' ' (no = production run)
(As of Rel. 3.0, the report can be accessed directly via group maintenance).
The program compares the hierarchy areas stored in master data with the standard hierarchy and adapts the hierarchy to master data (NOT vice- versa). The following actions are carried out:

  • All incorrect items of individual values in the hierarchy are corrected by INSERT/DELETE, unnecessary values are removed (DELETE), and missing ones are entered in the corresponding node (INSERT).
  • If a node is missing in the hierarchy which nevertheless exists in the system, it is inserted again (INSERT); if it does not exist, it is created again (GENERATE). A dummy node (SAP-...) is created at the 2nd location in the hierarchy and all inserted nodes are subordinated to this dummy node.
All actions are written to the log.
An inconsistent hierarchy structure CANNOT be reconstructed by the program. Only the assignment master record/hierarchy area is cleared. You may have to restore the old structure manually with the use of group maintenance. If in this case a group is inserted that still exists in the system, you may have to disconnect (not delete) the end nodes from the group to be inserted prior to inserting. Once the old structure is restored, the nodes under the dummy node can be connected to the correct position and then the dummy node can be deleted.
Start the program in test run first. If you agree with the changes according to the log, execute the program in production run.

No comments:

Post a Comment