Ansicht
Dokumentation

BAPI_HIERA_REMOVESUBSTRUCTURE - Class Hierarchy BAPI: Delete Hierarchy (Top Down)

BAPI_HIERA_REMOVESUBSTRUCTURE - Class Hierarchy BAPI: Delete Hierarchy (Top Down)

ROGBILLS - Synchronize billing plans   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This BAPI deletes all assignments in the substructure of the instance. You can use the 'CheckAllRoots' indicator to choose one of two procedures.

If the 'CheckAllRoots' indicator is set, deletion removes the entire substructure for the instance, without affecting other classes that have part of the hierarchy as a substructure (see example).

If the 'CheckAllRoots' indicator is not set (default), all assignments in the structure are deleted. The deleted assignments are the same assignments that BAPI Class.GetSubtree would have returned.

If there is no multiple classification, do not set the 'CheckAllRoots' indicator, because this slows down system performance. The deletion logic is the same in both cases.

Table RETURN contains the log of the deletion transaction for each individual assignment in the substructure. If deletion was successful, the table contains a message of type "S", which says "The assignment of to was deleted". Otherwise, there is a similar message of type "E", with further error messages.

The most common error when deleting a hierarchy occurs if values of characteristics of the superior class have been assigned to a subordinate class or an object (such as a material). The BAPI checks that values assigned in a subordinate class do not prevent deletion. If an error message is displayed, check whether values of inherited characteristics are assigned to objects, and if they are, delete the assigned values.

Example

Class1 is the instance, with the following hierarchy:
Class2 is assigned to Class1
Class3 is assigned to Class2
Class3 is assigned to Class5
Class4 is assigned to Class3

1.) CheckAllRoots = ' '

The following assignments are deleted:
Class2 to Class1
Class3 to Class2
Class4 to Class3.

Before, Class4 was indirectly assigned to Class5. After, this is no longer the case, because all assignments whose superior class is the instance or has the instance as its superior class are deleted.

2.) CheckAllRoots = ' X'

The following assignments are deleted:
Class2 to Class1
Class3 to Class2.

The direct assignmnet of Class3 to Class5 and the indirect assignment of Class4 to Class5 remain. However, not all assignments in the substructure are deleted - only those whose only superior class is the instance or whose superior class is the instance itself.

This means that the hierarchy still contains the following assignments:
Class3 to Class5
Class4 to Class3

A second call of the BAPI for Class5 would delete these two assignments, too. The end result after calling the BAPI for each root is the same as for procedure 1.).

Notes

This BAPI is not for detaching a substructure: the substructure is completely dissolved. If you only want to detach the substructure, use BAPI Class.DeleteSubclass.

Only if table RETURN contains no messages of type "E" did the BAPI run successfully. Otherwise, some of the assignments were deleted, but others were not.

This BAPI does not change the database. To do this, call BAPI BapiService.TransactionCommit afterward.

Further information





Parameters

CHANGENUMBER
CHECKALLROOTS
CLASSNUM
CLASSTYPE
KEYDATE
RETURN

Exceptions

Function Group

CLBPH

Vendor Master (General Section)   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 4146 Date: 20240523 Time: 112932     sap01-206 ( 68 ms )