Ansicht
Dokumentation

PRODUCT_ARCHIVE - Archiving: Usage Check, Archive Additional Data

PRODUCT_ARCHIVE - Archiving: Usage Check, Archive Additional Data

TXBHW - Original Tax Base Amount in Local Currency   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

This enhancement can be used to extend the archiving in your product master. It allows you to add your own usage checks and archive additional data that does not belong directly to the product master. The enhancement provides methods which are executed in particular phases of the archiving process.

Phase 1: Usage Checks

  • Method CHECK_ARCHIVABLE (executed during archiving preprocessing (verification))
This method can be used to define checks of your own that have to be completed successfully before a product can be archived and subsequently deleted. This method allows you to formulate the condition under which a product is not archived.
If a product is rejected for archiving, you generate an error message with the message type 'E' or 'A' and place the message in the application log for product archiving. Products for which a message of this kind has been generated are not archived and retain the product status To archive. They are checked again after a certain amount of time has passed. Otherwise, the product status Archivable is set.
You are not allowed to delete references to the product or make other database changes within the check. This can lead to data inconsistencies, could jeopardize the result of the archiving, and is therefore not supported by SAP. A deletion BDoc is sent for each archivable product, and the product deleted in the applications after the BDoc has been received.

Phase 2: Writing the Archive File

  • Method EXPAND_EXTRA_STRUCTURE (executed in archiving write program)
Before you can archive additional data, the structure of the archive file needs to be extended by the data structure of the additional data. Use the method EXPAND_EXTRA_STRUCTURE to dynamically extend the structure.
  • Method ARCHIVE_EXTRA_DATA (executed in archiving write program)
This method can be used to write the additional data for each product to the archive file. To do this, use the ADK (Archive Development Kit) function module ARCHIVE_PUT_TABLE.
  • Method VERIFY_EXTRA_DATA (executed in deletion preprocessing ('Release for Deletion'))
This method compares the data in the database with that in the archive file. To read additional archived data from the archive file, use the ADK function module ARCHIVE_GET_TABLE.

Phase 3: Deleting Archived Data

The Business Add-In COM_PRODUCT_DELETE contains the method DELETE_EXTRA_DATA for deleting additional data.

Only run the usage checks when archiving has been activated for the product master and the relevant ADK Customizing has been maintained for the archiving object PRODUCT_MD (Customizing transaction DACONTROL and transaction SARA and then choose Customizing ).

The GUIDs of the products to be archived are passed to the method CHECK_ARCHIVABLE in the form of a table with the name IT_ARCHIVING_PRODUCTS. If you wish to check individual segments, the data must be read using the functions in the product master API.

You should create your own message to describe the error situation in the application log. Message 024 from message class COM_PRODUCT_ARCHIVE, which is used in the example, serves as a template and should not be used in your checks.

On no account must a COMMIT WORK be executed in any of the implementations. All database changes are written at the same time by executing a central COMMIT WORK in the calling program (outside the Add-In implementation).

This enhancement contains example code for each method, which can be used as a basis for creating an implementation.

In the example code, data corresponding to the product is deleted from the table SAPLANE.

Restrictions

The following are not archived:

  • Products with an inactive version
  • Product variants from the OLTP System
  • The contents of documents (graphics, texts)

This data is therefore not available in the implementation of the usage check.

Note also that you are not allowed to make data changes to the code of the usage check, as this can cause data inconsistencies.






Fill RESBD Structure from EBP Component Structure   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.

Length: 4702 Date: 20240523 Time: 202512     sap01-206 ( 83 ms )