Ansicht
Dokumentation

C1F2_SUBSTANCES_DELETE - NOTRANSL: EHS: Löschen von Spezifikationsdaten

C1F2_SUBSTANCES_DELETE - NOTRANSL: EHS: Löschen von Spezifikationsdaten

Fill RESBD Structure from EBP Component Structure   General Data in Customer Master  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality from the Point of View of the Calling Program

General

This function module can be used to delete a group of specifications or a group of subobjects of specifications. Here, delete means that the deletion indicator (DELFLG field) of the objects is set. The data is not physically deleted.

This module only sets the deletion indicator within the buffer data. Only when the function module C1F2_SUBSTANCES_SAVE_TO_DB is called and a COMMIT WORK is subsequently transmitted does the system definitively update the modifications in the database.

Objects that are (currently) stored in SAP-internal databases (characteristic values and long texts, for example) cannot (yet) be deleted by this module.

When value assignment data is deleted directly, only those value assignment instances whose usage may be edited by the user are deleted.

Interface

Entry:

The calling program can use Boolean parameters to specify which subobjects of which specifications are to be deleted. These parameters are arranged according to the following logical hierarchy:

Boolean parameters:                  | Corresponding
                                     | table parameters:
-------------------------------------|---------------------------
                                     |
I_FLG_HEADER                         | X_API_HEADER_TAB
  |                                  |
  |--I_FLG_REFSUBS                   | X_API_REFSUBS_TAB
  |--I_FLG_IDENT                     | X_API_IDENT_TAB
  |    |                             |
  |    |--I_FLG_IDENT_SUBLIST        | X_API_IDENT_SUBLIST_TAB
  |                                  |
  |--I_FLG_MATJOIN                   | X_API_MATJOIN_TAB
  |--I_FLG_PROP_HEADER               | X_API_PROP_HEADER_TAB
      |                             |
       |--I_FLG_PROP                 | X_API_PROP_TAB
            |                        |
            |--I_FLG_PROP_COMP       | X_API_PROP_COMPONENT_TAB
            |--I_FLG_PROP_USAGE      | X_API_PROP_USAGE_TAB
            |--I_FLG_PROP_REL        | X_API_PROP_RELIABILITY_TAB
            |--I_FLG_PROP_SOURCE     | X_API_PROP_SOURCE_TAB
           |--I_FLG_PROP_FTEXT      | X_API_PROP_FTEXT_TAB
            |--I_FLG_PROP_TAB07      | X_API_PROP_TAB07_TAB
            |--I_FLG_PROP_TAB0B      | X_API_PROP_TAB0B_TAB
            |--I_FLG_PROP_TAB0D      | X_API_PROP_TAB0D_TAB
            |--I_FLG_PROP_TAB0F      | X_API_PROP_TAB0F_TAB

The calling program first determines which subobjects are to be deleted by setting the corresponding Boolean parameters to TRUE (TRUE and FALSE are defined as constants in the include CBUI09). Then the calling program determines the corresponding table parameters with the subobjects to be deleted. To do this, the table parameters must be filled as follows:
  • The field RECN must be filled in each row.

  • Below the specification header level, the field RECNROOT must be filled in each row.

  • Below the specification header level, the foreign key fields for the higher-level subobjects must be filled. (Thus, for example, X_API_IDENT_SUBLIST_TAB-RECNTRI or X_API_PROP_USAGE_TAB-NAMEMST and X_API_PROP_USAGE_TAB-RECNMST must be filled. (You must (currently) enter the value 'ESTVA' in the field NAMEMST.))

The function module independently determines the dependent subobjects for each subobject to be deleted and also deletes them. Furthermore, all locks required are set.
Up to and including SAP EH&S Release 2.7B, Support Package 01, it was not advisable to fill a table and a lower-level table (in accordance with the above hierarchy) at the same time, since the module deletes the contents of the lower-level table and refills it with the subobjects that depend on the contents of the higher-level table. From EH&S Release 2.7B, Support Package 02, the contents of the lower-level table is no longer deleted, but is also taken into account.

