Sapass

 Simplify SAP R/3 development with Excel VBA/VB RFC  
Home> Bapi>Class



Index

Class

Class


The business object Class is a group of similar objects
described by means of characteristics that they have in common.

Structure

A class has characteristics that describe the properties of classifiable objects. You can define allowed values for these
characteristics.

Comment
Examples of classifiable objects are:



  • Materials

  • Batches

  • Documents

  • 11-Dec-2005


    Methods

    Available Methods


    • AddSubclassAllocation : Create Assignment to Subordinate Class [ BAPI_HIERA_ADDSUBCLASS ]
    • AddSubstructure : Create Hierarchy (Downward) [ BAPI_HIERA_ADDSUBSTRUCTURE ]
    • Change : Change Class [ BAPI_CLASS_CHANGE ]
    • ChangeSubclassValidation : Change Assignment of Subordinate Class [ BAPI_HIERA_CHANGESUBCLASS ]
    • ChangeSubstructure : Change Hierarchy (Downward) [ BAPI_HIERA_CHANGESUBSTRUCTURE ]
    • CheckSubclassAllocation : Existence Check: Assignment to Subclass [ BAPI_HIERA_CHECKSUBCLASSALLOC ]
    • Create : Create Class [ BAPI_CLASS_CREATE ]
    • Delete : Delete Class [ BAPI_CLASS_DELETE ]
    • ExistenceCheck : Check Existence of Object [ BAPI_CLASS_EXISTENCECHECK ]
    • GetCharacteristics : Returns Chars with Attributes and Values for Class [ BAPI_CLASS_GET_CHARACTERISTICS ]
    • GetClassifications : Read Values Assigned to Objects in Class [ BAPI_CLASS_GET_CLASSIFICATIONS ] (Obsolete in 46C)
    • GetDetail : Read Class Information [ BAPI_CLASS_GETDETAIL ]
    • GetDetailSubclassAllocation : Assignment Info for subordinate Class [ BAPI_HIERA_GETDETAILSUBCLASS ]
    • GetList : Read Classes [ BAPI_CLASS_GETLIST ]
    • Getstatus : Status information [ BAPI_CLASS_GETSTATUS ]
    • GetSubclassAllocations : Subordinate Classes (Direct) [ BAPI_HIERA_GETSUBCLASSALLOCS ]
    • GetSubstructure : Read Hierarchy Downward [ BAPI_HIERA_GETSUBSTRUCTURE ]
    • GetSuperclassAllocations : Superior Classes (Direct) [ BAPI_HIERA_GETSUPERCLASSALLOCS ]
    • GetSuperstructure : Read Hierarchy Upward [ BAPI_HIERA_GETSUPERSTRUCTURE ]
    • RemoveSubclass : Delete Assignment to Subordinate Class [ BAPI_HIERA_REMOVESUBCLASS ]
    • RemoveSubstructure : Delete Hierarchy (Downward) [ BAPI_HIERA_REMOVESUBSTRUCTURE ]
    • Rename : Rename class [ BAPI_CLASS_RENAME ]
    • SelectObjects : Find Objects in Class [ BAPI_CLASS_SELECT_OBJECTS ]

    11-Dec-2005


    AddSubclassAllocation

    AddSubclassAllocation


    This BAPI assigns a subordinate class to a superior class and assigns values to characteristics for the assignment.

    The superior class is specified in field 'ClassNum', the subordinateclass in field 'Subclass', and the class type in field 'ClassType'. The
    classification status is set in field 'Status'. You can also specify adate ('KeyDate'). The characteristics and their values are in table 'HierarchyValues'.

    If the BAPI runs successfully, table RETURN contains no messages of type 'E'.

    Notes


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


    11-Dec-2005


    AddSubstructure

    AddSubstructure


    This BAPI creates a class hierarchy whose root is the instance. Theclasses involved must all exist. You cannot assign values to the assignments, because this would involve too much data.

    The instance is defined by the class name ('ClassNum') and the class
    type ('ClassType'). You can also specify a date ('KeyDate') and a change number ('ChangeNumber').

    The structure you create is transferred in table 'SubtreeList'. In thistable, the fields 'ClassName' (class), 'ChildName' (subordinate class),'Level' (hierarchy level), 'Link' (multiple classification indicator),
    and 'Status' must be filled correctly. The fields 'RightName' and'LeftName' are irrelevant here, and the 'Description' field is ignored.

    'ClassName' contains the class to which you want to assign the class in'ChildName'. The classification status is specified in 'Status'. The
    hierarchy levels ('Level') can be anything you like, but we recommendassigning level 1 to the instance, level 2 to its immediate subordinateclasses, and so on. In any case, the level of a class must always be higher than the level of its subordinate class. If multiple
    classification applies, the field 'Link' must be set. When a class isassigned to a second superior class, this field contains the entry 'X'. The sequence of entries in the table is irrelevant.

    First, the structure is checked for consistency. If errors are found,
    nothing is created, and the BAPI just returns the error log. The following rules are checked:

    1. The instance is the only class without a superior class.
    2. Each class used exists and is valid.
    3. Each assignment is unique (no other entry has the same classes for 'ClassName' and 'ChildName').

    4. Each class in field 'ChildName' also occurs in field 'ClassName'.(Classes without subordinate classes have an entry with an empty 'ChildName' field.)
    5. A class is always on the same hierarchy level ('Level').
    6. The hierarchy level of each class is higher than the level of its superior class (the one without the 'Link' indicator).

    7. The hierarchy is not recursive - no class is (indirectly) assigned toitself. This rule applies to both the structure being created and all superior classes of the instance.
    8. Each class in field 'ChildName' has exactly one entry without the 'Link' indicator.

    The results are logged in table RETURN. This contains either the errormessages from the consistency check only, or the error/success messagesfrom creating the individual assignments. In the former case, eachentry contains the information required to identify the error. In the
    latter case, each assignment has the message "The assignment of class Xto class Y was (not) created", with the appropriate message type "E" or"S". Before this message, there are detailed messages on the causes oferrors, but without identifying which belongs to which assignment.


    Example

    The instance is Class1.
    It is to contain subordinate classes Class2 and Class3. Class2 hassubordinate class Class4, which has subordinate class Class5. Class5 isalso assigned to Class3. The table then looks as follows (not all fields are shown):


    ClassName ChildName Level Link

    Class1 Class2 1

    Class1 Class3 1

    Class2 Class4 2

    Class3 Class5 2 X

    Class4 Class5 3

    Notes


    Ensure that you evalute table RETURN accurately, because this BAPI doesnot deliver a result that is either "correct" or "incorrect". If you want to know what has actually been created, you can use BAPIClass.GetSubstructure to display the hierarchy you have created.


    Large hierarchies slow down system performance. If you only want tocreate one assignment, always use BAPI Class.CreateSubclassAllocation.

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


    11-Dec-2005


    Change

    Change


    This function module changes a class and its data.

    Important

    Structures and tables for new data that enter with NEW must be maintained correctly.

  • If these structures or tables are empty, the data in them is deleted.
  • If no data is to be changed, the structures and tables ending with NEW must match the current data.

  • To fill structures and tables with current data, use the relevant GETDETAIL module to copy the old data from the class first.
  • The class-specific overwrite data for characteristics and values mustbe made available using the data copied by calling the GETDETAIL module.


    If nothing is transferred in these tables, there is no overwrite.

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


    11-Dec-2005


    ChangeSubclassValidation

    ChangeSubclassValidation


    This BAPI changes the assignment of a subordinate class to a superiorclass with its assigned values, or creates the assignment with assigned values, if the assignment does not yet exist.

    The superior class is transferred in field 'ClassNum', the subordinate
    class in field 'Subclass', and the class type in field 'ClassType'. Theclassification status is set in field 'StatusNew'. You can alsotransfer a date ('KeyDate'). The characteristics with the new values are in table 'HierarchyValuesNew'.

    If the BAPI runs successfully, table 'Return' contains no messages of type 'E'.


    Notes

    The information transferred by the BAPI replaces the old datacompletely, so that an empty entry means "delete old entry", not "no change".

    This BAPI does not change the database. To do this, BAPI BapiService.TransactionCommit must be called afterward.



    11-Dec-2005


    ChangeSubstructure

    ChangeSubstructure


    This BAPI changes a class hierarchy whose root is the instance. Theclasses involved must all exist. You cannot assign values to theassignments, because this would lead to quantities of data that are too large.

    Any assignment that does not exist yet is created. Any assignment that
    already exists is changed. Any assignment that exists, but is not in the table, is deleted.

    The instance is defined by the class name ('ClassNum') and the classtype ('ClassType'). You can also specify a date ('KeyDate') and a change number ('ChangeNumber').


    The structure to be changed is transferred in table 'SubtreeList'. Thismust contain correct entries for the fields 'ClassName' (class), 'ChildName' (subordinate class), 'Level' (hierarchy level), 'Link'(multiple classification indicator), and 'Status'. The fields
    RightName' and 'LeftName' are not relevant here, and the 'Description' field is ignored.

    'ClassName' contains the class to which you want the class in 'ChildName' assigned. The classification status is specified in'Status'. The hierarchy levels ('Level') can be anything you want, but
    we recommend that you assign level 1 to the instance, level 2 to itssubordinate classes, and so on. The level of each class must be higherthan the level of its superior classes. If multiple classificationoccurs, the 'Link' field must be set. When you assign the class to
    another superior class, this field contains the entry 'X'. The entries in the table can be in any sequence.

    First, a consistency check is run on the structure. If errors arefound, no changes are made, and the BAPI returns an error log. The check uses the following rules:


    1. The instance is the only class without a superior class.
    2. Each class used exists and is valid.
    3. Each assignment occurs only once (there is no other entry that has the same classes for 'ClassName' and 'ChildName').
    4. Each class in field 'ChildName' also occurs in field 'ClassName'. (The
      classes that have no subordinate classes have an entry with the 'ChildName' left blank.)
    5. Each class only occurs on one hierarchy level ('Level').
    6. The hierarchy level of each class is higher than the level of itssuperior class (the superior class without the 'Link' indicator).

    7. The hierarchy is not recursive. In other words, no class is assigned toitself (indirectly). This applies both to the structure to be changed and to all superior classes of the instance.
    8. Each class in field 'ChildName' has exactly one entry without the 'Link' indicator.

    The results are logged in table Return. This table contains either onlythe error messages from the consistency check, or error/successmessages for creating/changing/deleting the individual assignments. Inthe former case, each entry contains the information that is required
    to identify the error. In the latter case, each assignment has the message "The assignment of class X to class Y was (not)created/changed/deleted" with the message type 'E' or 'S'. Before thismessage are detailed messages on causes of error, but the actual assignment is not identified.


    Example

    The instance is Class1.
    This class is to contain subordinate classes Class2 and Class3. Class2has subordinate class Class4, which has subordinate class Class5.Class5 is also assigned to Class3. The contents of the table are shown below (not all fields are shown):


    ClassName ChildName Level Link
    ------------------------------------------------------------
    Class1 Class2 1
    Class1 Class3 1
    Class2 Class4 2
    Class3 Class5 2 X
    Class4 Class5 3


    Notes

    It is necessary to evaluate table 'Return' accurately, because thisBAPI does not tend to return a 'true' or 'false' result. If you want toknow what actually happened, you can also display the new hierarchy by using BAPI Class.GetSubstructure.


    Large hierarchies slow down system performance a lot. If you only wantto change a few assignments, use BAPI Class.ChangeSubclassAllocation orClass.DeleteSubclassAllocation for the individual assignments.

    Caution
    Each assignment that exists, but is not in the table, is deleted. If
    you do want this, you must transfer the entire substructure, including assignments that are not to be changed.

    This BAPI does not change the database. To do this, BAPI BapiService.TransactionCommit must be called afterward.


    11-Dec-2005


    CheckSubclassAllocation

    CheckSubclassAllocation


    Functionality

    This BAPI checks whether a subordinate class is assigned directly to a superior class in a class hierarchy.

    The superior class is transferred in field 'ClassNum', the subordinateclass in field 'Subclass', and the class type in field 'ClassType'. You can also specify a date (KeyDate).


    The 'DirectAllocationOnly' indicator determines whether the BAPI checksfor direct assignments of the subordinate class to the instance, or forindirect assignments, too. The default setting is a search for a direct assignment.

    If one or both of the classes transferred does not exist or is not
    valid on the date specified, table 'Return' contains a message of type 'E'.
    If the subordinate class is not assigned to the superior class (butboth exist), or the assignment is not valid, table 'Return' also contains a message of type 'E'.
    If the assignment exists and is valid, table 'Return' contains a message of type 'S'.



    11-Dec-2005


    Create

    Create


    This function module creates classes, if the classes do not yet exist.

    It creates data that can also be displayed with BAPI_CLASS_GETDETAIL.

    You must make an entry in the following fields:

  • CLASSNUM (class) and CLASSTYPE (class type)

  • Table CLASSDESCRIPTIONS (class description)
  • Either Language_Int (internal language key, one character) or Language_ISO (external language key, two characters). ISO formatoverrides internal format.
  • Further Information


    If the BAPI runs successfully, table Return contains no messages of type 'E'.

    Caution

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


    11-Dec-2005


    Delete

    Delete


    This BAPI deletes the class with the name and class type that you enter. If the class has been changed with Engineering ChangeManagement, you can enter a change number.

    Note

    BAPI_CLASS_DELETE deletes a class and all assignments. If you do not
    want this, you must first call a suitable module that checks whetherthe class has assignments (e.g.CLAF_ALLOCATIONS). Exception: If the class inherited characteristics from a higher-level class, orlower-level classes exist that inherit the characteristics and are
    valuated, a message is issued and the class is not deleted, to prevent inconsistencies.

    Further Information

    If the BAPI runs successfully, table RETURN contains no messages of type 'E'.

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


    11-Dec-2005


    ExistenceCheck

    ExistenceCheck


    This function module checks whether a class exists.

    Further Information

    Parameter Return returns messages to the program that calls the function module.


    11-Dec-2005


    GetCharacteristics

    GetCharacteristics


    This module reads characteristics and allowed values for a class.

    This includes overwritten characteristics and values.


    11-Dec-2005


    GetClassifications

    GetClassifications


    This function module is for implementing BAPI
    Class.GetClassifications.

    It reads values assigned to the objects classified in the class (not in subordinate classes).
    If there are value descriptions, these are returned with the value.
    You must enter the class type, class, and objects whose values you want to read.


    Note: the function module does not read values of reference characteristics.

    Example

    DATA:
    objects LIKE bapi_class_objects OCCURS 0 WITH HEADER LINE,
    assigned values LIKE bapi_object_values OCCURS 0 WITH HEADER LINE,
    return LIKE bapireturn1.


    objects-object_key = 'TESTOBJEKT'.
    APPEND objects.

    CALL FUNCTION 'BAPI_CLASS_GET_CLASSIFICATIONS'
    EXPORTING
    classtype = '001'
    classnum = 'TEST CLASS'
    key_date = 19991231

    langu_iso = 'EN'
    IMPORTING
    return = return
    TABLES
    object_classifications = assigned values
    class_objects = objects
    EXCEPTIONS
    others = 0.



    11-Dec-2005


    GetDetail

    GetDetail


    This function module returns details of a class. The class is specifiedby name, class type, and a date if required (the default is the system date). Only characteristics data is date-dependent.

    Further Information

    If the BAPI runs succesfully, table Return contains no messages of type 'E'.


    11-Dec-2005


    GetDetailSubclassAllocation

    GetDetailSubclassAllocation


    This BAPI returns detailed information on the assignment of one class to another.

    The assignment is determined by the superior class ('ClassNum'), thesubordinate class ('Subclass'), and the class type ('ClassType'). You can enter a date ('KeyDate').


    The classification status is shown in field 'Status'. Table 'HierarchyValues' contains information on the characteristics andcharacteristic values of the assignment.

    If the BAPI runs successfully, table RETURN contains no messages of type 'E'.



    11-Dec-2005


    GetList

    GetList


    This function module provides an amount of class data that matches certain criteria.

    You can use the following criteria:

  • Class name: ClassNum
  • Class type: ClassType
  • The class name is transferred in a range table. This gives you flexibility for restricting the data.


    You can use parameter MaxRows to restrict the number of entries in the output list.

    Further Information

    If the BAPI runs successfully, table Return contains no messages of type 'E'.


    11-Dec-2005


    Getstatus

    Getstatus


    This function module returns status information for a class.

    Further Information

    Parameter Return returns messages to the program that calls the function module.


    11-Dec-2005


    GetSubclassAllocations

    GetSubclassAllocations


    This BAPI returns the subordinate classes that are immediately below a class in a class hierarchy.

    The initial class must be transferred in field 'ClassNum' and the classtype in field 'ClassType'. A date ('KeyDate') can also be transferred.

    Output table 'SubclassesList' contains the subordinate classes ('ClassName') and the class type again.


    If the BAPI runs successfully, table Return contains no messages of type 'E'.

    Notes

    This BAPI returns the immediately subordinate classes of the class, but not their subordinate classes.


    11-Dec-2005


    GetSubstructure

    GetSubstructure


    This BAPI returns all classes that have the instance as a superiorclass, and the relationships of the classes to each other. Superiorclasses of classes in the hierarchy are excluded, unless they also have the instance as a superior class.

    The instance is defined by fields 'ClassNum' and 'ClassType'. You can
    also transfer a date ('KeyDate'). You can use the 'HierarchyDepth'parameter to determine how many levels of the hierarchy are read. The default is to explode the entire hierarchy below the instance.

    The hierarchy structure is in table 'SubstrucList'. This table contains
    the subordinate class of each class (the class is in field 'ClassName'and the subordinate class in field 'ChildName'). Field 'Level' containsthe hierarchy level. The instance has level 1, and the level of eachclass is the level of its superior class plus 1. (If a class has more
    than one superior class, the level refers to the superior class whose entry has no 'Link' indicator.) If a class has more than onesubordinate class, the entry is repeated for all fields except field 'ChildName', which contains a different subordinate class.


    The 'Link' indicator is for multiple classification in the hierarchy,where one class has more than one superior classes immediately aboveit. Each of these superior classes has an entry, with the class thathas multiple assignments in field 'ChildName'. However, all but one of these entries has the 'Link' indicator set.


    The 'Status' field contains the status of the assignment of the class in field 'ChildName' to the class in field 'ClassName'.

    If the class has no subordinate classes, table 'SubstrucList' containsexactly one entry for the instance, with the 'ChildName' field blank.


    Example

    Class1 is the instance. The entire hierarchy has the following structure:

    Class1 is assigned to Class0
    Class9 is assigned to Class0
    Class10 is assigned to Class0
    Class2 is assigned to Class1
    Class3 is assigned to Class1
    Class4 is assigned to Class1
    Class4 is assigned to Class9
    Class5 is assigned to Class2

    Class6 is assigned to Class2
    Class6 is assigned to Class3
    Class7 is assigned to Class6
    Class8 is assigned to Class6

    Class0, Class9, and Class10 are outside the section of the hierarchythat is relevant, because they are neither directly nor indirectly
    assigned to the instance. Class1 is the root, Class9 is another root,due to multiple classification. Class6 is assigned to several classesin the hierarchy. Class4 is assigned to several classes outside thehierarchy. Class4, Class5, Class7, and Class8 are end nodes. This means that table 'SubstrucLis' is as follows:


    ClassName Level Link ChildName

    Class1 1 Class2

    Class1 1 Class3

    Class1 1 Class4

    Class2 2 Class5

    Class2 2 Class6


    Class3 2 X Class6

    Class4 2

    Class5 3

    Class6 3 Class7

    Class6 3 Class8

    Class7 4

    Class8 4

    Notes

    The instance is the only root and has level 'Level' = 1.


    If the 'HierarchyDepth' parameter is blank, exactly those classes thathave no entry for 'ChildName' are end nodes of the hierarchy. If thisparameter is set, the result may be a section of the hierarchy whereend nodes have a class in the 'ChildName' field that does not occur in
    the 'ClassName' field of another entry. The processing logic can copewith this situation, but the original rule still applies to actual end nodes.

    Multiple classification means that you can access all subordinateclasses of a class, but not all their superior classes. Check for entries with 'ChildName' = class.


    If a class is classified in multiple classes, the hierarchy levelrefers to the class that has the classified class as a subordinateclass without the 'Link' indicator. This means that, for entries with a'Link' indicator set, the level of the subordinate class need not be 1
    higher than that of the superior class. You must take account of this when navigating.

    The sequence of entries in table 'SubstrucLis' is not relevant.

    Further Information

    This BAPI does not return characteristics or characteristic values for
    classes in the hierarchy. BAPI Class.GetDetailSubclass is available for this purpose.

    If you are only looking for one hierarchy path between a superior classyou know and a subordinate class you know, it is better to use BAPIClass.GetSuperstructure, with the subordinate class as the instance.
    This improves system performance considerably and returns far less superfluous information.


    11-Dec-2005


    GetSuperclassAllocations

    GetSuperclassAllocations


    This BAPI returns the superior classes directly above a class in a class hierarchy.

    The initial class must be transferred in field 'ClassNum', and theclass type in field 'ClassType'. You can transfer a date ('KeyDate').

    Output table 'SuperclassesList' contains the names of the superior classes ('ClassName') and the class type again.


    If the BAPI runs succesfully, table Return contains no messages of type 'E'.

    Notes

    The result contains the superior classes immediatly above the class, but not their superior classes.


    11-Dec-2005


    GetSuperstructure

    GetSuperstructure


    This BAPI returns all classes that have the instance as a superior class, with the relationships of classes to each other.

    The instance is defined by the fields 'ClassNum' and 'ClassType'. You can also transfer a date ('KeyDate').

    Table 'SupertreeList' contains the hierarchy structure. The subordinate
    classes of each class are stored in this table (the class is in field'ClassName' and the subordinate class in field 'ChildName'). Field'Level' contains the hierarchy level. Root classes have level 1, andthe level of any class is the level of its superior class plus 1. (If a
    class has more than one superior class, the level refers to thesuperior class without the 'Link' indicator.) If a class has severalsubordinate classes, the entry is repeated for all fields except 'ChildName', which contains a different subordinate class.


    The 'Link' indicator is for hierarchies with multiple classification. Aclass has several superior classes directly above it. Each superiorclass has an entry where field 'ChildName' contains the classifiedclass. However, all but one of these entries has the 'Link' indicator set.


    Field 'Status' contains the status of the assignment of the class in'ChildName' to the class in 'ClassName'. Field 'Description' contains the language-dependent description in the logon language.

    Example

    Class6 is the instance. The complete hierarchy looks like this:


    Class1 is assigned to Class0
    Class1 is assigned to Class9
    Class2 is assigned to Class1
    Class3 is assigned to Class1
    Class4 is assigned to Class1
    Class4 is assigned to Class9
    Class5 is assigned to Class2
    Class6 is assigned to Class2

    Class6 is assigned to Class3
    Class7 is assigned to Class6
    Class8 is assigned to Class6

    Class4, Class7, and Class8 are outside the relevant section of thehierarchy, because they are neither directly nor indirectly superior tothe instance. Class0 is the root class. Class9 is another root class,
    due to multiple classification. Class6 is assigned to more than oneclass in the hierarchy path. Class4 is assigned to more than one classoutside the hierarchy path. This means that table 'SubtreeList' is as follows:

    ClassName Level Link ChildName


    Class0 1 Class1

    Class1 2 Class2

    Class1 2 Class3

    Class2 3 Class6

    Class3 3 X Class6

    Class6 4

    Class9 1 X Class1


    Notes

    The output of this BAPI is not a complete section of the hierarchy. Theinstance never has an entry in field 'ChildName', but this does notmean that it has no subordinate classes. Also, not all subordinateclasses of other classes are returned. Only the superior classes are listed.


    Multiple classification allows you to access all subordinate classes ofa class (if output by this BAPI), but not all of its superior classes.Check whether there are entries with 'ChildName' = class and 'Link' = 'X'.

    Hierarchy level 1 refers to the root class, not the instance. The
    highest level output belongs to an entry for the instance, but theremay be other entries for the instance, due to multiple classification.This means that you cannot identify the instance by field 'Level', but by the blank 'ChildName' field.

    If a class is classified in several classes, its hierarchy level refers
    to the class where the classified class occurs in field 'ChildName' without the 'Link' indicator.

    For entries with the 'Link' indicator set, the level of the subordinateclass may not be 1 higher than the level of the superior class. You need to take this into account when navigating.


    The sequence of entries in table 'SupertreeList' is not relevant.

    Further Information

    This BAPI does not return characteristics or characteristic values ofclasses in the hierarchy. To do this, use BAPI Class.GetDetailSubclass.


    11-Dec-2005


    RemoveSubclass

    RemoveSubclass


    This BAPI deletes the assignment of a subordinate class to a superior class.

    The superior class is specified in field 'ClassNum', the subordinateclass in field 'Subclass', and the class type in field 'ClassType'. Theclassification status is set in field 'Status'. You can also specify a
    date ('KeyDate'). The characteristics and their values are in table 'HierarchyValues'.

    If the BAPI runs successfully, table RETURN contains no messages of type 'E'.

    Notes

    This BAPI only deletes the individual assignment - not the entire substructure of the class hierarchy.


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


    11-Dec-2005


    RemoveSubstructure

    RemoveSubstructure


    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 entiresubstructure 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 assignmentsin 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 eachindividual assignment in the substructure. If deletion was successful,the table contains a message of type "S", which says "The assignment of
    <subordinate class> to <superior class> was deleted". Otherwise, thereis a similar message of type "E", with further error messages.

    The most common error when deleting a hierarchy occurs if values ofcharacteristics 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. Ifan error message is displayed, check whether values of inheritedcharacteristics 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 assignmentof Class4 to Class5 remain. However, not all assignments in thesubstructure 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 twoassignments, 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 iscompletely 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.


    11-Dec-2005


    Rename

    Rename


    No document is available


    11-Dec-2005


    SelectObjects

    SelectObjects


    This function module is for implementing BAPI Class.Objectselection.This allows you to start the "find objects in class" function in theclassification system from an external application. For performancereasons, you cannot use all of the search options (see Restrictions).


    The result of the search is a list of numbers and language-dependentdescriptions of the objects (not including classes) that match yourselection criteria. You can alos read classifications of the objects found for specific characteristics.

    On the external application side, the class types, classes, characteristics, and allowed values must be known. In future, BAPIs
    will be provided to transfer data. Currently, however, you must use function modules that can use RFC:

    Checks on your entries must be made by the external application. If youenter a characteristic value that is not allowed, you get an empty search result.


    You must transfer characteristic values, not value descriptions.

    The external application must check whether the selection criteria are good, to ensure good response times.

    There is also a parameter for restricting the maximum number of hits.
    However, for technical reasons, this parameter only acts after objectshave been found, so the parameter only reduces the time for displayingobjects, network transports, and processing data with the external application.

    Restrictions:


    - Classes with multiple object types are not supported.
    Exception: batches Restriction: only batches are returned

    - No returning of classes

    - Reference characteristics are not supported

    - Interval characteristics are not supported


    - No open intervals

    - No exclusive search

    - No string search

    - No display of objects without values

    - Objects with locked classification status are not returned

    Example

    DATA: so LIKE bapi_selected_objects OCCURS 0 WITH HEADER LINE,

    sc LIKE bapi_selection_criterions OCCURS 0 WITH HEADER LINE,
    oc LIKE bapi_object_values OCCURS 0 WITH HEADER LINE,
    return like bapireturn1.

    *- Set up selection criteria
    *- Characteristic name
    sc-name_char = 'NUM_CHAR'.


    *- Numeric value from
    sc-num_val_fm = 0.

    *- Numeric value to
    sc-num_val_to = 1000.

    *- Set indicator that describes interval
    sc-val_relatn = '2'.
    APPEND sc.

    *- Characteristics whose assigned values you want to read
    oc-name_char = 'CHARX'.
    APPEND oc.


    CALL FUNCTION 'BAPI_CLASS_SELECT_OBJECTS'
    EXPORTING
    classtype = '001'
    classnum = 'CF10'
    langu_iso = 'EN'
    key_date = sy-date
    max_hits = 10
    IMPORTING
    return = return
    TABLES

    selection_criterions = sc
    selected_objects = so
    object_classifications = oc
    EXCEPTIONS
    others = 0.


    11-Dec-2005