SAP Function CHANGEDOCUMENT_DELETE - Delete change documents (client-independent, generic)

Parameter Reference Type Length Default Optional Text
CHANGENR CDHDR-CHANGENR C 10 SPACE X Document change number
CLIENT CDHDR-MANDANT C 3 SY-MANDT X Client in which deletion is to take place
COMMIT_COUNTER 0 '20' X COMMIT event counter
DISABLE_AUTHORITY_CHECK 0 SPACE X Authorization check can be deactivated
OBJECTCLASS CDHDR-OBJECTCLAS C 15 Object class
OBJECTID CDHDR-OBJECTID C 90 SPACE X Object ID
UP_TO_DATE CDHDR-UDATE D 8 SY-DATUM X Date by which the change documents are to be deleted
WITH_COMMIT 0 SPACE X Flag whether there should be a COMMIT WORK in the FM

Parameter Reference Type Length Text
NUMBER_OF_DELETED_HEADERS SYST-DBCNT I 4 Number of deleted change document headers
NUMBER_OF_DELETED_POSITIONS SYST-DBCNT I 4 Number of deleted change document items
NUMBER_OF_DELETED_STRINGS SYST-DBCNT I 4 Number of Deleted Change Document Item STRINGs
NUMBER_OF_DELETED_UIDS SYST-DBCNT I 4 Number of deleted change document item_GUIDs

Exception Text
NO_AUTHORITY No authorization to delete change documents
NO_CHANGES_FOUND No change documents found


INCLUDE 'DOCU_HAS_TO_BE_ELABORATED' OBJECT DOKU ID TX
Functions
you can delete change documents for all clients with this functionmodule.
An authorization check is made.
You must enter the object class. You can also specify an object ID. Youcan make generic entries ('*').
A COMMIT WORK is only carried out if this is explicitly specified (seeparameter WITH_COMMIT).
The number of deleted documents is returned.
Examples:
DATA: OBJECTCLASS LIKE CDHDR-OBJECTCLAS,
OBJECTID LIKE CDHDR-OBJECTID,
COUNTER LIKE SY-DBCNT.
CALL FUNCTION 'CHANGEDOCUMENT_DELETE_GENERIC'
EXPORTING
CLIENT = SY_MANDT
COMMIT_COUNTER = '20'
OBJECTCLASS = OBJECTCLASS
OBJECTID = OBJECTID
WITH_COMMIT = SAPCE
IMPORTING
NUMBER_OF_DELETED_ENTRIES = COUNTER
EXCEPTIONS
NO_AUTHORITY = 01.
Notes
  • This function module can only be used for generic deletion if the
  • object ID does not contain the character '%'. When deleting genericallyfrom the database this character has the same meaning as '*' in SAPSQL.This means that too much may be deleted.
    This parameter contains the number of deleted change document headers.
    This parameter contains the number of deleted change document items.

    Description
    This parameter contains the number of deleted change document items withSTRINGs.

    Description
    If only one specific change document number is to be deleted, it can betransferred here.

    Meaning
    This parameter contains the name of the client in which thechange documents are to be deleted.

    Value range
    Either a valid client or SPACE must be entered. In the first casechange documents in the specified client are deleted,in the second case, the change documents in all clients are deleted.

    Defaults
    By default, only those in the current client are deleted.
    INCLUDE 'SCD_PARAM_COMMIT_COUNTER' OBJECT DOKU ID TX

    Description
    DISABLE_AUTHORITY_CHECK <> SPACE means no authorization check is madewhen deleting change documents.

    Default
    As standard an authorization check is made on the authorization objectS_SCDO with activity '06' (Delete).
    Only change documents of the specified object class are deleted.

    Meaning
    All change documents in the specified client of the specifiedobject class until the specified date which have this object ID aredeleted.

    Value range

    • valid object ID

    • In this case the change documents for the specified client of thespecified object class until the specified date whcich havee thisobject ID are deleted.
      • generic input (e.g. 'ABC*')

      • Only '*' is allowed as a search pattern.
        In generic delete the object ID must not contain the character'%'. This character has the same meaning in generic delete in thedatabase as the '*' in SAPSQL, i.e. too muchmay be deleted.
        • SPACE:

        • SPACE has the same meaning as the generic value '*', i.e. all changedocuments for the specified client in the specifiedobject class until the specified date are deleted.

          Default
          The parameter has the default SPACE, i.e. all change documents of thespecified object class are deleted.
          All change documents until the specified date are deleted.
          INCLUDE 'SCD_PARAM_WITH_COMMIT' OBJECT DOKU ID TX