Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
% , / % : ' & % 3 / ( +
5HOHDVH %
6$3 $*
&RS\ULJKW
Copyright 1998 SAP AG. All rights reserved. No part of this brochure may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. SAP AG further does not warrant the accuracy or completeness of the information, text, graphics, links, or other items contained within these materials. SAP AG shall not be liable for any special, indirect, incidental, or consequential damages, including without limitation, lost revenues or lost profits, which may result from the use of these materials. The information in this documentation is subject to change without notice and does not represent a commitment on the part of SAP AG for the future. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, WINDOWS, NT, EXCEL and SQL-Server are registered trademarks of Microsoft Corporation. IBM, DB2, OS/2, DB2/6000, Parallel Sysplex, MVS/ESA, RS/6000, AIX, S/390, AS/400, OS/390, and OS/400 are registered trademarks of IBM Corporation. OSF/Motif is a registered trademark of Open Software Foundation. ORACLE is a registered trademark of ORACLE Corporation, California, USA. INFORMIX-OnLine IRU 6$3 is a registered trademark of Informix Software Incorporated. UNIX and X/Open are registered trademarks of SCO Santa Cruz Operation. ADABAS is a registered trademark of Software AG. SAP, R/2, R/3, RIVA, ABAP/4, SAP ArchiveLink, SAPaccess, SAPmail, SAPoffice, SAP-EDI, R/3 Retail, SAP EarlyWatch, SAP Business Workflow, ALE/WEB, Team SAP, BAPI, Management Cockpit are registered or unregistered trademarks of SAP AG.
,FRQV
,FRQ 0HDQLQJ Caution Example
Note
-XQH
6$3 $*
&RQWHQWV
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\
6WDQGDUGL]HG GLDORJV 2YHUYLHZ &RQFHSW 3URFHGXUH Determine dialog type............................................................................................................... 11 Create dialog text Document.................................................................................................... 12 &RQILUPDWLRQ SURPSW GLDORJV 'LDORJV IRU FKRRVLQJ IURP DPRQJ DOWHUQDWLYHV 'LDORJV IRU GLVSOD\LQJ LQSXWWLQJ DQG FKHFNLQJ GDWD 'DWD SULQW GLDORJV 7H[W GLVSOD\ GLDORJV 6FUROOLQJ LQ WDEXODU VWUXFWXUHV ([WHQGHG WDEOH PDLQWHQDQFH 2YHUYLHZ &RQFHSW &UHDWH PDLQWHQDQFH GLDORJ &DOOLQJ WKH VWDQGDUG PDLQWHQDQFH GLDORJ &DOO YLD IXQFWLRQ PRGXOH +LJKHVW OHYHO HQWU\ 0LGGOH OHYHO HQWU\ /RZHVW OHYHO HQWU\ &HQWUDO DGGUHVV PDQDJHPHQW 2YHUYLHZ &DOHQGDU 2YHUYLHZ &RQFHSW 'HWHUPLQH FDOHQGDU ,' &DOHQGDU IXQFWLRQV 0HDVXUHPHQW XQLWV 2YHUYLHZ &RQFHSW &KHFN PHDVXUHPHQW XQLW WDEOH 0HDVXUHPHQW XQLW FRQYHUVLRQ &RQYHUVLRQ RI PHDVXUHPHQW XQLWV DQG SRVVLEOH HQWULHV ) KHOS &KDQJH GRFXPHQWV 2YHUYLHZ &RQFHSW 3URFHGXUH Define change document object............................................................................................... 58 Set change document flag........................................................................................................ 59
-XQH
6$3 $*
Generate update and INCLUDE objects .................................................................................. 60 Integrating the functionality into the program ........................................................................... 62 Writing the fields in the program ......................................................................................... 63 &UHDWLQJ FKDQJH GRFXPHQWV 5HDG DQG IRUPDW FKDQJH GRFXPHQWV 5HDG DQG IRUPDW SODQQHG FKDQJHV 'HOHWH FKDQJH GRFXPHQWV DQG SODQQHG FKDQJHV $UFKLYHG FKDQJH GRFXPHQWV PDQDJHPHQW &UHDWH DSSOLFDWLRQ ORJ 2YHUYLHZ &RQFHSW 3URFHGXUH 'HILQH DSSOLFDWLRQ ORJ REMHFWV &UHDWH DSSOLFDWLRQ ORJ 'LVSOD\ DSSOLFDWLRQ ORJ 5HDG DSSOLFDWLRQ ORJ 'HOHWH DSSOLFDWLRQ ORJ 3ODWIRUPLQGHSHQGHQW )LOH 1DPH $VVLJQPHQW 2YHUYLHZ 'HILQLWLRQV RI 3ODWIRUPLQGHSHQGHQW )LOH 1DPHV 7KH )XQFWLRQ 0RGXOH ),/(B*(7B1$0( 8VLQJ 3ODWIRUPLQGHSHQGHQW )LOH 1DPHV LQ 3URJUDPV 5HIHUHQFH 1XPEHU UDQJHV 2YHUYLHZ &RQFHSW 1XPEHU UDQJH REMHFW W\SHV 3URFHGXUH Determine the number range object type ................................................................................. 99 Maintain number range object................................................................................................ 100 Function module calls............................................................................................................. 103 1XPEHU UDQJH DQG JURXS PDLQWHQDQFH GLDORJV 1XPEHU UDQJH DQG JURXS UHDG DQG PDLQWDLQ VHUYLFHV 1XPEHU UDQJH REMHFW UHDG DQG PDLQWDLQ VHUYLFHV 1XPEHU DVVLJQPHQW DQG FKHFN 8WLOLWLHV $UFKLYLQJ 2YHUYLHZ $'. DV DUFKLYLQJ SURJUDP GHYHORSPHQW HQYLURQPHQW ,QWHUDFWLRQ EHWZHHQ 3URJUDP $'. DQG $UFKLYH ILOH $UFKLYLQJ ZLWK $'. Archiving activities .................................................................................................................. 117 Archiving object ...................................................................................................................... 118 Standard class........................................................................................................................ 120 Archiving classes.................................................................................................................... 121 Archive management.............................................................................................................. 123
-XQH
6$3 $*
Network graphic...................................................................................................................... 124 Accessing data objects in the archive Index ....................................................................... 125 'HYHORSLQJ DUFKLYLQJ SURJUDPV Define archiving objects ......................................................................................................... 127 Define standard class hierarchical structure .......................................................................... 129 Archive customizing................................................................................................................ 130 Assign archiving classes ........................................................................................................ 132 'HYHORS DUFKLYLQJ SURJUDP Standard archiving program ................................................................................................... 136 Archiving using archiving classes........................................................................................... 137 'HYHORS GHOHWH SURJUDP 'HYHORS UHORDG SURJUDP 'HYHORS DQDO\VLV SURJUDP RSWLRQDO 0DLQWDLQ QHWZRUN JUDSKLF &UHDWH DQ LQGH[ DQG XVH LW WR DFFHVV LQGLYLGXDO GDWD REMHFWV LQ WKH DUFKLYH 8VH RI DUFKLYLQJ FODVVHV 'HYHORS DUFKLYLQJ FODVVHV Specify function group ............................................................................................................ 151 Develop function modules ...................................................................................................... 152 Develop Form routines ........................................................................................................... 153 Initialize the archiving class for writing .............................................................................. 154 Get data............................................................................................................................. 155 Delete archiving class local memory................................................................................. 156 Declare a handle invalid .................................................................................................... 157 Initialize the archiving class for reading ............................................................................ 158 Copy data from the data container.................................................................................... 159 Delete archived data ......................................................................................................... 160 Discard the data flagged for delete ................................................................................... 161 Reload archived data ........................................................................................................ 162 Define archiving class............................................................................................................. 163 *HQHUDWH DUFKLYLQJ SURJUDPV 0RGHO 3URJUDPV Model write program ARCHIVE........................................................................................... 167 Model delete program DELETE .......................................................................................... 170 $UFKLYLQJ IXQFWLRQV
-XQH
6$3 $*
-XQH
6$3 $*
6WDQGDUGL]HG GLDORJV
This section explains how you can standardize the dialogs in your developments.
2YHUYLHZ >3DJH @ &RQFHSW >3DJH @ 3URFHGXUHV 3URFHGXUH >3DJH @ 'HWHUPLQH GLDORJ W\SH >3DJH @ &UHDWH GLDORJ WH[W 'RFXPHQW >3DJH @ 5HIHUHQFHV &RQILUPDWLRQ SURPSW GLDORJV >3DJH @ 'LDORJV IRU FKRRVLQJ IURP DPRQJ DOWHUQDWLYHV >3DJH @ 'LDORJV IRU GLVSOD\LQJ LQSXWWLQJ DQG FKHFNLQJ GDWD >3DJH @ 'DWD SULQW GLDORJV >3DJH @ 7H[W GLVSOD\ GLDORJV >3DJH @ 6FUROOLQJ LQ WDEXODU VWUXFWXUHV >3DJH @
-XQH
6$3 $*
2YHUYLHZ
Some dialog steps and functions are required frequently during the realization of application development dialogs. These are available as function modules in self-contained modules. Their use standardizes application dialogs, which in turn simplifies use.
-XQH
6$3 $*
&RQFHSW
The function modules provide a standardized dialog box with function keys which are tested at the end of the dialog. Depending on the function module, texts for information, for choices and/or for the available function keys can be passed.
-XQH
6$3 $*
3URFHGXUH
No preparatory steps are necessary for the use of the function modules for standardized dialog boxes, with the exception of the text display function modules (function group SP06). In this case, the texts must be created previously. To use standardized dialog boxes, perform the following steps: 1. Determine dialog type [Page 11] If you want to use a function module from the function group SPO6: Create dialog text Document [Page 12] 2. Choose the appropriate function module in the function group found in step 1. 3. Call this function module in the application.
-XQH
6$3 $*
6LWXDWLRQ The user is to be warned of potential data loss The user should answer a question about further processing with Yes or No
The user is to be warned about potential data loss, and decide whether he SPO1 or she wants to continue with the action The user must choose between further processing alternatives The user must continue the current action or cancel The user is to input data (with or without check against a value table) Data are to be displayed to the user The user is to receive detailed information The user is to be able to scroll in a displayed list The user is to print data from a table or a table view SPO2 SPO2 SPO4 SPO4 SPO6 STAB STRP
-XQH
6$3 $*
-XQH
6$3 $*
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 'LDORJV IRU FKRRVLQJ IURP DPRQJ DOWHUQDWLYHV
6$3 $*
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 'LDORJV IRU GLVSOD\LQJ LQSXWWLQJ DQG FKHFNLQJ GDWD
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 'LDORJV IRU GLVSOD\LQJ LQSXWWLQJ DQG FKHFNLQJ GDWD
6$3 $*
POPUP_GET_VALUES_USER_HELP, with the additional possibility of passing one or two additional pushbuttons and a standard pushbutton, which the user can name. 32383B*(7B9$/8(6B6(7B0$;B),(/' With this function module you can specify the maximum number of fields which can be displayed in dialog boxes for this function group (SPO4). The specified value is stored in the function group local memory and applies for the rest of the application. Dialog boxes which display more then this number of fields are displayed with a scroll bar.
-XQH
6$3 $*
-XQH
6$3 $*
-XQH
6$3 $*
-XQH
6$3 $*
3URFHGXUH
&UHDWH PDLQWHQDQFH GLDORJ >3DJH @ &DOOLQJ WKH VWDQGDUG PDLQWHQDQFH GLDORJ >3DJH @
5HIHUHQFHV
&DOO YLD IXQFWLRQ PRGXOH >3DJH @ +LJKHVW OHYHO HQWU\ >3DJH @ 0LGGOH OHYHO HQWU\ >3DJH @ /RZHVW OHYHO HQWU\ >3DJH @
-XQH
6$3 $*
2YHUYLHZ
The extended table maintenance maintenance dialog provides the possibility of processing table data in a consistent maintenance dialog, independently of whether access is to be made directly via the table or via a view defined in the dictionary. Integrating the maintenance dialog into user developments offers simplified access to table contents, and has the following advantages, among others: 7KH SURJUDPPLQJ HIIRUW LV FRQVLGHUDEO\ UHGXFHG 7KH RSHUDWLRQ LV FRQVLVWHQW FRPSUHKHQVLEOH DQG FRQYHQLHQW
The convenience is produced by comprehensive operating functionality, which guarantees the comprehensibility and transparency of the maintenance procedures. The maintenance dialog also allows table data to be viewed on two levels. You can branch from an overview screen to a detail screen for a selected record. The maintenance dialog can be used in its entirety as a standard maintenance dialog, or table or view-specific modifications can be made.
-XQH
6$3 $*
&RQFHSW
The following standard table maintenance dialog functionality is already available in the system for user applications: A FHQWUDO SURJUDP PRGXOH, which contains all the maintenance functionality, including mark functions for multiple record processing, the possibility of selecting all records processed, recover deleted records, and much more besides. The PDLQWHQDQFH WUDQVDFWLRQ, which uses the table or view-specific components as well as the central program module.
Database
Table1
001
Table 2
Table 3
for example Company Code
Table 3
001
001
F11 = Save
F11 = Save
Buffer
View 1 View 2 View 3
Interface
Company Data
Insert Delete Copy Select etc.
A work area, which can contain all existing views or be restricted by a selection, is fetched from the database for processing on the screen. This work area is first loaded into internal tables. At this point, a further selection for processing by field contents can be made. Field contents are maintained in the internal tables. The database is not accessed automatically after the maintenance of each individual view record. Changes made are only copied from the internal buffer to the database when the user chooses save. This buffering gives the
-XQH
6$3 $*
maintenance processing the form of a transaction. This enables the user to cancel changes before the database access (user-controlled Rollback) and allows the calling main program to check entries for consistency in context.
-XQH
6$3 $*
This is necessary for two-step procedures, but also for tables or views whose records can not be completely displayed on the overview screen because of the number or length of their fields. It can also be appropriate when complicated maintenance procedures require long input field explanatory texts, e.g. by displaying data from foreign key tables. $XWKRUL]DWLRQ JURXSV You can create authorization groups for tables or views. The activities defined for an authorization group apply during the use of the maintenance dialog for the tables or views in the authorization group. $XWKRUL]DWLRQ JURXS DVVLJQPHQW You can group tables or views.
To be able to call the maintenance dialog, you must generate the table or view-specific maintenance modules. Proceed as follows: 1. Choose 7RROV $%$3 :RUNEHQFK 'HYHORSPHQW 2WKHU 7RROV *HQWDEPDLQWGLDORJ You enter the maintenance transaction initial screen. 2. Enter the name of the table or view. 3. Mark the option Generated objects. 4. Choose &UHDWH&KDQJH. 5. Confirm that the maintenance module is to be created in the following dialog box,.
Instead of steps 1. to 5. you can call the function 8WLOLWLHV *HQPDLQW GLDORJ in the Dictionary (7RROV $%$3 :RUNEHQFK 'HYHORSPHQW 'LFWLRQDU\) for the table or view in question. You go to the maintenance screen for the generated object for the current table. 6. Enter the data required for generation: Function group to which the maintenance module is to belong
-XQH
6$3 $*
It is possible to store the maintenance modules for several tables or views. in one function group Authorization group Maintenance type (one/two-step) Maintenance screen (one-step) or screens (two-step) number Recording routine (standard/individual or none)
7. Then choose &UHDWH. All required maintenance modules are now generated.
If you subsequently want to make changes, you must call the function &KDQJH, to re-generate the maintenance module in question. Then you can call the standard maintenance dialog or the maintenance function modules for the table or view in question.
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ &DOOLQJ WKH VWDQGDUG PDLQWHQDQFH GLDORJ
6$3 $*
-XQH
6$3 $*
-XQH
6$3 $*
You can influence the maintenance dialog at run-time in the following ways: 6HOHFWLRQ FRQGLWLRQV You specify the selection conditions with which you wish to restrict the data selection in the database, in an internal table. ,QWHUIDFH You can dynamically disactivate functions of the central standard interface SAPLSVIM via an internal table.
Please see the function module documentation in the system for the interface description.
-XQH
6$3 $*
At run-time you can influence the maintenance dialog in the following ways: 6HOHFWLRQ FRQGLWLRQV You save the selection conditions with which you wish to restrict the data selection in the database in an internal table. ,QWHUIDFH You can dynamically disactivate functions of the central standard interface SAPLSVIM via an internal table.
Please see the function module documentation in the system for the interface description.
,QWHUIDFH GHVFULSWLRQ
,PSRUW SDUDPHWHUV &255B180%(5 Change request number of the change made, see function module VIEW_MAINTENANCE_CALL documentation 9,(:B$&7,21 Action (Display, maintain or transport) see function module VIEW_MAINTENANCE_CALL documentation 9,(:B1$0( Name of the table/view to be processed
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 0LGGOH OHYHO HQWU\ 7DEOHV '%$B6(//,67 Database access selection conditions. Structure: INCLUDE STRUCTURE VIMSELLIST, see function module VIEW_MAINTENANCE_CALL documentation.
6$3 $*
All data which are read for table processing and are created by maintenance, are stored at run-time in the internal table TOTAL. The table TOTAL has the structure: INCLUDE STRUCTURE <view name> or <table name> INCLUDE STRUCTURE VIMFLAGTAB
'3/B6(//,67 Selection conditions for the display of part of a work area on the maintenance screens. Structure and documentation as for DBA_SELLIST. The data are stored at run-time in the internal table EXTRACT. The table EXTRACT always contains only the table records which were filtered out of the table TOTAL as a result of a user action. The table EXTRACT has the same structure as the table TOTAL
(;&/B&8$B)81&7 Interface functions which can be dynamically de-activated. Structure: INCLUDE STRUCTURE VIMEXCLFUN, see function module VIEW_MAINTENANCE_CALL documentation
;B+($'(5 Control block table for the view/table. Structure: INCLUDE STRUCTURE VIMDESC. The table contains the table or view header information from the Dictionary, such as sub-set, selection conditions, maintenance status, delivery class. The table also contains information about the table or view generation and event times for user form routines. You can fill this table with the function module VIEW_GET_DDIC_INFO.
;B1$07$% Control block table for the table/view fields. Structure: INCLUDE STRUCTURE VIMDESC. The table contains the table or view field information from the Dictionary, such as structure field positions, key information and maintenance characteristics of the field. You can fill this table with the function module VIEW_GET_DDIC_INFO.
([FHSWLRQV 0,66,1*B&255B180%(5 Correction number missing 12B'$7$%$6(B)81&7,21 Data processing module missing
-XQH
6$3 $*
-XQH
6$3 $*
,QWHUIDFH GHVFULSWLRQ
,PSRUW SDUDPHWHUV )&2'( desired function. 'READ' 'EDIT' 'RDED' 'SAVE' 'ORGL' 'ORGD' Read the data from the DB process data Read and edit Write the data to the DB Re-set all marked entries Re-set one entry
9,(:B$&7,21 Action (Display, maintain or transport). see function module VIEW_MAINTENANCE_CALL documentation 9,(:B1$0( Name of the table or view. &255B180%(5 Change request number for the changes made. see function module VIEW_MAINTENANCE_CALL documentation
([SRUW SDUDPHWHUV /$67B$&7B(175< Index of the record in table EXTRACT on which the cursor was positioned. 8&200 Last maintenance dialog user command.
-XQH
6$3 $*
You must process the following commands yourself on this entry level: 'SAVE' 'ORGL' Save the data in the DB Re-set all marked entries in the display table (EXTRACT)
If this command is returned, you must call the lowest entry level function module again with this command and then with the previous command. You do not have to write your own re-set program.
The lowest entry level was called with the module VIEW_MAINTENANCE_LOW_LEVEL and the function 'EDIT'. The user has called the function 'ORGL'. The module VIEW_MAINTENANCE_LOW_LEVEL has now to be called first with the function 'ORGL'. The module runs in the background. Then the module VIEW_MAINTENANCE_LOW_LEVEL has to be called again with the function 'EDIT'. ORGD' Re-set the entry in the display table (EXTRACT) header. see command 'ORGL' for command processing. 'ANZG' 'AEND' ENDE' BACK' Change action: Change -> Display Change action: Display -> Change End processing Return to calling position
'ATAB' Fetch another table or view This field also contains the commands which were realized in user modules in the maintenance screens.
83'$7(B5(48,5(' Flag: Entries changed, Save required. The user has made changes which make it necessary to save the data before leaving the maintenance dialog.
7DEOHV &255B.(<7$% Table with the keys of the entries to be transported. The table is only used in transport mode. Structure: INCLUDE STRUCTURE E071K '%$B6(//,67 Selection conditions for the database access. Structure: INCLUDE STRUCTURE VIMSELLIST see function module VIEW_MAINTENANCE _CALL documentation. All data which are read in for the table processing or are created during maintenance, are stored in the internal table TOTAL at run time. The table TOTAL has the structure: INCLUDE STRUCTURE <view name> or <table name>
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ /RZHVW OHYHO HQWU\ INCLUDE STRUCTURE VIMFLAGTAB
6$3 $*
See also the function module VIEW_MAINTENANCE_CALL documentation. '3/B6(//,67 Selection conditions for the display of part of a work area on the maintenance screens. Structure and documentation as DBA_SELLIST The data are stored at run time in the internal table EXTRACT. The table EXTRACT always only contains the table records which have been filtered out of the table TOTAL as a result of a user action. The table EXTRACT has the same structure as the table TOTAL See also the documentation of the function module VIEW_MAINTENANCE_CALL (;&/B&8$B)81&7 dynamically activated interface functions. Structure: INCLUDE STRUCTURE VIMEXCLFUN, see function module VIEW_MAINTENANCE_CALL documentation. 727$/ Data table, contains all data which have been read in and changed, deleted or added during the processing. Structure: INCLUDE STRUCTURE <view name> or <table name> INCLUDE STRUCTURE VIMFLAGTAB
All data which are read in for the table processing or are created during maintenance are stored at run time in the internal table TOTAL. After the function has been carried out, the table gets a processing flag for each record processed. (;75$&7 Data display work table. Structure as table TOTAL The data are stored at run time in the internal table EXTRACT. The table EXTRACT always only contains the table records which have been filtered out of the table TOTAL as the result of a user action. After the function has been performed, the table contains all the data found by the last selection for display. ;B+($'(5 Control block table for the table or view. Structure: INCLUDE STRUCTURE VIMDESC The table contains the Dictionary header information about the table or view, such as sub-set, selection conditions, maintenance status, delivery class. The table also contains the generation information and event time information for the table or view. You can fill this table with the function module VIEW_GET_DDIC_INFO. ;B1$07$% Control block table for the fields of the table or view. Structure: INCLUDE STRUCTURE VIMDESC.
-XQH
6$3 $*
The table contains the field information about the table or view, from the dictionary such as the position of the field in the structure, key information and the maintenance characteristics of the field. You can fill this table with the function module VIEW_GET_DDIC_INFO. ([FHSWLRQV 0,66,1*B&255B180%(5 Correction number missing 6$9,1*B&255(&7,21B)$,/(' Error while saving the entries in a change request.
-XQH
6$3 $*
-XQH
6$3 $*
2YHUYLHZ
Addresses can arise in many different forms. There are, on the one hand, various kinds of adddress, e.g. addresses of companies or of private individuals, they can also, e.g. internationally, have a different structure. A central address management has been created to simplify the address management across all applications, and to make access and processing easier.
-XQH
6$3 $*
&DOHQGDU
This section explains which holiday and factory calendar data you can access in the system, and use in your own developments. 2YHUYLHZ >3DJH @ &RQFHSW >3DJH @
3URFHGXUH
'HWHUPLQH FDOHQGDU ,' >3DJH @
5HIHUHQFHV
&DOHQGDU IXQFWLRQV >3DJH @
-XQH
6$3 $*
2YHUYLHZ
Location-specific calendars can be defined in the SAP system. These can take account of both regional holidays and location-specific conditions of service. Function modules are available to enable you to use these data in your own developments.
-XQH
6$3 $*
&RQFHSW
Public holidays can be defined and be combined into regionally valid holiday calendars. A holiday calendar is identified in the system by a two-character calendar ID. A holiday calendar is assigned to each factory calendar. The following information can also be defined and stored: Definition of the working days Special conditions
The days which count as working days according to this definition are numbered sequentially from 0 (unless otherwise defined). These numbers represent the factory date. The calendar date can be directly accessed via the factory date, e.g. to calculate delivery dates. The factory calendar is identified in the system by a two-character calendar ID. &DOHQGDU KLHUDUFK\ 1. Maintaining public holidays Def. public holiday 1 Def. public holiday 2
...
2.
Define public holiday calendar ID: K1 Public holiday 1 ... Public holiday n
3.
Define factory calendar ID: F1 Public holiday calendar K1 Def. weekdays/public holidays, special rules
-XQH
6$3 $*
2. Choose the option Holiday calendar or Factory calendar. 3. Choose 'LVSOD\. You receive a list of all holiday or factory calendars which exist in the system, with descriptive text and ID. 4. Choose a calendar. Call the function 'LVSOD\ GHILQLWLRQ, to get the definition of the chosen calendar. Call the function 'LVSOD\ FDOHQGDU, to get a calendar overview. In the factory calendars overview screen you can choose a year and display a calendar page for the chosen year with the function 'LVSOD\ \HDU.
-XQH
6$3 $*
&DOHQGDU IXQFWLRQV
All function modules are contained in the function group SCAL. '$7(B&20387(B'$< This function module returns the day of the week for the date passed. '$7(B*(7B:((. This function module returns the week for the date passed. :((.B*(7B),567B'$< This function module returns the first day of the week passed. (This is always a Monday, regardless of whether it is a working day or a holiday.) ($67(5B*(7B'$7( This function module returns the date of Easter Sunday for the year passed. )$&725<'$7(B&219(57B72B'$7( This function module returns the calendar date for the factory date and the factory calendar passed. '$7(B&219(57B72B)$&725<'$7( This function module returns the factory date for the date and factory calendar passed. You can specify with a parameter whether the next or the previous working day is returned if the day is not a working day. +2/,'$<B&+(&.B$1'B*(7B,1)2 With this function module, you test whether a particular date in the holiday calendar passed is a holiday. If so, the definition of the holiday is returned.
-XQH
6$3 $*
0HDVXUHPHQW XQLWV
This section explains which function modules you can use in your developments for processing measurement units. 2YHUYLHZ >3DJH @ &RQFHSW >3DJH @
3URFHGXUH
&KHFN PHDVXUHPHQW XQLW WDEOH >3DJH @
5HIHUHQFHV
0HDVXUHPHQW XQLW FRQYHUVLRQ >3DJH @ &RQYHUVLRQ RI PHDVXUHPHQW XQLWV DQG SRVVLEOH HQWULHV ) KHOS >3DJH @
-XQH
6$3 $*
2YHUYLHZ
Measurement units often have to be converted in applications. In multi-lingual systems, or with language-dependent measurement units, there is also the problem of displaying the relationships between measurement units correctly in the interface. For these reasons, SAP function modules are provided, with which all tasks which arise in connection with measurement units can be performed. The required information for each measurement unit is stored in a measurement unit table, which is accessed by the function modules for performing conversions. This includes conversion exits, which perform an automatic conversion between external and internal format when using certain domains for screen input/output fields. The function modules are buffered by default to minimize the number of database accesses needed for the conversion. The buffer is created at the first call of a module in each function group. This call therefore takes somewhat longer to complete. In general though, many modules in both function groups are used repeatedly, so that the effort of creating the buffer is justified.
-XQH
6$3 $*
&RQFHSW
Measurement units serve to measure properties of business applications. These properties comprise physical properties, that can be associated with dimensions in a measurement system, and properties without dimension, that cannot be defined unequivocally in a measurement system. To work with electronic data interchange (EDI) you must name measurement units corresponding to the recommendations for ISO-codes. Furthermore, measurement units carry several other names for internal and external presentation in the R/3 system.
3K\VLFDO 3URSHUWLHV
For physical properties, you can distinguish between basic and derived properties. Derived properties can be defined from algebraic combinations of basic properties. Which physical properties are viewed as basic and which as derived is a question of the purpose. There are many different measurement systems with different basic properties. Each basic property defines one basic dimension of a measurement system. The SAP standard shipment uses the international measurement unit system (SI) with the seven basic properties length, time, mass, temperature, electrical current, light intensity, and molarity. Therefore, the SI-System has seven basic dimensions. The basic properties of each dimension can be measured in specific measurement units. The measurement units of the SI-system for its seven basic dimensions are the SI units meter (m), second (s), kilogram (kg), Kelvin (K), ampere (A), candela (cd) and mol (mol). The dimensions of all derived properties of a measurement system are algebraic combinations of its basic dimensions. In the SI system, the measurement units of derived properties are combinations of the SI units and have partly own names and abbreviations.
kg m/s
2
kg m /s
Besides the SI units, you can define for each dimension of the SI systems other measurement units to any extend. Linear relations exist between different measurement units of one dimension. These relations allow conversions between the measurement units of one dimension and a reference to the corresponding SI unit.
-XQH
6$3 $*
energy
erg (erg)
0.0000001 J
Such definitions serve for better handling of measurement units (for example centimeters and kilometers) or they are country specific (for example feet and miles). The relations between the dimensions as well as the different measurement units of one dimension are defined unequivocally. Therefore, in the R/3 system, measurement units are maintained centrally in customizing tables. The dimensions of derived properties are defined in these tables by listing the exponents of the involved basic dimensions. The names of the corresponding customizing tables start with T006. You maintain these tables with the transactions CUNI and OMSC. The function modules that are described in the present section work with these tables. In the R/3 system, combinations of basic dimensions must be unique and can be related to one derived dimension only. For example, energy (force times distance) and torque (force times radius) cannot be defined in one R/3 system simultaneously.
-XQH
6$3 $*
long text
(thirty-character)
These naming types are maintained language-dependently in table T006A. For example, the commercial presentation of the dimension-less measurement unit piece is PC in English, ST (Stck) in German, and PI (Pice) in French.
The commercial and technical presentation together with the language information form a language dependent key for the corresponding internal presentation of the measurement unit. Therefore, they must be maintained uniquely for each language. The system uses the language-dependent key that is defined from commercial and technical presentation in conversion exits. It calls these conversion exits automatically on screens (dynpros) or during WRITE statements if the domains LUNIT (for technical measurement units) and CUNIT (for commercial measurement units) are used for data elements.
-XQH
6$3 $*
-XQH
6$3 $*
The rounding is performed internally with the same field type as that of the field passed. Rounding errors can thus occur when rounding a FLOAT value. If you want a high degree of accuracy, the passed field should have the type 3. 6,B81,7B*(7 You pass either a unit or a dimension to this function module to get the SI unit. If you pass both a unit and a dimension, the SI unit for the dimension is returned. 81,7B&219(56,21B:,7+B)$&725 With this function module, you convert a value according to the factor passed. 81,7B&255(6321'(1&(B&+(&. With this function module, you can check whether the two units passed belong to the same dimension. 81,7B*(7 With this function module, you get the appropriate measurement unit for the specified dimension and conversion factor. 81,7B&219(56,21B6,03/( With this function module, you convert a value using the measurement unit table, and round it, if appropriate. You can also perform the rounding without conversion. Conversion with this function module requires that the measurement unit table is
-XQH
6$3 $*
maintained for both units, and that both units belong to the same dimension, i.e. also that they have dimensions. The rounding can, however, also be performed for units which have no dimension.
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ &RQYHUVLRQ RI PHDVXUHPHQW XQLWV DQG SRVVLEOH HQWULHV ) KHOS
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ &RQYHUVLRQ RI PHDVXUHPHQW XQLWV DQG SRVVLEOH HQWULHV ) KHOS
6$3 $*
81,7B2)B0($685(0(17B+(/3 With this function module, you display in a dialog box either all measurement units or all commercial measurement units of a specified dimension (external measurement unit and associated long text). If you do not specify a dimension, all measurement units are displayed. You can control whether the measurement units are only displayed, or are offered for selection, with a parameter.
-XQH
6$3 $*
&KDQJH GRFXPHQWV
This section describes how you can log application changes, using change documents. 2YHUYLHZ >3DJH @ &RQFHSW >3DJH @
3URFHGXUH
3URFHGXUH >3DJH @ 'HILQH FKDQJH GRFXPHQW REMHFW >3DJH @ 6HW FKDQJH GRFXPHQW IODJ >3DJH @ *HQHUDWH XSGDWH DQG ,1&/8'( REMHFWV >3DJH @ ,QWHJUDWLQJ WKH IXQFWLRQDOLW\ LQWR WKH SURJUDP >3DJH @ :ULWLQJ WKH ILHOGV LQ WKH SURJUDP >3DJH @
5HIHUHQFHV
&UHDWLQJ FKDQJH GRFXPHQWV >3DJH @ 5HDG DQG IRUPDW FKDQJH GRFXPHQWV >3DJH @ 5HDG DQG IRUPDW SODQQHG FKDQJHV >3DJH @ 'HOHWH FKDQJH GRFXPHQWV DQG SODQQHG FKDQJHV >3DJH @ $UFKLYHG FKDQJH GRFXPHQWV PDQDJHPHQW >3DJH @
-XQH
6$3 $*
2YHUYLHZ
Many commercial objects are frequently changed. It is often useful, or even necessary, to be able to trace the changes made. If changes are logged, you can find out at any time, what was changed and when and how the change was made. This can sometimes make the analysis of errors easier. In financial accounting, for example, change documents are used to make auditing possible. Changes are logged in change documents, which can be created for actual or planned changes.
-XQH
6$3 $*
&RQFHSW
For changes to a commercial object to be able to be logged in a change document, the object must have been defined in the system as a change document object. A FKDQJH GRFXPHQW REMHFW definition contains the tables which represent a commercial object in the system. The definition can also specify whether the deletion of individual fields is to be documented. If a table contains fields whose values refer to units and currency fields, the associated table, containing the units and currencies, can also be specified. It must be specified for each table, whether a commercial object contains only one (single case) or several (multiple case) records. For example, an order contains an order header and several order items. Normally one record for the order header and several records for the order items are passed to the change document creation when an order is changed. The name under which a change document object is created is an REMHFW FODVV.
The object class BANF was defined for the change document object Purchase requisition, which consists of the tables EBAN (purchase requisition) and EBKN (purchase requisition account assignment). Changes to this commercial object can then be saved in the system under the object values of this change document object, i.e. the REMHFW ,' and a change document number. The object ID is the key to the object value, i.e. all records which are defined as belonging to a given change document object. All changes to a commercial object constitute an object value under this key. This is for example the order number for orders or the number range object name for number range objects. All changes to a given order or to a given number range object can be accessed in this way.
The object value BANF with the object ID "3000000000" consists of the records of the tables EBAN and EBKN with the order number "3000000000". If changes are not yet to be made, but are planned, they can be logged as SODQQHG FKDQJHV. A planned date for the changes can be specified. The planned changes can be analyzed and copied into the tables. You must program the copy yourself. All logging functions are supported by SAP function modules. The application development must contain certain INCLUDE programs. Old and new status are passed to the change document creation. The included function modules determine the changes for all table fields which are flagged as being change-relevant in the Dictionary.
&KDQJH GRFXPHQW
A change document logs changes to a commercial object. The document is created independently of the actual database change. The change document structure is as follows: &KDQJH GRFXPHQW KHDGHU The header data of the change to an object ID in a particular object class are stored in the change document header. The change document number is automatically issued.
-XQH
6$3 $*
&KDQJH GRFXPHQW LWHP The change document item contains the old and new values of a field for a particular change, and a change flag. The change flag can take the following values: 8SGDWH Changed data. (Log entry for each changed field which was flagged in the Dictionary as change document-relevant) ,QVHUW Data inserted. Changes: Planned changes:
Log entry for the whole table record Log entry for each table record field
'HOHWH Data were deleted (log entry for the whole table record) ,QGLYLGXDO ILHOG GRFXPHQWDWLRQ Delete a table record with field documentation 1 log entry per field of the deleted table entry, the deleted text is saved
&KDQJH GRFXPHQW QXPEHU The change document number is issued when a change is logged, i.e. when the change document header is created by the change document creation function module (function group SCD0).
The change number is not the same as the change document number. The FKDQJH GRFXPHQW QXPEHU is issued automatically by the function group SCD0 function modules when a change document is created for a change document object. The FKDQJH QXPEHU is issued by the user when changes are planned. The same change number can be used for various change document objects.
,QWHUQDO SURFHVVLQJ
When the object-specific update is called, the object-specific change document creation is called. The object-specific change document header is written with a change document number. The Dictionary is searched for which fields are to be logged for each table in the object definition. The log records for these fields are then created as change document items according to the object definition.
-XQH
6$3 $*
3URFHGXUH
To use the change document functionality in your application, proceed as follows: 1. Define the change document object 2. Check in the Dictionary, whether the data elements of the fields which are to be logged are flagged appropriately. 3. Generate the update. 4. Program the appropriate calls in your program.
-XQH
6$3 $*
7. After inputting all relevant tables, choose ,QVHUW HQWULHV. The new entries are copied into the display. 8. Save your entries.
-XQH
6$3 $*
If the flag is set by hand, it can have undesirable side-effects: If a table field in another application, which is based on the data element in question, belongs to a change document object, but was not previously logged, setting the flag will start logging in this application as well. It is therefore important to consider whether data elements are, or could be, change-relevant when creating them, and to set the flag accordingly. If the data element is not in any change document object via a table field, this has no negative effect on the system.
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ *HQHUDWH XSGDWH DQG ,1&/8'( REMHFWV
6$3 $*
3. Choose *HQHUDWH The following INCLUDE objects are generated: FKDQJH GRFXPHQW REMHFW!B:5,7(B'2&80(17 The object-specific update function module calls the following function modules, with object-specific parameters: CHANGEDOCUMENT_OPEN
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ *HQHUDWH XSGDWH DQG ,1&/8'( REMHFWV CHANGEDOCUMENT_SINGLE_CASE and/or CHANGEDOCUMENT_MULTIPLE_CASE and possibly CHANGEDOCUMENT_TEXT_CASE CHANGEDOCUMENT_CLOSE
).!&'& INCLUDE program part with FORM statement for calling the object-specific update program. ).!&'7 INCLUDE program part containing two INCLUDE program parts (F<K4>CDF and F<K4>CDV, see below), which contain the data definitions which are to be passed to the update program. The data definitions correspond to the function group SCD0 function modules interface definition. The fields, record fields and tables are to be filled in in the application program and passed to the update program. ).!&') INCLUDE program part with data definitions which are the same for all change document objects.
).!&'9 INCLUDE program part with data definitions, which are specific to the change document object. 9'' VWUXFWXUH QDPH ! (only for multiple case tables) This structure contains the following INCLUDE structures: INCLUDE INCLUDE INCLUDE <table name> KZ <ref. table name>
The generated program parts contain the object-specific program code, and are included in the application program per INCLUDE statement. The data definitions of the change document-relevant fields correspond to the function group SCD0 function module interface definitions.
If several change document objects are to be processed in one application program, the update program must be generated for each change document object with a different <K4> code (e.g. XX01, XX02, XX03 etc.).
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ ,QWHJUDWLQJ WKH IXQFWLRQDOLW\ LQWR WKH SURJUDP
6$3 $*
The INCLUDE program part F<K4>CDT can only be included once, because it contains a further INCLUDE program part (F<K4>CDF, with generally valid data definitions), which is also contained in the other F<K4>CDT program parts (e.g. FXX02CDT, FXX03CDT, etc.). It must be included in the global data definitions. In this case the F<K4>CDT program part must be included for the first change document object or <K4> code, which contains the INCLUDE program parts for general (F<K4>CDF) and object-specific data definitions (F<K4>CDV), for all others only the F<K4>CDV program parts.
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ :ULWLQJ WKH ILHOGV LQ WKH SURJUDP
*HQHUDO GDWD
These are the fields which are defined in the INCLUDE program part ).!&'). 2%-(&7,' Object value (key) of the object 7&2'( Transaction, with which the change was made 87,0( Change time 8'$7( Change date 86(51$0( Changed by
2EMHFWVSHFLILF GDWD
These are the fields which are defined in the INCLUDE program part ).!&'9. 6LQJOH FDVH WDEOHV Table
WDEOH QDPH ! or record fields ROG UHFRUG ILHOGV QDPH ! (with the table structure) The table header record or the record fields must contain the original data. Table WDEOH QDPH ! The table header record must contain the new data. Table
UHI WDEOH QDPH ! (only if UHI WDE QDPH was specified when the change document object was defined) The table header record must contain the original currencies and units. 83'BWDEOH QDPH ! With this flag, you specify the processing logic. The following values are possible:
- "'" (DELETE)
A change document item is to be created for the record in *<table name > or <old record fields name > which is to be flagged as deleted. <table name > is not processed.
- "," (INSERT)
A change document item is to be created for the record in <table name > which is to be flagged as created. *<table name > or <old record fields name > is not processed.
- "8" (UPDATE)
*<table name > or <old record fields name > and <table name > are compared and a change document item is created for each changed field. The keys of *<table name > or <old record fields name > and <table name > must be identical.
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ :ULWLQJ WKH ILHOGV LQ WKH SURJUDP
6$3 $*
These tables must be passed sorted by key. <WDEOH QDPH ! The table must contain the original version of the changed or deleted records. The structure consists of the table, as specified in the change document object definition under WDEOH QDPH, a processing flag (TYPE C, length 1) and possibly the structure of the associated currency and units table, as specified in the definition of the change document object under 5HI WDEOH QDPH It is created during the change document object INCLUDE generation and saved under the name V<table name > in the Dictionary.
The processing flag can be switched from space to "D", if it is to be processed in the application. Otherwise it has no effect. ;WDEOH QDPH ! The table must contain the current version of the changed or created records. The structure is the same as Y<table name > (see above). The following values are possible for the processing flag:
- "," (INSERT)
Records were created, or table records were deleted, then a record with the same key was created in the same transaction, and this is to be documented as Delete and Create (special case), not as Change.
Multiple case internal table processing flags can always contain space, with the exception of the special case (in X<table name >). The possibility of setting the processing flag to "D", "I" or "U" as well was created so that the tables could also be used for other purposes in which such processing flags are useful, in application programs. 83'BWDEOH QDPH ! With this flag you determine the processing logic. The following values are possible:
- "'" (DELETE)
A change document item is to be created for each record in Y<table name > which is to be flagged as deleted. X<table name> is not processed.
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ :ULWLQJ WKH ILHOGV LQ WKH SURJUDP
- "," (INSERT)
A change document item is to be created for each record in X<table name> which is to be flagged as created. Y<table name> is not processed.
- "8" (UPDATE)
The keys of TABLE_OLD and TABLE_NEW are compared. The following cases are distinguished: 5HFRUG H[LVWV LQ 7$%/(B2/' EXW QRW LQ 7$%/(B1(: Change document items are to be created for the record in TABLE_OLD which is to be deleted. 5HFRUG H[LVWV LQ 7$%/(B1(: EXW QRW LQ 7$%/(B2/' A change document item is to be created for the records in TABLE_NEW which are to be flagged as created. 5HFRUG H[LVWV LQ ERWK 7$%/(B2/' DQG 7$%/(B1(: A change document item is created for each changed field which is defined as change document-relevant in the Dictionary.
- TEILOBJID
Key of the changed table record
- TEXTART
Text type of the changed texts
- TEXTSPR
Language key
- UPDKZ
- "8"
Table is taken into account by the update program
2SWLRQDO SDUDPHWHUV
You can also use the following INCLUDE program part ).!&') parameters: &'2&B3/$11('B25B5($/ With this parameter you control whether the changes to be logged are actual or
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ :ULWLQJ WKH ILHOGV LQ WKH SURJUDP planned changes. Possible values 5 3 (space) actual (real) changes planned changes if no plan number exists: if a plan number exists: actual change planned change
6$3 $*
&'2&B83'B2%-(&7 If the change document is relevant for determining which change action was performed for the object, you can pass the action performed here. Possible values: , the object was inserted. 8 the object was changed. ' the object was deleted.
-XQH
6$3 $*
These function modules are called, in the right order, by the object-specifically generated update program, as soon as it is called. They are generally not required for application developments. Only in exceptional cases, in which an individual update is to be programmed, should the change document creation be programmed by the user with these function modules. &+$1*('2&80(17B23(1 This function module is required by every change document creation. It initializes the internal fields for a particular change document object ID. &+$1*('2&80(17B08/7,3/(B&$6( This function module creates change document items. The change data are passed in tables. &+$1*('2&80(17B6,1*/(B&$6( This function module creates change document items. The change data are passed in a work area. &+$1*('2&80(17B7(;7B&$6( Change document-relevant texts are passed in a structure with this function module. &+$1*('2&80(17B&/26( This function module is required for every change document creation. It writes the change document header for a particular change document ID, and closes the document creation. &+$1*('2&80(17B35(3$5(B7$%/(6 With this function module, you compare the records in two tables, which you pass as TABLE_OLD and TABLE_NEW. You can specify via a parameter, whether these internal tables should be prepared for the multiple case. Identical records are then deleted, and a processing flag is set in changed records.
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 5HDG DQG IRUPDW FKDQJH GRFXPHQWV
6$3 $*
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 5HDG DQG IRUPDW SODQQHG FKDQJHV
The change number is not the same as the change document number. The FKDQJH GRFXPHQW QXPEHU is automatically issued by the function group SCD0 function modules when a change document object change document is created. The FKDQJH QXPEHU is assigned by the user when changes are planned. The same change number can be used for various change document objects. 3/$11('B&+$1*(6B5($'B326,7,216 This function module reads the change document items for a given change document number, and formats the old and new values according to their type.
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 'HOHWH FKDQJH GRFXPHQWV DQG SODQQHG FKDQJHV
6$3 $*
The change number is not the same as the change document number. The FKDQJH GRFXPHQW QXPEHU is issued automatically by the function group SCD0 function modules when a change document object change document is created. The FKDQJH QXPEHU is issued by the user when changes are planned. The same change number can be used for various change document objects.
-XQH
6$3 $*
-XQH
6$3 $*
3URFHGXUH
3URFHGXUH >3DJH @ 'HILQH DSSOLFDWLRQ ORJ REMHFWV >3DJH @
5HIHUHQFHV
&UHDWH DSSOLFDWLRQ ORJ >3DJH @ 'LVSOD\ DSSOLFDWLRQ ORJ >3DJH @ 5HDG DSSOLFDWLRQ ORJ >3DJH @ 'HOHWH DSSOLFDWLRQ ORJ >3DJH @
-XQH
6$3 $*
2YHUYLHZ
Application events can be centrally logged in the application log. The advantage is system-wide standardized and uniform event logging, which is convenient to analyze. Several different logs (for various objects) can be written at the same time by an application. The application log is, in principal, similar to the system log. Whereas system event information is logged in the system log, relevant application events should be captured in the application log. The application log can also be used as a message collector.
-XQH
6$3 $*
&RQFHSW
Application log objects are defined in the system. The object definition assigns a work area. An object can be divided into sub-objects. Logging is performed object-specifically, via function modules. An object log entry has the following structure: /RJ KHDGHU with a unique log number. It contains the information, who, when, with which program or which transaction, gave rise to which event. It also contains the problem class of the message in the log with the greatest urgency. Any number of ORJ PHVVDJHV with their urgency. The messages are divided into problem classes according to their urgency.
The log data are initially collected in local memory, and are then written to the database. This procedure speeds up processing and reduces the number of database accesses. It is also possible to write log data to the database individually, to avoid losing the log records collected up to that point in the event of termination of the application, for example if the system crashes. The logged data can be read in the database and displayed on the screen. It is also possible to read and to display the log data which is buffered in local memory with a log number (Message collector). The logs have an expiry date, by which time at the latest they must be in the database. They can later be removed from the database again, by a delete program. Detailed information, either for the whole log or for each individual log message, can be saved in two ways: Text module with any number of parameters User exit with any number of parameters
When the log is analyzed either the text module with the specified parameters is displayed, or the user exit is performed, on request. Additional information can be saved in an INDX-type table, which is used by the user exit analysis. In this way it is possible, for example, to save lists which can be displayed when the log is analyzed, with the help of the user exit. Classifying attributes can also be specified (importance of the log, or of the message). If you want to perform your own log analysis, you can use the function modules to read from the database or from local memory. Logs can be deleted if necessary.
-XQH
6$3 $*
3URFHGXUH
Before you can log events, you must first define an object, and possibly sub-objects. Application log objects are maintained in an extra maintenance transaction. You can then create and analyze the object log by calling the appropriate function modules.
-XQH
6$3 $*
4. Enter a descriptive short text. 5. Save your entries. 6. If you want to define sub-objects: a) Choose the line with the object. b) Choose 7DEOH YLHZ 2WKHU YLHZ A structure overview is displayed for selection. c) Position the cursor on Sub-objects, and choose &KRRVH. The sub-object display window for the chosen object is displayed. d) Choose 1HZ HQWULHV. e) Enter a sub-object name (beginning with Y or Z) and a descriptive short text. f) Save your entries.
If several systems are being used, the object data must be transported. Subobject data are not automatically transported with the object. They must each be entered separately in a change request.
-XQH
6$3 $*
-XQH
6$3 $*
-XQH
6$3 $*
-XQH
6$3 $*
-XQH
6$3 $*
-XQH
6$3 $*
2YHUYLHZ
Application data must often be stored in files outside the database. Depending on the particular operating system in use, files are stored in different directories, and file and path names must comply with different syntax requirements. Therefore, many SAP application programs use platform-independent logical file names and call the function module FILE_GET_NAME when storing data in files. The function module takes a logical file name as input and returns the corresponding platform-specific file name and path. By using this function module, you can assign file names in your application programs in a standardized way and independently of different hardware and software platforms. To achieve this, logical file names and paths must be defined in the system. These definitions are maintained in the implementation guide in section %DVLV &RPSRQHQWV 6\VWHP $GPLQLVWUDWLRQ 3ODWIRUPLQGHSHQGHQW )LOH 1DPHV, or with transactions FILE and SF01. Definitions used by SAP applications are delivered with the system and possibly adjusted in the implementation process. See the application-specific documentation for information on which applications use which logical file names. Further definitions can be added according to requirements.
-XQH
6$3 $*
The following figure shows the relationships between these objects that determine how a logical file name is converted to a platform-specific file name:
operating system
syntax group
logical path
physical path
-XQH
6$3 $*
<INSTANCE> <SYSID> <DBSYS> <SAPRL> <HOST> <CLIENT> <LANGUAGE> <DATE> <YEAR> <SYEAR> <MONTH> <DAY> <WEEKDAY> <TIME> <STIME> <HOUR> <MINUTE> <SECOND> <PARAM_1> <PARAM_2> <P=name> <V=name> <F=name>
instance of R/3-system name of R/3-system according to system field SY-SYSID. database system according to system field SY-DBSYS R/3-Release according to system field SY-SAPRL host name according to system field SY-HOST client according to system field SY-MANDT logon language according to system field SY-LANGU date according to system field SY-DATUM year according to system field SY-DATUM, 4-character year according to system field SY-DATUM, 2-character month according to system field SY-DATUM day according to system field SY-DATUM week day according to system field SY-FDAYW time according to system field SY-UZEIT hour and minute according to system field SY-UZEIT hour according to system field SY-UZEIT minute according to system field SY-UZEIT second according to system field SY-UZEIT value of Parameter 1 in function module FILE_GET_NAME value of Parameter 2 in function module FILE_GET_NAME value of profile parameter of current system value of variable as defined in variable table value of export parameter OUTPUT of a function module
All physical paths must contain the keyword <FILENAME> as a placeholder for the file name. Inclusion of these parameters in physical file names and paths helps to both differentiate and standardize the assignment of file names. The keyword <TIME>, for instance, can be useful when a file needs to be stored several times in a row within a short time interval. Apart from the system fields, the following keywords, in particular, give you considerable flexibility in assigning file names: <PARAM_1> and <PARAM_2> are replaced by values that are passed explicitly to the function module FILE_GET_NAME in your program. <P=name> is replaced by values of profile parameters of the current system. To get the list of profile parameters and their values, start report RSPARAM.
-XQH
6$3 $*
<V=name> is replaced by values of variables from the customizing tables for platform-independent file names. <F=name> is replaced by values that are returned by function modules. The names of these function modules must have the prefix "FILENAME_EXIT_". Note that in the keyword such a function module is addressed only with the part of its name that follows this prefix. For example, when the function module FILENAME_EXIT_EXAMPLE is used, the appropriate keyword would read <F=EXAMPLE>. The function module used must have the export parameter OUTPUT and no reference type must be specified for this parameter. Import parameters must have default values. Table parameters are not supported.
-XQH
6$3 $*
LOGICAL_FILENAME OPERATING_SYSTEM
FILE_FORMAT
-XQH
6$3 $*
If the function module cannot find a physical path for the current operating system (see parameter EMERGENCY_FLAG), this may have various causes: the operating system is not defined in the customizing tables the operating system is not assigned to a syntax group no physical path is assigned to the logical path for the relevant syntax group no logical path is assigned to the logical file name.
Assume that in the customizing tables for platform-independent file names the following definitions exist for the logical file name DATA_FILE and the logical path DATA_PATH: DATA_FILE SK\V ILOH GDWD IRUPDW ORJLFDO SDWK V\QWD[ JURXS V\QWD[ JURXS file<PARAM_1> BIN DATA_PATH UNIX DOS SK\V SDWK /tmp/<FILENAME> SK\V SDWK c:\tmp\<FILENAME>
DATA_PATH
Assume also that the application servers operating system has been assigned to syntax group UNIX while the presentation servers operating system has been assigned to syntax group DOS. The following two calls of the function module will then return the respective values. &$// )81&7,21
),/(B*(7B1$0(
(;3257,1* /2*,&$/B),/(1$0( 3$5$0(7(5B (0(5*(1&<B)/$* ),/(B)250$7 ),/(B1$0(
'$7$B),/(
)/$* )250$7 )1$0(
,03257,1*
(;&(37,216 ),/(B127B)281' 27+(56 Returned values: FLAG: FORMAT: FNAME: BIN /tmp/file01
&$// )81&7,21
),/(B*(7B1$0(
(;3257,1* /2*,&$/B),/(1$0(
'$7$B),/(
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 7KH )XQFWLRQ 0RGXOH ),/(B*(7B1$0( 86(B35(6(17$7,21B6(59(5 :,7+B),/(B(;7(16,21 ,03257,1* (0(5*(1&<B)/$* ),/(B)250$7 ),/(B1$0( ; ; )/$* )250$7 )1$0(
6$3 $*
(;&(37,216 ),/(B127B)281' 27+(56 Returned values: FLAG: FORMAT: FNAME: BIN c:\tmp\FILE.BIN
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 8VLQJ 3ODWIRUPLQGHSHQGHQW )LOH 1DPHV LQ 3URJUDPV
Problems with storing files may sometimes be due to a mismatch between the paths defined for platform-independent file names and the file system. Generation of a valid platform-specific file name by the function module FILE_GET_NAME is not sufficient; the path generated must also exist in the file system at runtime.
-XQH
6$3 $*
Reference
),/(B*(7B1$0( With this function module you can generate a platform-specific file name for a platform-independent logical file name in your application program at runtime.
-XQH
6$3 $*
1XPEHU UDQJHV
This section explains how you can use the automatic number assignment in your applications. 2YHUYLHZ >3DJH @ &RQFHSW >3DJH @ 1XPEHU UDQJH REMHFW W\SHV >3DJH @
3URFHGXUH
3URFHGXUH >3DJH @ 'HWHUPLQH WKH QXPEHU UDQJH REMHFW W\SH >3DJH @ 0DLQWDLQ QXPEHU UDQJH REMHFW >3DJH @ )XQFWLRQ PRGXOH FDOOV >3DJH @
5HIHUHQFHV
1XPEHU UDQJH DQG JURXS PDLQWHQDQFH GLDORJV >3DJH @ 1XPEHU UDQJH DQG JURXS UHDG DQG PDLQWDLQ VHUYLFHV >3DJH @ 1XPEHU UDQJH REMHFW UHDG DQG PDLQWDLQ VHUYLFHV >3DJH @ 1XPEHU DVVLJQPHQW DQG FKHFN >3DJH @ 8WLOLWLHV >3DJH @
-XQH
6$3 $*
2YHUYLHZ
It is often necessary to directly access individual records in a data structure. This is done using unique keys. Number ranges are used to assign numbers to individual database records for a commercial object, to complete the key. Such numbers are e.g. order numbers or material master numbers. These numbers provide, apart from unique identification of a data record, the possibility of encoding differentiating information for an object. One could tell from the number e.g., to which material type a material belongs. The R/3 number range management also monitors the number status, so that numbers which have already been issued are not re-issued. All dialogs, database accesses or other activities which are necessary for the maintenance of number range objects and number ranges and number allocation in user developments, can be performed using SAP function modules.
-XQH
6$3 $*
&RQFHSW
A commercial object, for which part of the key is to be generated via number ranges, is defined as a QXPEHU UDQJH REMHFW in the SAP system. If this commercial object contains sub-objects, e.g. company codes or controlling areas, this differentiation can also be made in the number ranges. This happens by specifying a field for the sub-object when defining the number range objects. (Example: company code as sub-object of documents) The number range interval within a commercial object and sub-object never overlap. The number range intervals in various sub-objects of a commercial object can overlap. A number range interval is assigned to a commercial object via the number range number. This assignment is usually saved in a table belonging to the commercial object, the group table. The field (OHPHQW must be all or part of this tables key. Elements which refer to the same number range interval form a group. You can decide whether you want to make this assignment possible for the user during the number range object maintenance (via the assignment of elements to groups) or whether you want to program it yourself.
When a new material master is created, the material type should determine from which number range interval a number to complete the material master key should be assigned. The commercial object is the material master, the group table the material type table, with the element field material type as key field. The number range numbers for the various element values (material types) are saved in this table. Material types are e.g. semi-finished or finished products. A QXPEHU UDQJH contains a number range interval with a defined character set. The QXPEHU UDQJH LQWHUYDO consists of numeric or alpha-numeric characters (only for external number ranges) and is delimited by the fields )URP QXPEHU and 7R QXPEHU. Either one interval, or several if financial years are to be distinguished, is assigned to a number range. The QXPEHU UDQJH QXPEHU identifies a number range for the system and makes system-internal access to the number range interval possible. It can be numerical or alpha-numeric. This number is generally assigned system-internally. If you do not need grouping or if you want to program the group table maintenance for the grouping yourself, you must enter the number range number during interval maintenance yourself. If financial years are to be distinguished in the number assignment, there can be several intervals. Separate intervals are then specified for each financial year. Number ranges can be H[WHUQDO (number to be assigned manually by the user) or LQWHUQDO (number assigned automatically by the system). A commercial object can either have only one number range (external RU internal) or two number ranges (external DQG internal). The various distinctions between commercial objects gives rise to eight Number range object types [Page 95].
-XQH
6$3 $*
be maintained via the standard maintenance dialog for number range intervals. If you do not want to do this, you must program it yourself. Groups can be either dependent or independent of sub-objects. This depends on whether the sub-object is a group table field. The following table shows as an example the grouping of material types and the associated number range assignment.
*URXSLQJ PDWHULDO W\SHV Group Group 1 Group 1 Group 2 Material type )LQLVKHG 6HPLILQLVKHG 5DZ PDWHULDO Internal no. range 01 01 03 External no.range 02 02 04
The material types )LQLVKHG and 6HPLILQLVKHG form one group, and the material type 5DZ PDWHULDO another.
-XQH
6$3 $*
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 1XPEHU UDQJH REMHFW W\SHV 7KH HLJKW QXPEHU UDQJH REMHFW W\SHV
Object
6$3 $*
Without sub-object
With sub-object
With group
With group
The following illustration shows, using two examples, the relationships between the concepts described in the previous sections.
-XQH
6$3 $*
To-Fiscal Year 1980 1990 2000 1 ... 50 1 ... 50 51 ... 100 Number range 01
Example of accounting document table ... 001 0037 ... 001 0037 1980 GI ...
Example of material master table ... ... ... ... 00100 00101 00400 00200 FINI FINI RAW SEMI CLOCK RADIO TOASTER IRON PIN TRANSISTOR ... ... ... ...
1990 GR ...
-XQH
6$3 $*
3URFHGXUH
If you want to use the SAP number range functionality in your application, proceed as follows: 1. Determine which type the new number range object is to have, and create the definition. 2. Maintain the number range intervals for the new object, or have them maintained by the end users. 3. Use the Number assignment and check [Page 108] function modules in your application program.
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 'HWHUPLQH WKH QXPEHU UDQJH REMHFW W\SH
From the answers to these questions, using the illustration Eight number range object types, you can uniquely determine the type.
-XQH
6$3 $*
&UHDWH VXEREMHFW
If you want differentiate a number range object, enter the data element according to whose value you want to differentiate: 'DWD HOHPHQW VXEREMHFW (object types 4-8) This data element must exist and be active in the Dictionary and have a check table. The domains must have a field length between 1 and 6.
&UHDWH JURXSV
If the commercial objects are to be grouped by elements, you can specify, by completing the following fields, that the group table is to be maintained via the standard maintenance dialog. Otherwise you must program the assignment yourself. *URXS WDEOH (object types 2, 3, 5-8) Enter the name of the table which contains the grouping element, e.g. for the material master, the material type table. The table must exist and be active in the Dictionary and contain the number range element field as key. If the groups depend on the subobject, the sub-object must be part of the key. Otherwise the group table must not
-XQH
6$3 $*
have any other key fields. A group table can only be assigned to at most one number range object. 6XEREMHFW ILHOG LQ JURXS WDEOH (object types 7 and 8) If the commercial object is differentiated by sub-object, and the groups are dependent on the sub-object, enter here the group table field which contains the sub-object value (object types 7 and 8). The sub-object field must be part of the key. 1R UDQJH HOHPHQW ILHOG (object types 2, 3, 5-8) If the commercial object is to be grouped, enter here the group table field which contains the value according to which groups are to be formed. The number range element field must be part of the key. ,QWH[WQR UDQJH QR ILHOG (object types 3, 6, 8) Enter here the group table fields for internal and external number ranges, if the application is to support both external and internal number assignment. A group table must be specified at the same time. The fields must have the format char (2) or num (2). 1R UDQJH QR ILHOG (object types 2, 5, 7) Enter here the group table field for the number ranges, if the application is to support only one number range (external or internal). The field must be part of the key and have the format char (2) or num (2). Whether it is an external or internal number range is indicated when the interval for this number range is created.
You must also maintain the following element text table entries with the text entries maintenance function: (OHPHQW WH[W WDEOH /DQJXDJH ILHOG 6XEREMHFW ILHOG This field only appears in the interface when the groups are defined as being dependent on sub-objects. (OHPHQW ILHOG 7H[W ILHOG
When you have saved the input data, number range intervals can be created for the object.
-XQH
6$3 $*
-XQH
6$3 $*
The following illustration shows the context of the function groups and their possible connections to application programs. )XQFWLRQ JURXSV RYHUYLHZ
Menu
Driver SNUM Function group SNR0 Call via parameter transaction acc. to def. of num.range object Maintenance dialog for number ranges, intervals, and groups
Application program
CALL FUNCTION ... ... CALL FUNCTION ... ... CALL FUNCTION ...
CALL FUNCTION Services for reading and maintaining num. range intervals and groups Services for reading and maintaining and maint. dialog of num. range objects Number check and assignment
DB
Tools
If you want to work with the standard number range functionality, you only need the function modules in the function group SNR3.
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 1XPEHU UDQJH DQG JURXS PDLQWHQDQFH GLDORJV
6$3 $*
The function modules which are labeled " " can only be used for the object types 2 and 3 and 5-8 (see illustration in number range object types). 180%(5B5$1*(B6+2: This function module displays the groups which exist for a particular number range object, with their number range intervals. After return, the return code chosen by the user (%DFN or &DQFHO) is available. 180%(5B5$1*(B(/(0(176B6+2: This function module displays all elements, which are assigned to a number range interval. After return, the return code chosen by the user (%DFN or &DQFHO) is available. 180%(5B5$1*(B,17(59$/B0$,17$,1 With this function module the maintenance dialog for number range intervals for a given number range object is offered. A parameter specifies the processing type. Possible processing types are:
Maintain intervals Change number status Display intervals Create new groups (only for object types 2 and 3 and 5-8)
The dialog path is determined by the object type. After return, the return code chosen by the user (%DFN or &DQFHO) is available. 180%(5B5$1*(B*5283B0$,17$,1 This function module is the maintenance dialog (Create, Change, Display) for number range groups for a given number range object. A processing flag determines whether the object is to be displayed only or whether it can be maintained. Groups are deleted by deleting their intervals. After return, the return code chosen by the user (%DFN or &DQFHO) is available. 180%(5B5$1*(B68%2%-(&7B&23< (only object types 4-8) This function module enables you to copy number range objects from groups and intervals of an existing sub-object of a given number range object to another of its existing sub-objects. After return, the return code chosen by the user (%DFN or &DQFHO) is available. 180%(5B5$1*(B68%2%-(&7B*(7 (only object types 4-8) This function module provides a dialog box in which the user can enter a sub-object for a given number range object. If the specified sub-object already exists for the number range object, it is returned in the export parameter. If it does not exist, either an exception is raised or the return code "A" for user abort is returned.
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 1XPEHU UDQJH DQG JURXS UHDG DQG PDLQWDLQ VHUYLFHV
Function modules marked with " " can only be used for the object types 2 and 3 and 5-8 (see illustration in number range object types). 180%(5B5$1*(B(148(8( With this function module, you lock the number range object which is to be maintained, and its groups and intervals, for access by other users. Lock errors are returned as exceptions. 180%(5B5$1*(B'(48(8( With this function module, you unlock the number range object which has been maintained. 180%(5B5$1*(B(/(0(17B/,67 This function module gets the elements which are assigned to a particular number range interval for a number range object. The elements found are passed in a table. Errors are returned as exceptions. 180%(5B5$1*(B(/(0(17B7(;7B/,67 With this function module you can find element texts in the specified language for a given number range object. The texts are returned in a table. Execution errors are returned as exceptions. 180%(5B5$1*(B*5283B/,67 This function module gets information about groups and the associated group and element texts for a specified number range object. The information is put in a table. The table can be used to change the element assignment or the group text. The change request is to be passed to the function module NUMBER_RANGE_GROUP_UPDATE. Errors are returned as exceptions. 180%(5B5$1*(B*5283B83'$7( With this function module, already assigned elements can be assigned to other intervals, or the assignment can be withdrawn. Group texts can also be maintained. All change requests are checked. Request errors are returned in an error table. The changes are passed in an internal table and are copied into the local memory of the function group. Before you call this function module, you must lock the number range object in question with NUMBER_RANGE_ENQUEUE, and unlock it again with NUMBER_RANGE_DEQUEUE after writing the changes to the database. To copy the contents of local memory to the database, call the function module NUMBER_RANGE_UPDATE_CLOSE. 180%(5B5$1*(B,17(59$/B/,67 This function module gets the existing intervals to a given number range object, and puts them in a table. The table can be passed to the function module NUMBER_RANGE_INTERVAL_UPDATE to change intervals.
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 1XPEHU UDQJH DQG JURXS UHDG DQG PDLQWDLQ VHUYLFHV
6$3 $*
180%(5B5$1*(B,17(59$/B83'$7( With this function module you maintain intervals for a given number range object. The changes are passed in an internal table, and are copied into local memory. Before you call this function module, you must lock the number range object in question with NUMBER_RANGE_ENQUEUE, and unlock it again with NUMBER_RANGE_DEQUEUE, after the changes have been written to the database. To copy the contents of local memory to the database, call the function module NUMBER_RANGE_UPDATE_CLOSE. 180%(5B5$1*(B2%-(&7B*(7B,1)2 This function module gets information for a given number range object. This information is put in a table structure, which must be declared like the table structure INROI. 180%(5B5$1*(B68%2%-(&7B/,67 (only object types 4-8) This function module gets the existing sub-objects of a given number range object, and puts them in the table passed. 180%(5B5$1*(B68%2%-B*(7B,1)2 This function module gets information about the existing sub-objects of a given number range object. This information is put in a table structure, which must be declared like the table structure INROI. 180%(5B5$1*(B83'$7(B&/26( With this function module you write changes which have been made to local memory to the database, with NUMBER_RANGE_GROUP_UPDATE and NUMBER_RANGE_INTERVAL_UPDATE. After calling this function module, you should unlock the changed number range object. 180%(5B5$1*(B83'$7(B,1,7 With this function module, you can initialize local memory if you want to discard the changes which have not yet been copied to the database.
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 1XPEHU UDQJH REMHFW UHDG DQG PDLQWDLQ VHUYLFHV
-XQH
6$3 $*
-XQH
6$3 $*
8WLOLWLHV
)XQFWLRQ JURXS 615
180%(5B5$1*(B,17(59$/B,1,7 With this function module you initialize all internal number range intervals of a specified number range object or sub-object.
-XQH
6$3 $*
$UFKLYLQJ
This section explains how you can create a user archiving program using the Archive Development Kit.
&RQFHSW
2YHUYLHZ >3DJH @ $'. DV DUFKLYLQJ SURJUDP GHYHORSPHQW HQYLURQPHQW >3DJH @ ,QWHUDFWLRQ EHWZHHQ 3URJUDP $'. DQG $UFKLYH ILOH >3DJH @ $UFKLYLQJ ZLWK $'. >3DJH @ $UFKLYLQJ REMHFW >3DJH @ 6WDQGDUG FODVV >3DJH @ $UFKLYLQJ FODVVHV >3DJH @ $UFKLYH PDQDJHPHQW >3DJH @ 1HWZRUN JUDSKLF >3DJH @ $FFHVVLQJ GDWD REMHFWV LQ WKH DUFKLYH ,QGH[ >3DJH @
3URFHGXUH
'HYHORSLQJ DUFKLYLQJ SURJUDPV >3DJH @ 'HILQH DUFKLYLQJ REMHFWV >3DJH @ 'HILQH VWDQGDUG FODVV KLHUDUFKLFDO VWUXFWXUH >3DJH @ $UFKLYH FXVWRPL]LQJ >3DJH @ $VVLJQ DUFKLYLQJ FODVVHV >3DJH @ 'HYHORS DUFKLYLQJ SURJUDP >3DJH @ 6WDQGDUG DUFKLYLQJ SURJUDP >3DJH @ $UFKLYLQJ XVLQJ DUFKLYLQJ FODVVHV >3DJH @ 'HYHORS GHOHWH SURJUDP >3DJH @ 'HYHORS UHORDG SURJUDP >3DJH @ 'HYHORS DQDO\VLV SURJUDP RSWLRQDO >3DJH @ 0DLQWDLQ QHWZRUN JUDSKLF >3DJH @ &UHDWH DQ LQGH[ DQG XVH LW WR DFFHVV LQGLYLGXDO GDWD REMHFWV LQ WKH DUFKLYH >3DJH @
$UFKLYLQJ FODVVHV
8VH RI DUFKLYLQJ FODVVHV >3DJH @ 'HYHORS DUFKLYLQJ FODVVHV >3DJH @ 6SHFLI\ IXQFWLRQ JURXS >3DJH @ 'HYHORS IXQFWLRQ PRGXOHV >3DJH @ 'HYHORS )RUP URXWLQHV >3DJH @ ,QLWLDOL]H WKH DUFKLYLQJ FODVV IRU ZULWLQJ >3DJH @
-XQH
6$3 $*
*HW GDWD >3DJH @ 'HOHWH DUFKLYLQJ FODVV ORFDO PHPRU\ >3DJH @ 'HFODUH D KDQGOH LQYDOLG >3DJH @ ,QLWLDOL]H WKH DUFKLYLQJ FODVV IRU UHDGLQJ >3DJH @ &RS\ GDWD IURP WKH GDWD FRQWDLQHU >3DJH @ 'HOHWH DUFKLYHG GDWD >3DJH @ 'LVFDUG WKH GDWD IODJJHG IRU GHOHWH >3DJH @ 5HORDG DUFKLYHG GDWD >3DJH @ 'HILQH DUFKLYLQJ FODVV >3DJH @
5HIHUHQFH
$UFKLYLQJ IXQFWLRQV >3DJH @
-XQH
6$3 $*
2YHUYLHZ
Archiving compresses system data und stores it on external storage media. The archived data can then be deleted in the system. Memory can then be re-used, and the archived data are stored safely. Archiving is recommended in the following cases: WKH GDWDEDVH LV RFFXSLHG E\ PDVV GDWD which must be stored externally PDVWHU GDWD DUH QR ORQJHU UHTXLUHG
SAP provides the $rchive 'evelopment .it ($'.) for the realization of secure and efficient archiving procedures, to support and simplify the development of archiving programs. The ADK is designed to be used in Client/Server architecture. The system load is shared among the database and application servers. This makes efficient use of system resources. At the same time, data localization and the provision of access function modules support object oriented procedures, which in turn help you to keep your data consistent. The ADK provides the interfaces, function modules, example programs and documentation which you need to develop your own archiving programs. Particularities of the new archiving are: FRQQHFWLRQ WR WKH DUFKLYH V\VWHP FRPSUHVVLRQ during archiving the possibility of DUFKLYLQJ ZKLOH WKH V\VWHP LV UXQQLQJ greater HDVH RI XVH QHWZRUN JUDSKLF for showing object dependencies access to individual data objects in the archive
You can use the program RSARCH09 to copy old transaction F040 archiving procedures. You must identify from which archiving objects you want to copy the old control data into the new archive management by entering the name of the archiving object under which the control data are to be copied into the new archive management, in the field 5HRUJ YDULDQW in the table TR01 (6\VWHP 6HUYLFHV 7DEOH PDLQWHQDQFH). When the control data have been successfully copied, the program RSARCH09 deletes the entry in table TR01, so the old archiving program can no longer be executed via the transaction F040.
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ $'. DV DUFKLYLQJ SURJUDP GHYHORSPHQW HQYLURQPHQW
These components provide an environment in which you can develop your own archiving program. Example programs are also provided. The archiving object and standard class methods are provided as function modules. You do not need to know the technical details of the archiving procedures, as they are localized in the function modules. You can use all the ADK functionality because your archiving programs communicate with these function modules. The ADK performs many of the necessary archiving activities for you. You can develop simple programs very quickly using the standard class (which already exists in the system) function modules and appropriate control parameters. If you want to develop more complex, object-oriented archiving programs, you should use the functionality provided in dedicated archiving classes provided by an expert in the area, which contain, and hide, all information which is specific to the data to be archived. This offers you the advantage that you no longer need detailed knowledge of the commercial object in question, because you need not concern yourself with the technical realization. You only need to call the appropriate function modules, which then perform the technical processing for you. The development of an archiving program is based on the definition, in the system, of an Archiving object [Page 118], in which is specified which tables comprise a commercial object. Archiving objects are complex objects of inter-dependent tables. They can contain sub-objects which are used repeatedly in the system, e.g. change documents. If, in exceptional cases, archiving object data structures only become known after delivery to customers, it is posible to generate the required archiving programs (see Generate archiving programs [Page 164]).
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ ,QWHUDFWLRQ EHWZHHQ 3URJUDP $'. DQG $UFKLYH ILOH
6$3 $*
5 V\VWHP
'%
'% LQWHUIDFH
/ ' %
$%$3 SURJUDP
$UFKLYLQJ FODVV
$'.
Conversion of: Codepage, record structures, number formats, for example DEC/HP integer conversion
$UFKLYH/LQN
-XQH
6$3 $*
. .
. .
. .
. .
. .
. . .
standard class with handle archiving program archiving object data container with data packets archiving object methods with handle
archive with a logical archive file which can consist of several physical files
([SODQDWLRQV
7KH DUFKLYLQJ SURJUDP selects data to be archived in the database, according to specified criteria, so that they can be passed to the archive file. Records can be flagged for subsequent deletion by the delete program.
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ $UFKLYLQJ ZLWK $'. A single table field is the smallest recognizable entity in the program.
6$3 $*
The data object to be archived or read from the archive file is passed to a ORJLFDO GDWD FRQWDLQHU. The archiving object standard class or archiving class methods access this data container. Table entries or archiving class data packets are the smallest recognizable entity when reading or writing data to the data container with the archiving or read program respectively. The data are passed between the data container and the archive file by the archiving object methods.
7KH DUFKLYH ILOH contains the archived data objects of an archiving object. The size in bytes or the number of data objects is specified by a customizing setting. Any number of data objects, up to the maximum file size, can be written. The program accesses the archive file with archiving object function modules. For these function modules, a data object is the smallest recognizable unit. If a maximum archive file size was specified in customizing, and if this size is exceeded when writing to an archive file, a new file is created. All archive files for an archiving object in one archiving session are handled as one logical file.
-XQH
6$3 $*
$UFKLYLQJ DFWLYLWLHV
Archiving consists of at least two activities: :ULWH WKH GDWD ZKLFK LV WR EH DUFKLYHG IURP WKH GDWDEDVH LQWR WKH DUFKLYH ILOH The data objects which are to be archived are written sequentially in the archive file. A data object consists of a record sequence according to the object definition. The data are compressed by object.
This program can generally be executed during dialog processing. The program is executed in the archive management via the action Create archive, always in the background. The system looks for the next free background process, preferably on the DB server. The data to be archived are written in archive files. The size of the files and the number of data objects is specified In the Archive customizing [Page 130]. If this size or number is reached while writing, the archive file is automatically closed and a new one is created. 'HOHWH GDWD IURP WKH GDWDEDVH The program first reads the archived data in the archive file. After reading, these data are usually deleted from the database. Sometimes only a delete flag is set, and the deletion is carried out later. The program can then pass the archive files to the ArchiveLink, if an archiving system is connected via ArchiveLink. In Archive customizing [Page 130] it can be specified whether the delete program is to be called automatically after closing an archive file.
-XQH
6$3 $*
$UFKLYLQJ REMHFW
If the data for a commercial object are to be archived, you must first determine which data belong to the object, how they are to be archived and which processing options should be available. This definition is saved in the system as an archiving object. The archiving object specifies the database tables from which archiving data are to be taken. Archiving classes, which are tailored to particular logical objects (e.g. change documents) can be used.
An accounting document with all its items, change documents and long texts is an archiving object.
These function modules return an identifying number (archive handle), with which you can access the associated archive file and its data container in all accesses from the program. close archive file )RU ZULWH DFFHVV get new data object (initialize data container) ARCHIVE_NEW_OBJECT write data object from data container into archive file ARCHIVE_SAVE_OBJECT
This is the moment at which the archive class data are fetched from the database and written into the data container, if archiving classes are being used. )RU UHDG DFFHVV LQFO UHORDG
-XQH
6$3 $*
read next data object from the archive into the data container ARCHIVE_GET_NEXT_OBJECT
How the data is transfered from the database into the data container depends on the existence of archiving classes: $UFKLYLQJ FODVVHV H[LVW The data are passed by the archiving class function modules. 1R DUFKLYLQJ FODVVHV H[LVW The data must first be copied into the program area using user program logic, and can then be put in the data container using the standard class function modules.
-XQH
6$3 $*
6WDQGDUG FODVV
The standard class is a set of function modules which are available to all archiving objects. These function modules perform general archiving data accesses. The functionality includes data set read and write and simple conversions during reading, such as changing the code page, the number format or in sentence structure. Archived data can not be deleted from the database or reloaded with the standard class. If you use the standard class for an archiving object, you must program such actions yourself. This standard class is general, it must be told which archiving object it is dealing with. This information is passed in control parameters.
3UHFRQGLWLRQV
The archiving object must be defined in the system.
-XQH
6$3 $*
$UFKLYLQJ FODVVHV
Archiving classes make object-oriented processing of the data to be archived possible. They simplify access to the data of commercial entities for the archiving. An archiving class is a set of function modules and form routines for a commercial object, which is usually used repeatedly as a service function in the system and is archived with the data where it is used, rather than independently, e.g. SAPscript texts, change documents, or purchase requisitions. It collects the data and passes it as a data packet to the data container. This data packet can only be processed by the archiving class own function modules. Because of the localization of the data, the calling program no longer needs to know the particular data structures and hierarchies. By using archiving classes, you can easily archive data of which you have no detailed knowledge.
The archiving classes should be created by the developer resposible for the archiving object in question. The development of archiving classes involves an initial additional work load, but this is recovered in simplified program development and consistent data. It is worth making sure that archiving classes are created for the data which you have to archive.
$GYDQWDJHV
Archiving objects can be created with the archiving classes if necessary. An archiving class can be used in any number of archiving objects. This can either be done statically, by specification in ADK, or dynamically in the archiving program (by calling an ADK function module).
The archiving object FI document. data are copied into the data container with the standard class. Archiving classes exist for the transfer of long text and change document data between the database and the data container. The use of archiving classes has the following advantages: 5HXVH without extra work The VLPSOH H[WHQVLRQ RI WKH DUFKLYLQJ REMHFW with new classes The possibility of G\QDPLF LQFOXVLRQ LQ DUFKLYLQJ REMHFWV &RQVLGHUDWLRQ RI WKH REMHFW LWVHOI, not its physical data structure 'DWD LQWHJULW\ 0RGXODULW\ of the data and methods &HQWUDO LPSOHPHQWDWLRQ of archiving functionality
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ $UFKLYLQJ FODVVHV prepare data packets for the data container read archived data packets from the data container delete archived data in the database write archived data back to the database
6$3 $*
3UHFRQGLWLRQV
Detailed knowledge of the data structure is necessary for the development of archiving classes. For an existing archiving class to be used, it must be assigned to the archiving object in question. There are two possibilities: 6WDWLF FRQQHFWLRQ A permanent assignment is made via a table entry in ADK. The function modules are connected to the archiving object when the archive file is opened. (This is the usual type of connection.) '\QDPLF FRQQHFWLRQ The archiving class is connected by a function module call in the archiving program. This procedure is appropriate when it is only decided at run-time, e.g. by user input, with which sub-objects an archiving object is to be archived.
-XQH
6$3 $*
$UFKLYH PDQDJHPHQW
Programs which process archived or to-be-archived data, generally need a long run-time, so they must always run in the background. The ADK provides a management transaction with which a background job for all the archiving programs, i.e. archive, delete, analyze and reload data, can be created. You can run this transaction with 7RROV $GPLQLVWUDWLRQ $GPLQLVWUDWLRQ $UFKLYLQJ. Enter the name of the archiving object for which you want run a program, in the initial screen and choose ENTER. You are offered the actions which are available for this object for selection. The action $GPLQLVWUDWLRQ is always available. You can display all archiving sessions which have so far been carried out for this object, in a list, with this action. You can obtain the following information for each archiving session from this list: Date, time, user File name and path Status (whether deleted or sent to archive system) File size in MB
0DNH QRWHV
You can make notes about the archiving sessions, e.g. about the archive file location or other particularities.
$XWKRUL]DWLRQ FKHFN
Access to the archiving object programs is controlled using an authorization object (S_ARCHIVE). The check is made by ADK when an archive file is opened for one of the following actions: Write Delete Read Reload
The following authorizations can be assigned per archiving object and application (e.g. FI, BC): All authorizations: Write, read and reload archives Execute delete program Change mode in the archive management (notes) Change mode in the archive management Read and analyze archives and display mode in the archive management
-XQH
6$3 $*
1HWZRUN JUDSKLF
The ADK enables you to display archiving object dependencies in the archiving process optically in a network graphic. You can see the sequence in which the data must be archived to store the data optimally, from the hierarchical archiving object representation. The nodes in this network graphic represent the archiving objects. A node shows the following information: $UFKLYLQJ REMHFW QDPH $SSOLFDWLRQ QDPH 6KRUW GHVFULSWLRQ 'DWH RI WKH ODVW DUFKLYLQJ The colours used have the following significance: Green last archiving and delete successful Yellow successfully archived, but not yet deleted or archiving still running or delete is still running or delete cancelled Red not yet archived or archiving cancelled
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ $FFHVVLQJ GDWD REMHFWV LQ WKH DUFKLYH ,QGH[
The index is created in a database table. If you create an index for each archiving session for an archiving object, this database table grows. If a million records are entered, the table occupies about 100 MB in the database, so old records, which are no longer required, should be deleted from the table. The program RSARCH14 is provided to do this. It deletes all records which are older than a specified date. You determine whether an index can be created for an archiving object in the archiving object definition. You can control the actual index creation with an appropriate Customizing [Page 130] entry so that the index is only filled with such entries as are actually required. You read this value in the delete program, and call the appropriate function module if the flag is set.
-XQH
6$3 $*
([DPSOHV
Example programs, which are intended to explain how the function modules work, are also provided with the ADK: 56$5&+ Create archive files 56$5&+ Read archive files 56$5&+ Read archive data deletion files 56$5&+ Read archive data reload files 56$5&+ Generate archiving programs 56$5&+ Read individual data objects in the archive via an index 56$5&+ Create archive files using an archiving class 56$5&+ Delete program with archiving class 56$5&+ Reload program with archiving class
-XQH
6$3 $*
The programs specified below must already exist in the system, because checks are carried out when an archiving object is created. :ULWH SURJUDP Name of the program which writes the archive files. 'HOHWH SURJUDP Name of the program which deletes the data from the database after the archiving program. 5HORDG SURJUDP (optional, but recommended) Name of the program with which the data can be loaded from the archive back into the database. 3UHSDUDWLRQ SURJUDP (optional, only when absolutely necessary) Name of the program with which data are to be prepared for archiving. 3RVWSURFHVVLQJ SURJUDP (optional, only when absolutely necessary) Name of the program with which data are to be processed after they have been archived. If, e.g. the data were only flagged for deletion in the delete program, the actual deletion can be done in the post-processing program. Flag 3UJ JHQHUDWHG (program generated) The program should, or may, be generated. Flag ,QGHSHQGHQW The archiving should be client-independent. Flag (QG GLDORJ The archiving is not to be carried out in dialog mode. Flag &UHDWH ,QGH[ An index can be created for this archiving object (see also Accessing data objects in the archive Index [Page 125]) The actual index creation can be controlled by a Customizing [Page 130] entry. +HOS DUFK Name of a document which contains help text for the object-specific archiving program.
-XQH
6$3 $*
+HOS GHOHWH Name of a document which contains help text for the object-specific delete program. +HOS UHORDG Name of a document which contains help text for the object-specific reload program. +HOS SUHS If a preparation program is planned, you can enter here the document with help text for the preparation program. +HOS SRVWSURF If a post-processing program is planned, you can enter here the document with help text for the post-processing program.
The help function documents are created with the documentation maintenance transaction in the document class TX. You access this maintenance transaction via 7RROV $%$3 :RUNEHQFK (QYLURQPHQW 'RFXPHQWDWLRQ. This transaction has its own documentation. Save your entries and return to the initial screen of the transaction AOBJ. Your newly created archiving object is now contained in the list of objects which exist in the system. You can now create further information about your archiving object by marking the line and choosing one of the actions offered under 1DYLJDWLRQ.
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 'HILQH VWDQGDUG FODVV KLHUDUFKLFDO VWUXFWXUH
Save your entries, and return to the initial screen of the transaction AOBJ.
-XQH
6$3 $*
$UFKLYH FXVWRPL]LQJ
To maintain the archiving control parameters for your archiving object, proceed as follows: Mark the archiving object in the list in the initial screen of the transaction AOBJ, and choose the action &XVWRPL]LQJ VHWWLQJV under 1DYLJDWLRQ. You branch to the customizing maintenance screen. You can also maintain the customizing settings in the implementation guide: &URVVDSSOLFDWLRQ IXQFWLRQV *HQHUDO DSSOLFDWLRQ IXQFWLRQV $UFKLYLQJ $GMXVW DUFKLYLQJ FRQWURO SDUDPHWHUV. Both the logical file and the variants must be maintained per client. All other values are clientindependent. You can set the following values: ORJ ILOH QDPH Logical file name for the archive file, under which the data are stored platformindependently.
The logical file name must already exist in the system (transaction FILE or in the implementation guide under %DVLV %DVLV JHQHUDO 3ODWIRUPLQGHSHQGHQW ILOHQDPH DVVLJQPHQW. $UFKLYH ILOH VL]H size in MB maximum number of data objects
If one of these two sizes is exceeded when writing an archive file, the system automatically creates a new archive file: 'HOHWH SURJUDP VHWWLQJV The archived data records in the database are usually deleted. Under certain circumstances, however, this deletion is only logical, i.e. a delete flag is set. The physical deletion occurs later in a post-processing program. Flag: ([HFXWH DXWRPDWLFDOO\ Flag: &UHDWH LQGH[ (only appears when the flag is set in the object definition) Controls whether the data object to be archived should be copied into the index. Commit counter This value helps to optimize the run-time. Test variant Specify the delete program variant for the test. Productive variant Specify the delete program variant for the productive system.
You can maintain variants for the delete program by using the 9DULDQW pushbutton next to the line.
-XQH
6$3 $*
The program variants specified under 7HVW and 3URGXFWLYH are client-dependent. They PXVW be created LQ HDFK FOLHQW XQGHU WKH VDPH QDPH ZLWK WKH VDPH SDUDPHWHUV. Save your entries, and return to the initial screen of the transaction AOBJ.
-XQH
6$3 $*
-XQH
6$3 $*
*XLGHOLQHV
To avoid loss of data, the archiving program must not delete any data in the database itself. (Deletion is performed by an independent delete program.) The archiving program can change the database, however, to set an archiving flag, for example. This should only happen when absolutely necessary, as every change increases the database load and the archiving run-time. The data selection should be planned carefully to minimize the system load, as archiving programs can run in on-line mode.
Extensive documentation of all ADK function modules (function group ARCH) and their parameters is available in the system. You can call it up in the function library. 1. Choose the push button )XQFWLRQ OLEUDU\ under 7RROV $%$3 :RUNEHQFK. 2. Enter the name of the function module. 3. Mark the option 'RFXPHQWDWLRQ, and choose 'LVSOD\. The function module short text and all interface parameters are displayed. To display the function module documentation, choose the push button )PRG GRF To display parameter documentation or an exception, double-click on the corresponding line.
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 'HYHORS DUFKLYLQJ SURJUDP Check whether the delete program should be called in test mode Create a header entry in the archive management Include the static archiving classes Open the first archive file
6$3 $*
Write the header entry in the first archive file, e.g. information about the Dictionary (Nametab) tables involved
2. '\QDPLFDOO\ LQFOXGH DUFKLYLQJ FODVVHV $5&+,9(B5(*,67(5B&/$66 If you want to use archiving classes, and they are to be included dynamically, you must call this function module for each archiving class, passing the handle. Write the information to the archive file (for the use of the following programs)
Must be called directly after ARCHIVE_OPEN_FOR_WRITE. 7KH IROORZLQJ VWHSV PXVW EH FDOOHG LQ D ORRS IRU DOO GDWD REMHFWV ZKLFK DUH WR EH DUFKLYHG 3. *HW QHZ GDWD REMHFW $5&+,9(B1(:B2%-(&7 You call this function module for each data object. Only then can you pass data to archiving object function modules. The function module performs the following tasks: Data container initialization Call the archiving class initialization routines Pass index entry value via OBECT_ID (if required) The composition of this character string value must not be changed, and each value passed must be unique (see also Create an index and use it to access individual data objects in the archive [Page 146]).
If you have saved a data object in the archive file with the function module ARCHIVE_SAVE_OBJECT and you want to archive further data, you must call this function module again. 4. &RQVWUXFW WKH GDWD REMHFW Call either the standard class function module ARCHIVE_PUT_RECORD or archiving class function modules. These are subject to a naming convention, in which class represents the archiving class name: class_ARCHIVE_OBJECT. You must decide whether the data passed should be deleted by the delete program or not. The archiving class function modules provide the parameter OBJECT_DELETE_FLAG for this purpose. The function module ARCHIVE_PUT_RECORD offers you this functionality with the parameter RECORDS_FLAGS. The archiving class function modules relieve you of the data selection and optimize database access. They first collect the requests and only then access the database when the function module ARCHIVE_SAVE_OBJECT is called. These function modules recognize the data object to which the data belong through the handle, which must be passed to the function module interfaces.
-XQH
6$3 $*
If you have already passed data, which you do not want to archive, call the function module ARCHIVE_NEW_OBJECT. It causes the passed standard class and archiving class data to be forgotten. 5. 6DYH GDWD REMHFW LQ DUFKLYH ILOH $5&+,9(B6$9(B2%-(&7 You must call the function module ARCHIVE_SAVE_OBJECT to request the actual archiving of a data object. It performs the following tasks: Get archiving class data packets Compress standard class data Collect statistics data Update archive management records Write the data object to the archive file (from the data container in which they were stored by the archiving classes and the standard class) Close the archive file if it is full, and open a new one Call the delete program after an archive file has been closed Close the data container, so that no more data can be written to the data container after a data object has been written to the archive file.
(QG RI WKH ORRS VWHS 6. (QG DUFKLYLQJ , $5&+,9(B:5,7(B67$7,67,&6 With this function module, you can generate statistics about the archived data at the end of the archiving. For data records which were passed by the standard classes (ARCHIVE_PUT_RECORD), the records are listed individually. The function module performs the following tasks: Generate a list on which the archiving procedures are documented 7. (QG DUFKLYLQJ ,, $5&+,9(B&/26(B),/( You end the archiving by calling this function module. The handle passed becomes invalid and can no longer be used.
This call must not be forgotten, otherwise the last (physical) archive file to be processed is lost, and the archiving therefore incomplete. Update the archive management records Close the current archive file Release the included archiving classes Discard current handle Call archive delete program (if automatic deletion is required)
-XQH
6$3 $*
'DWD %DVH
$'.
Definition of Archiving Object ABC A Table B Table C Table
6HOHFW
$5&+,9(B23(1B)25B:5,7(
$5&+,9(B1(:B2%-(&7 5HTXHVW GDWD FRQWDLQHU 'DWD &RQWDLQHU ZLWK &XUUHQW 'DWD 2EMHFW $ $5&+,9(B387B5(&25'
B BBBBBBBB B BBBBBBBB
B BBBBBBBB B BBBBBBBB
$5&+,9(B387B5(&25'
% % & &
&
B BBBBBBBB B BBBBBBBB
$5&+,9(B387B5(&25'
& &
$5&+,9(B&/26(B),/(
The program opens the archive file for writing, and receives a number (archive handle) which identifies the file for all further data container and archive file accesses. A new data container must be fetched for each record in the entity table $. All dependent records % and & are appended to it individually, until the data object is complete. The complete data object is written to the archive file. When all data objects which are to be archived have been written to the achive file, the archive file is closed.
-XQH
6$3 $*
'DWDEDVH
$'.
Definition of Archiving Object ABC A Table B Archiving Class C Archiving Class
6HOHFW $5&+,9(B23(1B)25B:5,7(
$5&+,9(B1(:B2%-(&7
B BBBBBBBB B BBBBBBBB
&
$UFKLYH )LOH
%B$5&+,9(B2%-(&7
.H\
'HO IO
$5&+,9(B&/26(B),/(
When the archive file is opened, ADK calls the initialization form routines for the archiving classes B and C. ADK determies which archiving classes must be called for the current archiving object as follows: Which archiving classes belong to the archiving object is determined either statically in the transaction AOBJ (action $VVLJQLQJ DUFKLYH FODVVHV), or dynamically in the program, before the archive is opened.
-XQH
6$3 $*
ADK finds the function group in which the required form routines are to be found from the assignment of function groups to archiving classes in the transaction AOBJ (action 'HILQH DUFKLYLQJ FODVVHV).
A new data container, in which the data object is constructed when writing, must first be requested for each entity table record. The program puts a table A record in the data container and passes the key to the archiving classes B and C, which save it in an internal table. The program issues the command to write the data object to the archive file. The B and C records which depend on A are fetched from the database by the archiving classes and put in the data container, and the complete data object is written to the archive file. After all data objects to be archived have been written into the archive file, the archive file is closed.
It is of course, also possible to develop an archiving program using only archiving classes. In this case, only the selection logic of the data objects to be archived must be programmed in the archiving program.
-XQH
6$3 $*
*XLGHOLQHV
The delete programs must determine which data are to be deleted from the database by reading the archive files. This guarantees that only data which have also been legibly stored in the archives are deleted from the database. The archiving classes function modules must be called to delete their data. These function modules do not COMMIT WORK and do not delete the data immediately, they call PERFORM ON COMMIT. The delete programs must get the value of the object counter with the function module ARCHIVE_GET_CUSTOMIZING_DATA, which controls after how many data objects a COMMIT WORK is called by the delete program.
2. 5HDG QH[W GDWD REMHFW IURP DUFKLYH ILOH $5&+,9(B*(7B1(;7B2%-(&7 As for all archive read accesses, you read the next archived data object with this function module. It performs the following tasks: Read an archived data objects from the archive file
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 'HYHORS GHOHWH SURJUDP Supply the archiving classes with data packets Provide the data container for the standard class
6$3 $*
This function module must be called in a loop, until no more data objects can be provided. 3. 'HOHWH DUFKLYHG GDWD LQ WKH GDWDEDVH The function module ARCHIVE_DELETE_OBJECT_DATA deletes the data in the database for all archiving classes for the last data object to be read with ARCHIVE_GET_NEXT_OBJECT, if the OBJECT_DELETE_FLAG was set to X in the archiving program when the data were written. This function module must therefore be called in the delete program only once per data object read (ARCHIVE_GET_NEXT_OBJECT). You must read the standard class data from the data object yourself und delete them in the database. Put the standard class read function module (ARCHIVE_GET_NEXT_RECORD) in a loop until the data object can provide no more records. If your archiving program has stored information in the RECORD_FLAGS field, you can use this information in the delete program to determine which data should actually be deleted from the database. 4. (QG GHOHWH $5&+,9(B&/26(B),/( This function module performs the following tasks: Close the archive file Release the included archiving classes Discard the current handle
-XQH
6$3 $*
The function module performs the following tasks: Open the existing archive for read Open a new archive for write Create a header entry in the archive management Include the archiving classes of the current archive
You can use the function module ARCHIVE_GET_CUSTOMIZING_DATA, to use the same commit counter for the reload program as that which must also be used for the delete program. Both function modules are called only once, at the start of the reload program. 7KH VWHSV DQG PXVW EH FDOOHG LQ D ORRS IRU DOO DUFKLYHG GDWD REMHFWV 2. 5HDG DUFKLYHG GDWD REMHFW IURP DUFKLYH ILOH $5&+,9(B*(7B1(;7B2%-(&7 As for all archive read accesses, you read the next archived data object with this function module. You must use the ARCHIVE_READ_HANDLE for this. The function module performs the following tasks: Read an archived data object from the archive file Supply the archiving classes with data packets Provide the data container for the standard class Pass the archived data objects to the WRITE_HANDLE data container
-XQH
6$3 $*
This function module must be called in a loop, until the archive file can not provide any more data objects. 3. 5HORDG DUFKLYHG GDWD LQWR WKH GDWDEDVH The data of all archiving classes of the last data object read in by ARCHIVE_GET_NEXT_OBJECT are reloaded into the database by the function module ARCHIVE_RELOAD_OBJECT_DATA. This function module must therefore be called only once per data object read in (ARCHIVE_GET_NEXT_OBJECT) in the reload program. You must program the reloading of the standard class data into the database yourself. If the last data object read is not to be reloaded, you must transfer it into the new archive file with ARCHIVE_SAVE_OBJECT. Otherwise you lose data, as you can no longer access the old archive file via the archive management. :LWK WKLV FDOO VWHS \RX HQG WKH ORRS DIWHU DOO DUFKLYH ILOH GDWD REMHFWV KDYH EHHQ SURFHVVHG 4. (QG UHORDG $5&+,9(B&/26(B),/( With this function module you end the reload procedure. It performs the following tasks: Close the archive file Update the archive management records Release the included archiving classes Discard the current handle
You only need to pass one of the two handle with the call. The archiving object knows automatically which second handle belongs to it.
-XQH
6$3 $*
'DWDEDVH
$'.
Definition of Archiving Object ABC A Table B Table C Table
$5&+,9(B23(1B)25B5($'
B BBBBBBBB B BBBBBBBB
$5&+,9(B*(7B1(;7 B2%-(&7
% $5&+,9(B*(7B1(;7B5(&25'
B BBBBBBBB B BBBBBBBB
&
& $5&+,9(B*(7B1(;7B5(&25'
B BBBBBBBB B BBBBBBBB
&
The program opens the archive file for reading. Each record in the entity table is read in completely from the archive file into the data container. From there the program reads the records individually into its internal table. The analysis is performed when all data objects have been read in from the archive. The archive file is closed again.
-XQH
6$3 $*
Both function modules are called only once at the start of the reload program. 2. 5HDG QH[W GDWD REMHFW $5&+,9B*(7B1(;7B2%-(&7 Call this function module in a loop for all data objects in the archive file. With this function module you read the opened archive files data objects sequentially into the data container. 3. 5HDG WKH QH[W GDWD REMHFW UHFRUG $5&+,9(B*(7B1(;7B5(&25' (standard class) Call this function module in a loop for all the standard class records of the last data object to be read. With this function module you read the current data objects next standard class data record into the data container for further processing in the program. The first call for a data object automatically reads the first record. $UFKLYLQJ FODVV IXQFWLRQ PRGXOHV (These are not subject to a naming convention, and must therefore be specified) With these function modules, you read the archiving class data into the data container for further processing in the program.
4. (QG DQDO\VLV $5&+,9(B&/26(B),/( With this function module, you end the analysis. It performs the following tasks: Close the archive files Release the included archiving classes Discard the current handle
-XQH
6$3 $*
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ &UHDWH DQ LQGH[ DQG XVH LW WR DFFHVV LQGLYLGXDO GDWD REMHFWV LQ WKH DUFKLYH
6$3 $*
&UHDWH DQ LQGH[ DQG XVH LW WR DFFHVV LQGLYLGXDO GDWD REMHFWV LQ WKH DUFKLYH
The index is usually maintained by the delete program during the archiving processes, but it can also be done retrospectively for already existing archive files.
The following conditions must be satisfied: The &UHDWH LQGH[ flag is set in the Definition of the Archiving object [Page 127]. a unique value was passed for the function module ARCHIVE_NEW_OBJECT parameter OBJECT_ID when writing the archive. This value is used for creating the index.
You should get the value for MAINTAIN_INDEX with the function module ARCHIVE_GET_CUSTOMIZING_DATA before calling the function module for saving the index entry (ARCHIVE_ADMIN_SAVE_INDEX), to make the index creation externally controllable and thus avoid unnecessary entries. This value is maintained for the archiving object in question in Archive customizing [Page 130] before any archiving session.
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ &UHDWH DQ LQGH[ DQG XVH LW WR DFFHVV LQGLYLGXDO GDWD REMHFWV LQ WKH DUFKLYH
The index must have been created, either when writing the archive or subsequently. You receive the archive handle to the opened archiving file, and can now access the individual datasets in the data container either with the standard class methods (ARCHIVE_GET_NEXT_RECORD) or, if the archiving object uses archiving classes, with those of the archiving class. An example of access using an index is the program RSARCH13.
-XQH
6$3 $*
All archiving class function module interfaces contain the parameter ARCHIVE_HANDLE.
)XQFWLRQ PRGXOHV
Every archiving class must provide a function module, with which an archiving program can make the data to be archived for a class known. This function module is subject to a naming convention. It must begin with the archiving class name, and end with _ARCHIVE_OBJECT.
The function module interface is individually adjusted for the requirements of the data to be archived. There are however two parameters which occur in every function module of this type: ARCHIVE_HANDLE Archiving session handle OBJECT_DELETE_FLAG Delete flag for the data to be archived by the archiving class
A IXQFWLRQ PRGXOH IRU UHDGLQJ archived data is usually additionally provided for analysis programs. This function module is not subject to a naming convention; it is never called directly by ADK. This function module may be able to read in the database and in the archive file.
-XQH
6$3 $*
This is controlled by the parameter ARCHIVE_HANDLE. If the value 0 is passed for the ARCHIVE_HANDLE, the function module reads in the database, otherwise it reads in the archive file belonging to the archive handle. Thi archiving class receives the data to read via a form routine which is called when the function module ARCHIVE_GET_NEXT_OBJECT is called by ADK.
$'. LQWHUIDFH
The archiving class function group contains standardized form routines which ADK always then needs when function modules of the archiving object are called.
-XQH
6$3 $*
As an archiving class can be included in various archiving objects, and several archiving sessions could be processed in an archiving program, several data packets (of an archiving class) must be able to be processed at the same time in such a case. This makes higher demands at the same time on the internal memory organization of the function group.
-XQH
6$3 $*
-XQH
6$3 $*
-XQH
6$3 $*
ARCHIVE_NEW_OBJECT class_RENEW_DATA Initialize the archiving class for a new data object This routine discards the current archiving class key when writing, or all the data if reading the archive.
ARCHIVE_SAVE_OBJECT class_GET_DATA (GET from the ADK perspective) Provide data in data container for archiving
ARCHIVE_GET_NEXT_OBJECT class_PUT_DATA (PUT from the ADK perspective) Copy data from the data container after reading the archive
ARCHIVE_DELETE_OBJECT_DATA class_DELETE_ARCHIVE_OBJ Delete the data contained in the data container in the database To avoid data inconsistencies, this routine calls another routine, in which the data are actually deleted in the database according to global internal tables provided, with PERFORM ON COMMIT.
ARCHIVE_ROLLBACK_WORK class_ROLLBACK_WORK Discard the data which are flagged for deletion in the database by the archiving class
ARCHIVE_RELOAD_OBJECT_DATA class_ARCHIVE_RELOAD_OBJ Reload the data in the data container into the database
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ ,QLWLDOL]H WKH DUFKLYLQJ FODVV IRU ZULWLQJ
6$3 $*
7DVNV
This form routine initializes the archiving class for archiving data. The classes are informed by this routine that archiving methods must be provided for this $5&+,9(B+$1'/(. The archiving classes can pass a data packet to the archiving via an internal table, which they get back when the archive is read by the class_INIT_READ routine. This table must have been compressed via the function module 7$%/(B&2035(66 or be empty. Several archives can have been opened for an archiving class. The archiving class receives a unique $5&+,9(B+$1'/( for each opened archive.
:KHQ FDOOHG
This routine is called by the archiving whenever a new archive file is opened for writing. As several archive files can be created in one archiving session, this routine is called for each archive file. The $5&+,9(B+$1'/( remains the same.
,QWHUIDFH
FORM class_INIT_WRITE TABLES INIT_TAB USING HANDLE CHANGING LEN.
3DUDPHWHUV
The parameter ,1,7B7$% indicates the table in which the archiving class can save data which it needs for initialization when it reads the archive, and which should be valid for all the data objects in an archive file. Control data can, for example be stored there, so that the appropriate control data are used when the archive is subsequently analyzed, rather than the current values at that time. The parameter +$1'/( contains the ARCHIVE_HANDLE for which the initialization should run. The archiving class function modules should note that only write operations are allowed with this handle and must refuse all other calls by raising the exception WRONG_ACCESS_TO_ARCHIVE. The result of the compression by the function module TABLE_COMPRESS is passed to the archiving via the parameter /(1. The function module parameter is called COMPRESSED_SIZE. You can register further archiving classes which you want to use in your archiving class in this routine (ARCHIVE_REGISTER_CLASS).
-XQH
6$3 $*
*HW GDWD
The name of this form routine starts with the name of the archiving class, and ends with "_GET_DATA".
7DVNV
This routine gathers the data which the archiving program has requested for archiving a data object. These data are passed via a table, which must be in compressed form. It is recommended to get the data in this routine rather than in the function module class_ARCHIVE_OBJECT, as the archiving program requests can be collected by the function module and be efficiently processed in this routine. An archiving program can also request data for archiving, but discard them later by calling the function module ARCHIVE_NEW_OBJECT before they are saved in the archive.
:KHQ FDOOHG
The archiving calls this routine whenever the function module ARCHIVE_SAVE_OBJECT is called in the archiving program for an ARCHIVE_HANDLE.
,QWHUIDFH
FORM class_GET_DATA TABLES DATA_TABLE USING HANDLE CHANGING LEN.
3DUDPHWHUV
The data packet of the data object which is to be written is passed to the data object in the form of a compressed table via the parameter '$7$B7$%/(. The compression must have been performed by the function module TABLE_COMPRESS. The parameter +$1'/( contains the $5&+,9(B+$1'/(, for which the data packet was requested. The result of the compression by the function module TABLE_COMPRESS is passed to the archiving via the parameter /(1. The function module parameter is called COMPRESSED_SIZE.
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 'HOHWH DUFKLYLQJ FODVV ORFDO PHPRU\
6$3 $*
7DVNV
This routine discards all the data of an archiving class for the current data object by deleting it from the archiving class memory. This task must be performed when data for a new data object are expected.
:KHQ FDOOHG
This routine is called at two different events: The archiving program has called the function module ARCHIVE_NEW_OBJECT. The program which reads an archive file has called the function module ARCHIVE_GET_NEXT_OBJECT. This routine is then called before the routine class_PUT_DATA.
,QWHUIDFH
FORM class_RENEW_DATA USING HANDLE.
3DUDPHWHUV
The parameter +$1'/( contains the ARCHIVE_HANDLE for which the routine was called.
-XQH
6$3 $*
7DVNV
This is a house-keeping routine. All handle information which is passed via the interface, can be deleted from the function group memory. No more calls are made to this handle. If a program calls the function modules of the archiving class with this handle, after this routine has been called by the archiving, the function module is to raise the exception :521*B$&&(66B72B$5&+,9(.
:KHQ FDOOHG
This routine is called whenever an $5&+,9(B+$1'/( becomes invalid. An $5&+,9(B+$1'/( becomes invalid whenever the function module ARCHIVE_CLOSE_FILE is called for this handle.
,QWHUIDFH
FORM class_FREE_DATA USING HANDLE.
3DUDPHWHUV
The parameter +$1'/( contains the ARCHIVE_HANDLE which is to be declared invalid.
-XQH
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ ,QLWLDOL]H WKH DUFKLYLQJ FODVV IRU UHDGLQJ
6$3 $*
7DVNV
This form routine initializes the archiving class for reading from archives. The classes are informed that methods must be provided for reading archived data for this ARCHIVE_HANDLE. Several different archives can be opened for an archiving class. The archiving class receives a unique ARCHIVE_HANDLE for each archive opened.
:KHQ FDOOHG
The archiving calls this routine whenever a new archive file is opened for reading. As several archive files can be read for one ARCHIVE_HANDLE, this routine is called once per archive file, but then always only for the archive file which is about to be read.
,QWHUIDFH
FORM class_INIT_READ TABLES INIT_TAB USING HANDLE RELEASE_NUMBER CODE_PAGE NUMBER_FORMAT DATE.
3DUDPHWHUV
The parameter ,1,7B7$% indicates the table in which the archiving class stored data during class_INIT_WRITE, which it needs for the read initialization of the archive, and which should be valid for all the data objects in an archive file. Control data can, for example be stored there, so that the appropriate control data are used when the archive is subsequently analyzed, rather than the current values at that time. The parameter +$1'/( contains the ARCHIVE_HANDLE for which the initialization should run. The archiving class function modules should note that only write operations are allowed with this handle and must refuse all other calls by raising the exception WRONG_ACCESS_TO_ARCHIVE. The parameter 5(/($6(B180%(5 contains the R/3 system release number at the time when the archive was written. The parameter &2'(B3$*( contains the name of the codepage which was active at the time that the archive was written. You can use this parameter, to adjust the data to the current codepage with the ABAP/4 language element TRANSLATE. You get the number format which was valid at the time of archiving via the parameter 180%(5B)250$7. You can also use this parameter for the ABAP/4 language element TRANSLATE, to adjust the data to the current number format. The parameter '$7( contains the date on which the archive was written.
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ &RS\ GDWD IURP WKH GDWD FRQWDLQHU
7DVNV
This routine copies data from the data object, so that they can be read by the archiving class function modules.
:KHQ FDOOHG
This routine is called whenever the function module ARCHIVE_GET_NEXT_OBJECT is called in the archiving program and data for this archiving class exist in the data object.
,QWHUIDFH
FORM class_PUT_DATA TABLES DATA_TABLE USING HANDLE.
3DUDPHWHUV
The data packet which was read from the data object is passed to the archiving class in the form of a compressed table, via the parameter '$7$B7$%/(. The parameter +$1'/( contains the ARCHIVE_HANDLE, to which the data are passed.
-XQH
6$3 $*
)XQFWLRQ
One of the services performed by the archiving classes is to provide a form routine which deletes the archived data for an archiving class in the database. The archiving class decides whether these data are actually deleted, or whether only a reference may be deleted, thus avoiding inconsistencies. The archiving classes automatically know which data were archived, so they do not need to be given this information. The data which were most recently read by the function module ARCHIVE_GET_NEXT_OBJECT, and were flagged for deletion when the archive was written, are automatically deleted. The class receives the data to be deleted via the call of the form routine class_PUT_DATA by the archiving. The data format corresponds exactly to the format which was passed to the archiving with the form routine class_GET_DATA when archiving
&DOO
The form routine is called automatically by the ARCHIVE_DELETE_OBJECT_DATA function module. This function module is called only once for each data object which is read by ARCHIVE_GET_NEXT_OBJECT.
,QWHUIDFH
FORM class_DELETE_ARCHIVE_OBJ USING HANDLE
3DUDPHWHUV
The interface of this form routine consists of only the parameter $5&+,9(B+$1'/(, which specifies the associated archiving object.
The form routine must save the data which are to be deleted in global tables, and call a form routine with PERFORM ON COMMIT. This form routine is then processed by the R/3 system when the delete program calls COMMIT WORK. The actual delete operations should then be passed to the database in this form routine. The R/3 system calls the form routine only once each COMMIT WORK, however often this PERFORM ON COMMIT is called. If ROLLBACK WORK is called by the function module ARCHIVE_ROLLBACK_WORK, the PERFORM does not take place.
-XQH
6$3 $*
%& ([WHQGHG DSSOLFDWLRQV IXQFWLRQ OLEUDU\ 'LVFDUG WKH GDWD IODJJHG IRU GHOHWH
)XQFWLRQ
The key entries of the class data, which were marked in the class_DELETE_ARCHIVE_OBJ form routine, are to be discarded by this form routine.
&DOO
This routine is called by the ARCHIVE_ROLLBACK_WORK function module.
,QWHUIDFH
FORM class_ROLLBACK_WORK USING HANDLE
3DUDPHWHUV
The parameter HANDLE contains the ARCHIVE_HANDLE for which the routine was called. The function module class_ROLLBACK_WORK calls the form routine for all handles.
-XQH
6$3 $*
)XQFWLRQ
This form routine reloads archived data from the archive into the database. The archiving class knows automatically, which data were archived. and which data were deleted from the database by the archiving. Data can not be reloaded selectively in the archiving classes. All the data in an archiving class, for the most recently read data object, are always reloaded.
&DOO
The form routine is called automatically by the ARCHIVE_RELOAD_OBJECT_DATA function module. this function module is called only once for each data object read by ARCHIVE_GET_NEXT_OBJECT.
,QWHUIDFH
FORM class_RELOAD _ARCHIVE_OBJ USING HANDLE
3DUDPHWHUV
The interface of this form routine consists only of the parameter $5&+,9(B+$1'/(, which specifies the associated archiving object.
When programming the form routine, you can specify which data from the archiving class can be reloaded, and which not. This can be useful if reloading certain data would cause database collisions, e.g. if the database already contains data with the same key, which would be overwritten by the reload.
-XQH
6$3 $*
-XQH
6$3 $*
A logical database is a pre-requisite for running the generated programs. They must use the ADK function modules, so that the delete program can read the archive file. The following conditions must be satisfied: 'HILQLWLRQ RI WKH DUFKLYLQJ REMHFW see Define archiving objects [Page 127] Specify program name Set the Prog. generated flag
2EMHFW VWUXFWXUH GHILQLWLRQ The maintenance can be performed manually (see Define standard class hierarchical structure [Page 129]), but you are recommended to use the function module ARCHIVE_DEFINE_OBJECT_STRUCT. The structure must correspond to the logical databases. 8VHU H[LW VSHFLILFDWLRQ The maintenance can be performed manually (transaction AOBJ, action $VVLJQ H[LW URXWLQHV LQ JHQHUDWLRQ), but you are also here recommended to use the appropriate function module ARCHIVE_DEFINE_PROGRAM_EVENTS.
Archiving classes can only be used in connection with user exits. It is not possible for the generator to recognize when the archiving class function modules must be called.
-XQH
6$3 $*
0RGHO 3URJUDPV
Two models are available to you for generating archiving programs: $5&+,9( for the write program '(/(7( for the delete program
The generated programs have the generated attribute. This attribute causes a warning to be issued when you try to edit the generated program. Manual changes to generated programs are pointless, as they are overwritten at the next generation. The tables defined with the ABAP/4 statement TABLES are automatically placed in a global memory space. There is an include with the name "ARCHCOMO" for the archiving data fields, which puts them in global memory. The logical database of the program to be generated must contain this include. The global fields of this include are the following: RECORD_FLAGS The field specifies the archiving memory space in which control information for a data object record is stored. ARCHIVE_HANDLE The field contains the handle of the opened archive. You can use this field in the external sub-routine to communicate with the archive, or with the archiving classes. TESTMODE The field must be filled by the logical database. The contents of this field is passed to the function module ARCHIVE_OPEN_FOR_WRITE parameter CREATE_ARCHIVE_FILE. If this field has the value space, no archive file is written, no delete program executed, and also no entry made in the archive management. The archiving function modules just compile statistics about the data object passed. DELETE_DATA The field must be filled by the logical database. The contents of this fields is passed to the function module ARCHIVE_OPEN_FOR_WRITE parameter CALL_DELETE_JOB_IN_TEST_MODE. If this field has a value other than space, the delete program is called, but the delete program parameter TESTRUN is given the value "X".
(YHQWV
The generator events are closely based on the ABAP/4 syntax, and are therefore almost all selfexplanatory. $UFKLYLQJ PRGHO $5&+,9( HYHQWV END-OF-SELECTION GET GET LATE INITIALIZATION START-OF-SELECTION
-XQH
6$3 $*
'HOHWH PRGHO '(/(7( HYHQWV AFTER DELETE directly after delete BEFORE DELETE directly before delete COMMIT WORK directly before a Commit END-OF-SELECTION GET GET LATE INITIALIZATION START-OF-SELECTION TOP-OF-PAGE
-XQH
6$3 $*
The delete program model checks, whether the first position in the field RECORD_FLAGS contains the value "X", before this dataset is deleted. You can change the value of the field, by calling an external sub-routine in the archiving program at the event GET. The external sub-routine interface depends on the event at which they are called.
-XQH
6$3 $*
GET enter 'X' in field RECORD_FLAGS call external sub-routine (if one exists) request a new data object (only for the first segment) pass the dataset to the data object
GET LATE call external sub-routine (if one exists) write data object to archive (only for the first segment)
END-OF-SELECTION call external sub-routine (if one exists) output archiving statistics close archive
The two parameters were deliberately placed on the database selection screen and not in the generated program, to simplify the user interface and relieve the user of needing to know the possible combinations.
-XQH
6$3 $*
The external sub-routines should access existing archiving classes function modules to archive their data. The external sub-routine interface parameter ARCHIVE_HANDLE is available for this purpose. If you need the structure of the RECORD_FLAGS parameter, you can specify the structure "ARC_BUFFER-FLAGS" via STRUCTURE.
-XQH
6$3 $*
,QWHUIDFH inttab contains all the records of a database table which are to be deleted FORM formname TABLES inttab USING ARCHIVE_HANDLE. Event: AFTER DELETE BEFORE DELETE
-XQH
6$3 $*
GET call external sub-routine (if one exists) collect datasets in delete table (if RECORD_FLAGS(1) = 'X')
GET LATE call external sub-routine (if one exists) only for the first dataset: increment object count field call delete sub-routine (if data objects were collected)
END-OF-SELECTION call delete sub-routine (for remaining data) call external sub-routine (if one exists)
Sub-routine for deleting collected data LOOP (per table) check whether datasets were collected for the table call external sub-routine (if BEFORE DELETE exists) Array operation to delete the datasets from the table call external sub-routine (if AFTER DELETE exists) delete internal collecting table ENDLOOP (per table) call external sub-routine (if COMMIT WORK exists) depending on whether it is a test or productive session, database Rollback or Commit respectively
-XQH
6$3 $*
-XQH
6$3 $*
$UFKLYLQJ IXQFWLRQV
)XQFWLRQ JURXS $5&+
$5&+,9(B$'0,1B6$9(B,1'(; (Delete program) With this function module you write an index entry for the current data object. $5&+,9(B&/26(B),/( With this function module, you close all archive files which are gathered under one handle, independently of whether they were opened for reading, writing or reloading. $5&+,9(B'(/(7(B2%-(&7B'$7$ With this function module, you call the delete routines of the archive classes for the current data object. $5&+,9(B*(7B&86720,=,1*B'$7$ This function module returns the Commit counter and the create index flag. The Commit counter determines, after how many data objects a COMMIT WORK is issued. The create index flag specifies whether the delete program should insert the archived and deleted data objects in the index. $5&+,9(B*(7B),567B5(&25' (standard class only) With this function module you set the record pointer to the first record in the data container in the data object which was previously read by ARCHIVE_GET_NEXT_OBJECT, and read this record. This function module combines the functionality of the ARCHIVE_SET_RECORD_CURSOR and ARCHIVE_GET_NEXT_RECORD function modules. If you only need the fields RECORD_FLAGS and RECORD_STRUCTURE, you can use the function module ARCHIVE_GET_RECORD_INFO. $5&+,9(B*(7B,1)250$7,21 With this function module you get current information for a handle, such as date, release, SAP system, archive name. $5&+,9(B*(7B23(1B),/(6 With this function module, you fill a table with the file names of all archive files which are currently being processed by the ADK function modules. $5&+,9(B*(7B1(;7B2%-(&7 With this function module, you read the next data object for a handle, from an archive which is open for reading in the data container. This call is a prerequisite for the function module ARCHIVE_GET_NEXT_RECORD or ARCHIVE_GET_FIRST_RECORD and the archiving classes call. If you use archiving classes, their data are accessible via their function modules after they have been called. $5&+,9(B*(7B1(;7B5(&25' (standard class only) With this function module, you sequentially read the next record in a data container in a data object which was read by ARCHIVE_GET_NEXT_OBJECT. The first call automatically reads the first record.
The following function modules (ARCHIVE_GET_NEXT_STRUCT_SPECIF und ARCHIVE_GET_RECORD_INFO) were developed for the easy implementation
-XQH
6$3 $*
of logical database archive read operations. They can, of course, also be used in other programs. $5&+,9(B*(7B1(;7B6758&7B63(&,) (standard class only) With this function module you read archives with specified structures with logical databases. The group change logic is integrated. You can, however, also use the function module ARCHIVE_GET_NEXT_RECORD, but in this case you must program the hierarchy step group change logic yourself. $5&+,9(B*(7B5(&25'B,1)2 (standard class only) With this function module, you get information in logical databases about archived datasets. $5&+,9(B*(7B7$%/( With this function module, you read several records from a data object which was read by ARCHIVE_GET_NEXT_OBJECT, into an internal table. $5&+,9(B*(7B:,7+B&85625 (standard class only) With this function module, you can directly read standard class datasets in a data object. You get the necessary record pointer during sequential access to a data object record via the parameter RECORD_CURSOR. This function module is useful for remembering records via the record pointer for later further processing. $5&+,9(B1(:B2%-(&7 With this function module you request a new data container to write for a handle. $5&+,9(B23(1B)25B029( With this function module you open one or several archive files for reloading archived data. You receive an archive handle for the archive file to be read and another archive handle for writing those data objects, which are not to be reloaded. This facilitates the selective reloading of individual data objects from archives into the R/3 system. $5&+,9(B23(1B)25B5($' With this function module you open an existing archive file for reading. A handle is created, via which this file can be read. You can also open several archive files at the same time.They all share one handle. Function modules which read via this handle treat all the files with this handle like a single file. $5&+,9(B23(1B)25B:5,7( With this function module you create a new archive file and a handle, with which you have write access to this file. If you have not specified a file name in the Archive customizing [Page 130], the platform independent logical file name ARCHIVE_DATA_FILE is automatically used, to determine a valid, platform-independent file name. You can also specify via control parameters, whether the delete program for the archived data should be automatically called after writing. $5&+,9(B387B5(&25' (standard class only) With this function module you pass a data set to the data container which was previously requested with the function module ARCHIVE_NEW_OBJECT. All data sets which you pass to the data container are written to the archive file together by the function module ARCHIVE_SAVE_OBJECT.
-XQH
6$3 $*
$5&+,9(B387B7$%/( (standard class only) With this function module, you pass an internal table to the data container which was previously requested by ARCHIVE_NEW_OBJECT. The internal table records are entered in the data container as single records. $5&+,9(B5(*,67(5B&/$66 With this function module, you dynamically assign archiving classes to an archiving object. $5&+,9(B5(/2$'B2%-(&7B'$7$ (only for archiving classes) With this function module, you call the reload routines of the archiving classes. $5&+,9(B52//%$&.B:25. If a ROLLBACK WORK has to be carried out in a delete or reload program, it should be done by calling this function module, not by the ABAP/4 command ROLLBACK WORK. This function module guarantees the correct resetting of the data for all archiving classes used. $5&+,9(B6$9(B2%-(&7 With this function module, you write a data object into the archive file. As well as the data passed by ARCHIVE_PUT_RECORD, the data which were passed via the archiving classes are taken into account. $5&+,9(B6(7B5(&25'B&85625 (standard class only) With this function module you set the standard class record pointer of the last data object to be read. You can then read the next record with ARCHIVE_GET_NEXT_RECORD. $5&+,9(B:5,7(B67$7,67,&6 (standard class only) With this function module, you create a statistics print-out for the data object which you have written to the archive files with ARCHIVE_SAVE_OBJECT.
-XQH