SAP® Documentation

Single view

IF_EX_EHSS_SPEC_CHECKS AT_SAVE_CHECK - Checks When Saving Specification Data

CL_GUI_FRONTEND_SERVICES - Frontend Services   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book


You can use this method to define checks when saving specification data. You can display messages that prevent the specification data being saved if the check result is negative. You can also add, modify, or delete specification data.

If possible, use this as the main method for your own inspections and evaluations when specification data is changed. This method is called directly before data is saved (using the Commit Work command). All data records that have been changed since the last save are available here.


To determine the data records that have been changed since the last save, you must read the EH&S buffer. Also refer to the example coding for this method. A function group belongs to each database table in specification management. The function group buffers the table data. You can determine the name of this group as follows:

Use transaction SM34 to display the content of view cluster VC_TCG03. Choose "Position...".

Enter the name of the database table. For example, you can enter the name of the table of identifiers, ESTRI. After you confirm, the name of the function group appears in the "Buffer Layer" column. For the identifiers, this is group C1A1.

To determine whether any changes have taken place since the last save, the function group provides a module that communicates this information, using the Boolean parameter E_FLG_CHANGED. The name of this module contains the string _BUF_CHANGED. The corresponding module for the identifiers would be called something like C1A1_ESTRI_BUF_CHANGED.

If changes are found, you receive a copy of the buffer for the corresponding database table by calling both function modules, _ADMIN and C14Z_IMPORT_FROM_MEMORY. Refer to the example coding for this method.

The copy is an internal table that contains all attributes of the corresponding database table. The internal table is sorted using the RECN and VALFR attributes. In addition to the database fields, the internal table also contains the SAVEMOD attribute. This shows you whether changes have been made, and if so, which changes have been made. You can determine the following using the attribute from the internal table:

  • Blank (No changes)
  • I (New entry)
  • U (Changed entry)
  • SAVEMOD = U und DELFLG = X (Entry deleted)

For writing specification data, SAP recommends the BAPI function modules BAPI_BUS1077_CREATE, BAPI_BUS1077_CHANGE, BAPI_BUS1077_DELETE or the API module from function group C1F5.

For more information, see SAP Note 800918.

When characteristic values for an existing value assignment instance change (database table ESTVA), the instance of the SAVEMOD attribute is also set to "U" in the buffer. You can determine the related characteristic values using the BAPI function module, BAPI_BUS1077_GETDETAIL.

The example coding for this method evaluates the changes to identifiers and ensures that all new or changed English trivial names for specifications start with the string "inofficial:". If this is not the case, the trivial names are corrected accordingly.





BAdI: Extended Checks for Specifications

TXBHW - Original Tax Base Amount in Local Currency   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 3611 Date: 20200606 Time: 052821     sap01-206 ( 102 ms )

Our Service

Looking for Support? Questions?




Leave us your contact details and we will call you back. Panels marked with * are mandatory.