Output:

Boolean parameters indicate whether errors occurred when the subobjects were being processed.

Outline description of the flow logic

Preconditions

-

Flow

  1. Input data is checked.
  2. Locks are transmitted and input data is completed in such a way that complete subobjects of specifications are always deleted. (The data is read using C1F2_SUBSTANCES_READ.)
  3. Deletion indicators are set using the BUF_WRITE functions of the buffer layer (with C1A0_ESTRH_BUF_WRITE, for example).

Postconditions

-

Possible exceptions

-

Example

Deletion of specification list assignments:

 DATA: ADDINF                LIKE RCGADDINF,
        FLG_LOCKFAIL          TYPE BOOLEAN,
        FLG_ERROR             TYPE BOOLEAN,
       FLG_WARNING           TYPE BOOLEAN,
        API_IDENT_SUBLIST_TAB TYPE ESPRH_APIRL_TAB_TYPE
                              WITH HEADER LINE.

  ADDINF-VALDAT = SY-DATUM.

* fill API_IDENT_SUBLIST_TAB (fill RECN, RECNROOT, RECNTRI)
  ...

* delete the data
  CALL FUNCTION 'C1F2_SUBSTANCES_DELETE'
       EXPORTING
            I_ADDINF                      = ADDINF
*           I_FLG_CHECK_ONLY              = ESP1_FALSE
*           I_FLG_OWNID_SRSID_KEEP        = ESP1_FALSE
*           I_FLG_HEADER                  = ESP1_FALSE
*           I_FLG_REFSUBS                 = ESP1_FALSE
*           I_FLG_IDENT                   = ESP1_FALSE
            I_FLG_IDENT_SUBLIST           = TRUE
*           I_FLG_IDENT_LONGTEXT          = ESP1_FALSE
*           I_FLG_MATJOIN                 = ESP1_FALSE
*           I_FLG_PROP_HEADER             = ESP1_FALSE
*           I_FLG_PROP                    = ESP1_FALSE
*           I_FLG_PROP_DATA               = ESP1_FALSE
*           I_FLG_PROP_COMP               = ESP1_FALSE
*           I_FLG_PROP_USAGE              = ESP1_FALSE
*           I_FLG_PROP_REL                = ESP1_FALSE
*           I_FLG_PROP_SOURCE             = ESP1_FALSE
*           I_FLG_PROP_FTEXT              = ESP1_FALSE
*           I_FLG_PROP_FTEXT_LONGTEXT     = ESP1_FALSE
*           I_FLG_PROP_TAB07              = ESP1_FALSE
*           I_FLG_PROP_TAB0B              = ESP1_FALSE
*           I_FLG_PROP_TAB0D              = ESP1_FALSE
*           I_FLG_PROP_TAB0F              = ESP1_FALSE
       IMPORTING
            E_FLG_LOCKFAIL                = FLG_LOCKFAIL
            E_FLG_ERROR                   = FLG_ERROR
            E_FLG_WARNING                 = FLG_WARNING
       TABLES
*           X_API_HEADER_TAB              =
*           X_API_REFSUBS_TAB             =
*           X_API_IDENT_TAB               =
*           X_API_IDENT_LONGTEXT_TAB      =
            X_API_IDENT_SUBLIST_TAB       = API_IDENT_SUBLIST_TAB
*           X_API_MATJOIN_TAB             =
*           X_API_PROP_HEADER_TAB         =
*           X_API_PROP_TAB                =
*           X_API_PROP_DATA_TAB           =
*           X_API_PROP_COMPONENT_TAB      =
*           X_API_PROP_USAGE_TAB          =
*           X_API_PROP_RELIABILITY_TAB    =
*           X_API_PROP_SOURCE_TAB         =
*           X_API_PROP_FTEXT_TAB          =
*           X_API_PROP_FTEXT_LONGTEXT_TAB =
*           X_API_PROP_TAB07_TAB          =
*           X_API_PROP_TAB0B_TAB          =
*           X_API_PROP_TAB0D_TAB          =
*           X_API_PROP_TAB0F_TAB          =
      EXCEPTIONS
           NO_OBJECT_SPECIFIED           = 1
            PARAMETER_ERROR               = 2
            INTERNAL_ERROR                = 3
            OTHERS                        = 4.
  IF SY-SUBRC <> 0.
    ...
  ENDIF.

