Functions Function module ARCHIVE_GIVE_STATISTICS is used in write, delete, reload , and read programs for data archiving to transfer statistical data tothe Archive Development Kit (ADK). Implementation The statistical data that is collected by function moduleARCHIVE_GIVE_STATISTICS is used in various contexts in Data Archiving.For example, ARCHIVE_WRITE_STATISTICS can be used to display statistics.Even if the function module ARCHIVE_WRITE_STATISTICS is not used, thefunction module ARCHIVE_GIVE_STATISTICS must always> be called atthe prescribed points (see next section). Not using> orincorrectly using> the function module can lead to incorrect > statistical data. For example, omitting the function moduleARCHIVE_GIVE_STATISTICS results in incorrect values for occupied ordeleted space on the database being displayed in archive administration.Use To obtain correct statistical data, the function moduleARCHIVE_GIVE_STATISTICS may only be used in all write, delete, reload,and read programs in Data Archiving in accordance with the followingdefinitions>. We recommend calling this function module only inproduction mode. This function module may not> be used in any other program, suchas the conversion, preprocessing and postprocessing programs.Write Program Archiving object> Function module ARCHIVE_GIVE_STATISTICS may not> be called in thewrite program. Archiving class> Function module ARCHIVE_GIVE_STATISTICS may not be called in thesubroutine <(><<)>class>_GET_DATA if the class data is transferred tothe ADK by function module ARCHIVE_PUT_TABLE; it must> be calledin subroutine <(><<)>class> _GET_DATA if the class data is nottransferred to the ADK by function module ARCHIVE_PUT_TABLE.Delete Program Archiving object> Function module ARCHIVE_GIVE_STATISTICS must> be called in thedelete program immediately after deleting the object data. The number ofdeleted records can be determined using system-variable SY-DBCNT. It isnot necessary (but possible) to call the function moduleARCHIVE_GIVE_STATISTICS for each data object. It can be called for agroup of data objects in line with the settings specified for the commitcounter. Archiving class> Function module ARCHIVE_GIVE_STATISTICS must> be called in theseparate PERFORM ... ON COMMIT delete subroutine (which is called bysubroutine <(><<)>class>_DELETE_ARCHIVE_OBJ) for each handle>. Thenumber of records deleted can be determined using system variableSY-DBCNT. Test Mode> The delete program can also call up ARCHIVE_GIVE_STATISTICS in the testmode. However, for the statistical data to be transferred correctly, aform routine <(><<)>class>_DELETE_ TEST_OBJ has to be implemented forall archiving classes used. If a class does not have a form routine,then the ADK is not able to update the statistics for this class duringdeletion in the test mode. Therefore, archiving classes must callARCHIVE_GIVE_STATISTICS also if deletion is executed in the test mode,so that the statistics are collected. Examples of this are the archivingclass BC_DEMO (function group DEMOCLASS) and the delete program SFLIGHTD(archiving object BC_SFLIGHT). Deletion function that is also used outside of archiving> Deletion functions that are used both within the context of archivingand also outside archiving should also call function moduleARCHIVE_GIVE_STATISTICS. As no handle is known in the context of thedeletion function, the call must be made here with the defined value"-1> for the ARCHIVE_HANDLE parameter. In this case, the table ofthe existing handle is evaluated. If exactly one> valid handle isknown, this handle is used. If no handle is known (for example, if thedeletion module is being used outside archiving) or if there aremultiple valid handles, the system exits processing in the functionmodule without raising an exception.Reload Program Archiving object> a) Data that is reloaded to the database (read handle)> Function module ARCHIVE_GIVE_STATISTICS must> be called in thereload program immediately after inserting the object data in thedatabase with the read handle>. The number of records inserted canbe determined using the system variable SY-DBCNT. It is not necessary(but possible) to call the function module ARCHIVE_GIVE_STATISTICS foreach data object. It can be called by group, in line with the settingsin the commit counter. b) Data that is written in new archiving session (write handle)> The function module ARCHIVE_GIVE_STATISTICS may not> be called inthe reload program with the write handle>. Archiving class> a) Data that is reloaded into the database (read handle)> Function module ARCHIVE_GIVE_STATISTICS must> be called insubroutine <(><<)>class>_RELOAD_ARCHIVE_OBJECT immediately afterinserting the class data in the database with the read handle >. The number of records reloaded can be determined using systemvariable SY-DBCNT. b) Data that is written in new archiving session (write handle)> Function module ARCHIVE_GIVE_STATISTICS may not> be called withthe write handle>.Read Program Archiving object> Function module ARCHIVE_GIVE_STATISTICS can> be called in thewrite program. Archiving class> Function module ARCHIVE_GIVE_STATISTICS may not> be called in thesubroutine <(><<)>class>_PUT_DATA.Cross-Archiving-Object Check and Delete Programs When the function module ARCHIVE_GIVE_STATISTICS is called with handle-1, the program checks whether the function moduleARCHIVE_INIT_STATISTICS was called to transfer a GUID for the object-independent check or delete. If it was called and a valid GUID exists,the object-independent check and delete statistics will be updated intable ARCDEL_DEL_STAT. Example Correct use of function module ARCHIVE_GIVE_STATISTICS is illustrated bythe programs in archiving object BC_SFLIGHT or in the archiving classBC_DEMO. INCLUDE 'ARCHIVE_HANDLE' OBJECT DOKU ID TXFunction module ARCHIVE_GIVE_STATISTICS can, however, only be called inreload programs using the read handle. Description The parameter TABLE contains an internal table for structure ARCH_STATto transfer the statistical data to the Archive Development Kit (ADK). Note:> In field TABNAME, only names can be used that belong tothe following Data Dictionary object types:
- TRANSP
- POOL
- CLUSTER
- VIEW
- APPEND
- INTTAB
The parameter TABLE must be used differently according to the context: Archiving Object>> The first line of the internal table refers to the data object; thefield TABNAME must be set to SPACE and the field COUNT must contain thenumber of the data objects that have been processed since the last timefunction module ARCHIVE_GIVE_STATISTICS was called. In all other lines, the structure name is transferred to field TABLE;in the field COUNT, the number of data records processed sine the lasttime function module ARCHIVE_GIVE_STATISTICS was called. Archiving Class>> The structure name is transferred to the field TABNAME in the internaltable; the field COUNT contains the number of data records processedsince function module ARCHIVE_GIVE_STATISTICS was last called.
|