Fonction SAP BAPI_CASE_CHANGE - Changes to Case

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
DELETE_ONLY_FIRST BAPISRMREC-BOOLEAN C 1 'X' X Switch: Delete First Element Found or All Elements of this Type
GUID BAPISCMGCASE-CASE_GUID C 32 Technical Case Key (Case GUID)
NEW_VERSION BAPISRMREC-BOOLEAN C 1 X Switch: Save Record as New Version
SKIP_ERRORS BAPISRMREC-BOOLEAN C 1 X Switch: Stop Change Action After First Error

Paramètre Reférence Long. Facultatif Description
CASE_ATTRIBUTES BAPIPROPTB 319 X Case Attributes to Be Changed
CASE_NOTES BAPINOTE 140 X Notes to Be Inserted in Case
CASE_NOTE_IDS BAPINOTEID 8 X Case Notes: Text ID
ELEMENT_ATTRIBUTES BAPIPROPME 324 X Additional Element Attributes
ELEMENT_IDENTIFICATION BAPIPROPME 324 X Identification of Elements to be Inserted
ELEMENT_IDENT_RECPOS BAPIRECPOS 4 X "Delete From" Node ID in Record
ELEMENT_IDENT_SP_POID BAPIPROPME 324 X SP Part of Element POID, Including Encoded Element Type
ELEMENT_INSERTION BAPIDOCINS 328 X Information for Inserting Elements into Record
ELEMENT_RELATIONS BAPIRELTB 8 X Element-Record Relation
RETURN BAPIRET2 548 Return Parameters

Functionality
This BAPI method is used to change the data of an existing case.

Example
* Call the BAPI
CALL FUNCTION 'BAPI_CASE_CHANGE'
     EXPORTING
          GUID                         ='40908A3045BF1A51E10000000A1550FF'
          SKIP_ERROR                   = 'X'
          NEW_VERSION                  = 'X'
          DELETE_ONLY_FIRST            = 'X'
     TABLES
          RETURN                       = return
          CASE_ATTRIBUTES              = case_attributes
          CASE_NOTES                   = case_notes
          CASE_NOTE_IDS                = case_note_ids
          ELEMENT_IDENTIFICATION       = element_identification
          ELEMENT_INSERTION            = element_insertion
          ELEMENT_ATTRIBUTES           = element_attributes
          ELEMENT_RELATIONS            = element_relations
          ELEMENT_IDENT_RECPOS         = element_ident_recpos
          ELEMENT_IDENT_SP_POID        = element_ident_sp_poid.

Notes
The following prerequisites must be met before this BAPI methodcan be used:

  • The case exists.

  • The following authorizations are required:
    • An authorization for changing cases (authorization object S_SCMG_CAS).
    • Further information
      See also the documentation for functions

      • BAPI_CASE_CHANGEATTRIBUTES - to get detailed information on how to
      • change the case attributes;
        • BAPI_CASE_ADDNOTES - to get detailed information on how to fill the
        • parameters to add notes;
          • BAPI_CASE_ADDELEMENTS - to get detailed information on how to fill the
          • parameters to add elements;
            • BAPI_CASE_DELETEELEMENTS - to get detailed information on how to fill
            • the parameters to delete elements.
              .

              Description
              Flag. If set, only the first record element in a case with the currentPOID will be deleted.

              Description
              The GUID of a case that is to be changed.

              Description
              Flag. If set, the record of a case is stored as new version.

              Description
              Flag. If set and an error occurs while changing data in a case, thencontinues changing from the next component (attributes, notes, record).If not set - returns an error without saving the changes.

              Description
              Table with names and values of the attributes to be set.

              Description
              Text of the notes to be added to a case.

              Description
              Text IDs of the notes to be added to a case.

              Description
              Table ELEMENT_ATTRIBUTES contains the attributes of the elements to beinserted into a case record. This table can contain one, several or noentries for each element.

              Description
              Table ELEMENT_IDENTIFICATION contains the SPS IDs and SP POIDs of theobjects that are to be inserted.
              The SPS ID parameter has to be entered for each element. It is definedusing the key value for the field NAME = '%SPS_ID%'. All othername-value pairs for the element with the same ELEM_NO contain the SPPOID parameters of the element.

              Description
              Table ELEMENT_IDENT_RECPOS contains the node IDs of the elements to bedeleted. All elements under this node in a case record will be deleted.

              Description
              The table ELEMENT_IDENT_SP_POID contains the identification info for theelements to be deleted. The SPS ID parameter must be entered for eachelement. It is defined using the key value for the fieldNAME='%SPS_ID%'. All other name-value pairs for the element with thesame ELEM_NO contain the SP POID parameters of the element.
              If the element with the defined SPS ID and SP POID is found in the casemore than once and flag DELETE_ONLY_FIRST is not set, this element isdeleted from all positions in the record. If the flag is set, theelement is deleted only from the first position where it is found.

              Description
              Table ELEMENT_INSERTION contains the following columns:

              • ELEM_NO: the number of an element, provides the bounding between the
              • element info in all input tables;
                • ANCHOR: the anchor of the position in the record where the element
                • should be inserted;
                  • DESCRIPTION: description of the element, optional;

                  • MODEL_ID: the model id of the position in the record where the element
                  • should be inserted.
                    This table must contain an entry for each element from the tableELEMENT_IDENTIFICATION. Only one of the columns ANCHOR and MODEL ID mustbe filled for each element. If the model ID is set, then the anchor isnot taken into account.

                    Description
                    Table ELEMENT_RELATIONS contains the relations between the elements andthe case. This table can contain one, several or no relations for eachelement.

                    Description
                    Result of the BAPI call.
                    In contrast to the standard, the entry in the field ROW does notidentify the row number of the data record containing the value witherrors.
                    Rather, ROW identifies the sequence number of the element to be insertedfor which the error occurred, which is transferred in the field ELEM_NOof the table parameters ELEMENT_IDENTIFICATION, ELEMENT_INSERTION orELEMENT_PROPERTIES.