* save the data
 CALL FUNCTION 'C1F2_SUBSTANCES_SAVE_TO_DB'
       IMPORTING
            E_FLG_ERROR = FLG_ERROR
       EXCEPTIONS
            OTHERS      = 1.
  IF SY-SUBRC <> 0.
    ...
  ENDIF.

  COMMIT WORK.

Notes on Maintaining the Module

The routine L_DELETE_INTERFACE_CORRECT (in C1F2) is of central importance for processing the entry data. It formats the data in such a way that complete subobjects are deleted in each case, using the module C1F2_SUBSTANCES_READ. This module is used, on the one hand, to read all dependent data and on the other to set all the locks required. (The form itself also determines the RECN values for the specification headers involved.)





Parameters

E_FLG_ERROR
E_FLG_LOCKFAIL
E_FLG_WARNING
I_ADDINF
I_FLG_APPLSCP
I_FLG_ASSESSMENT_CHECK
I_FLG_CHECK_ONLY
I_FLG_HEADER
I_FLG_HEADER_USAGE
I_FLG_IDENT
I_FLG_IDENT_LONGTEXT
I_FLG_IDENT_SUBLIST
I_FLG_IDENT_USAGE
I_FLG_IGN_DATA_CORPSES
I_FLG_INHED_DATA_DEL
I_FLG_KEY_DATE_SWITCH_ONLY
I_FLG_MATJOIN
I_FLG_NO_AUTH_CHECK
I_FLG_OWNID_SRSID_KEEP
I_FLG_PROP
I_FLG_PROP_CARR
I_FLG_PROP_COMP
I_FLG_PROP_DATA
I_FLG_PROP_FTEXT
I_FLG_PROP_FTEXT_LONGTEXT
I_FLG_PROP_HEADER
I_FLG_PROP_PACK
I_FLG_PROP_REL
I_FLG_PROP_SOURCE
I_FLG_PROP_SPROV
I_FLG_PROP_TAB07
I_FLG_PROP_TAB0B
I_FLG_PROP_TAB0D
I_FLG_PROP_TAB0F
I_FLG_PROP_USAGE
I_FLG_REFSUBS
I_FLG_TPLREL
I_FLG_VAL_CHECK_BY_STATUS
I_VALFR
I_VALTO
X_API_APPLSCP_TAB
X_API_HEADER_TAB
X_API_IDENT_LONGTEXT_TAB
X_API_IDENT_SUBLIST_TAB
X_API_IDENT_TAB
X_API_MATJOIN_TAB
X_API_PROP_CARR_TAB
X_API_PROP_COMPONENT_TAB
X_API_PROP_DATA_TAB
X_API_PROP_FTEXT_LONGTEXT_TAB
X_API_PROP_FTEXT_TAB
X_API_PROP_HEADER_TAB
X_API_PROP_PACK_TAB
X_API_PROP_RELIABILITY_TAB
X_API_PROP_SOURCE_TAB
X_API_PROP_SPROV_TAB
X_API_PROP_TAB
X_API_PROP_TAB07_TAB
X_API_PROP_TAB0B_TAB
X_API_PROP_TAB0D_TAB
X_API_PROP_TAB0F_TAB
X_API_PROP_USAGE_TAB
X_API_REFSUBS_TAB
X_API_TPLREL_TAB

Exceptions

INTERNAL_ERROR
INTERVAL_ACCESS_ERROR
KEYDATE_OR_CHANGENUMBER_ERROR
NO_OBJECT_SPECIFIED
PARAMETER_ERROR
STATUS_AND_VAL_AT_SAME_TIME

Function Group

C1F2

PERFORM Short Reference   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 27498 Date: 20240523 Time: 084107     sap01-206 ( 212 ms )