Fonction SAP BAPI_CASE_CREATE - Create Case

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
CASE_GUID BAPISCMGCASE-CASE_GUID C 32 X Technical Key of Case
CASE_TYPE BAPISCMGCASE-CASE_TYPE C 4 Case Type of Case
CASE_WF_PATH BAPISCMGCASE-WF_TEMPLATE_ID N 12 X Process Route Model ID
SKIP_ERRORS BAPISRMREC-BOOLEAN C 1 X Switch: Stop Insert After First Error

Paramètre Reférence Type Long. Description
GUID BAPISCMGCASE-CASE_GUID C 32 Technical Key of Case

Paramètre Reférence Long. Facultatif Description
CASE_ATTRIBUTES BAPIPROPTB 319 X Attribute Value Table
CASE_NOTES BAPINOTE 140 X Case Notes: Text Lines
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_INSERTION BAPIDOCINS 328 X Information for Inserting Elements into Record
ELEMENT_RELATIONS BAPIRELTB 8 X Element-Record Relation
RETURN BAPIRET2 548 Return Code

Functionality
This BAPI method is used to create a new case and fill it with data.
The case is created with the specified case type.
If the guid of a new case is not set by the caller, it is generatedautomatically.
If the template for the workflow path is set, then the workflow path forthe new case is created from this template, otherwise it stays empty.
All other optional parameters are used to fill the created case withdata.

Example
* Call the BAPI
CALL FUNCTION 'BAPI_CASE_CREATE'
     EXPORTING
          CASE_TYPE                    = 'DEMO'
          CASE_GUID                    ='40908A3045BF1A51E10000000A1550FF'
          CASE_WF_PATH                 = '207'
          SKIP_ERROR                   = 'X'
     IMPORTING
          GUID                         = guid
     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.

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

  • An element type is created in the service provider for cases.

  • (The service provider supplied for cases is SCMG_SP_CASE.)
    • A case type is defined in the Case Customizing (t/a SCASE_CUSTOMIZING).

    • The following authorizations are required:
      • An authorization for creating cases (authorization object S_SCMG_CAS).
      • Further information
        For more information on creating element types, see the SAP Libraryunder SAP Web Application Server -> Basis Services -> Records Management-> Standard Service Providers -> Generic Service Provider
        or choose the following in the Implementation Guide (IMG): SAP WebApplication Server -> Basis Services -> Records Management -> MaintainElement Types.
        See also the documentation for functions

        • BAPI_CASE_CHANGEATTRIBUTES - to get detailed information on how to set
        • 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.

              Description
              Case GUID of created case.

              Description
              Value for the case GUID for a new case. If this is not set, the GUID isgenerated automatically.

              Description
              The case type for a new case.

              Description
              Path pattern ID to be inserted into a new case.

              Description
              Flag. If set and an error occurs while data is being changed in a case,the method continues from the next component (attributes, notes,record). If the flag is not set, an error message is returned and thechanges are not saved.

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

              Description
              Text of the notes that are 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 in a case record. This table could contain some, all or none ofthe entries for each inserted element.

              Description
              The table ELEMENT_IDENTIFICATION contains the SPS IDs and SP POIDs ofthe objects to be inserted.
              The SPS ID parameter must 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_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 is to
                • be inserted;
                  • DESCRIPTION: Description of the element, optional;

                  • MODEL_ID: The model id of the position in the record where the element
                  • is to 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 could contain some, all or none of the relationsfor each inserted element.

                    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. This is transferred in the field ELEM_NOof the table parameters ELEMENT_IDENTIFICATION, ELEMENT_INSERTION orELEMENT_PROPERTIES.