Está en la página 1de 225

%&3URJUDPPLQJ'LVSOD\)XQFWLRQV

%&
3URJUDPPLQJ
'LVSOD\)XQFWLRQV
SAP AG 2002

n R/3 System
n Release 4.6C
n 2001, Q3
n Material Number 5004 1363
&RS\ULJKW

&RS\ULJKW6$3$*$OOULJKWVUHVHUYHG
1RSDUWRIWKLVSXEOLFDWLRQPD\EHUHSURGXFHGRUWUDQVPLWWHGLQ
DQ\IRUPRUIRUDQ\SXUSRVHZLWKRXWWKHH[SUHVVSHUPLVVLRQRI
6$3$*7KHLQIRUPDWLRQFRQWDLQHGKHUHLQPD\EHFKDQJHG
ZLWKRXWSULRUQRWLFH

$OOULJKWVUHVHUYHG

SAP AG 2002

7UDGHPDUNV
n Some software products marketed by SAP AG and its distributors contain proprietary software
components of other software vendors.
n Microsoft, WINDOWS, NT, EXCEL, Word, PowerPoint and SQL Server are registered
trademarks of Microsoft Corporation.
n 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.
n ORACLE is a registered trademark of ORACLE Corporation.
n INFORMIX-OnLine for SAP and INFORMIX Dynamic ServerTM are registered trademarks of
Informix Software Incorporated.
n UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
n HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C, World Wide
Web Consortium, Massachusetts Institute of Technology.
n JAVA is a registered trademark of Sun Microsystems, Inc.
n JAVASCRIPT is a registered trademark of Sun Microsystems, Inc., used under license for
technology invented and implemented by Netscape.
n SAP, SAP Logo, R/2, RIVA, R/3, ABAP, SAP ArchiveLink, SAP Business Workflow, WebFlow,
SAP EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP.com Logo and mySAP.com
are trademarks or registered trademarks of SAP AG in Germany and in several other countries all
over the world. All other products mentioned are trademarks or registered trademarks of their
respective companies.
%XVLQHVV,QWHJUDWLRQ7HFKQRORJLHV,

/HYHO /HYHO
 


2 days 5 days 3 days
SAP Business SAP Business Workflow
Workflow - SAP Business
Workflow - Introduction Workflow - Programming
Build and Use



3 days
SAP ArchiveLink  
2 days

3 days ADK - Retrieval
programming Archiving
Data Archiving 
2 days
Data Archiving Retention
Tool (DART)

  
2 days
Web connection
SAP Business Connector

SAP AG 2001
%XVLQHVV,QWHJUDWLRQ7HFKQRORJLHV,,

/HYHO /HYHO

%
3 days
Application Link
Enabling (ALE)
Technology
 9
2 days 1 day 4 (,)(",5 *067(%+/%"
SAP IDoc Interface SAP IDoc Interface -
Technology Development
 8: 
3 days 4 days *BC619 from 01/2002 BIT300
*BC620 from 01/2002 BIT320
Business Integration EDI Interface
Technology *BC621 from 04/2002 BIT350


5 days
Data Transfer  0
2 days
 Communication
- $#0. !/#"%$( $'&)1(+*,13" 2  /
5 days Interfaces in ABAP
Programming with 8
BAPIs in Visual Basic 5 days
Programming with
*CA925 from 01/2002 BIT525
BAPIs in JAVA
*CA926 from 01/2002 BIT526

SAP AG 2001
&RXUVH3UHUHTXLVLWHV

l %&
%&
%&
%& RUHTXLYDOHQWNQRZOHGJHRI6$3'DWD
$UFKLYLQJ

SAP AG 2002
7DUJHW*URXS

l 3DUWLFLSDQWV
; 0HPEHUVRIGDWDDUFKLYLQJSURMHFWWHDPVZKRKDYHWR
SURJUDPFXVWRPHUVSHFLILFUHWULHYDOVROXWLRQV
l 'XUDWLRQGD\V

SAP AG 2002
&RXUVH2YHUYLHZ

&RQWHQWV
l &RXUVH*RDOV
l &RXUVH2EMHFWLYHV
l &RXUVH&RQWHQW
l &RXUVH2YHUYLHZ'LDJUDP
l 0DLQ%XVLQHVV6FHQDULR

SAP AG 2002

SAP AG BC670 1-1


&RXUVH*RDOV

7KLVFRXUVHZLOOSUHSDUH\RXWR
l 8QGHUVWDQGWKHORJLFRIDUFKLYLQJDQGGHOHWH
SURJUDPV
l &UHDWHFXVWRPHUVSHFLILFVHTXHQWLDOUHDG
SURJUDPV
l 3URJUDPEXVLQHVVYLHZVRIDQDUFKLYLQJREMHFWLQ
6$3$6
l 'LVSOD\LQ6$3$6RULJLQDOGRFXPHQWVEHORQJLQJ
WRDQ5EXVLQHVVREMHFWWKDWKDYHEHHQDUFKLYHG
XVLQJ6$3$5&+,9(/,1.

SAP AG 2002

SAP AG BC670 1-2


&RXUVH2EMHFWLYHV

$WWKHFRQFOXVLRQRIWKLVFRXUVH\RXZLOOEHDEOHWR

l &UHDWHFXVWRPHUVSHFLILFUHDGSURJUDPV
l &UHDWHEXVLQHVVYLHZVLQ6$3$6

l ([SODLQWKHSURFHGXUHUHTXLUHGWRHPSW\
FXVWRPHUVSHFLILFWDEOHVXVLQJFXVWRPHUVSHFLILF
DUFKLYLQJREMHFWV
l ([SODLQWKHSURFHGXUHUHTXLUHGWRH[WHQGH[LVWLQJ
DUFKLYLQJREMHFWVWRDUFKLYHFXVWRPHUVSHFLILF
WDEOHV

SAP AG 2002

SAP AG BC670 1-3


&RXUVH&RQWHQW

3UHIDFH

8QLW Course Overview 8QLW Program logic


Data Archiving
8QLW Process of Data Archiving
8QLW Sequential read
8QLW ADK Development Tools progams

8QLW Direct read access to


archived data

SAP AG 2002

SAP AG BC670 1-4


2YHUYLHZ'LDJUDP

,QWURGXFWLRQ 67$57

7KH'DWD$UFKLYLQJ3URFHVV

$'.'HYHORSPHQW7RROV

3URJUDP/RJLFLQ'DWD$UFKLYLQJ

6HTXHQWLDO5HDG3URJUDPV

'LUHFW$FFHVVWR$UFKLYHG'DWDLQ6$3$6

SAP AG 2002

SAP AG BC670 1-5


0DLQ%XVLQHVV6FHQDULR

l <RXZRUNLQWKHODUJHHQWHUSULVH7DEOHV58V$ODUJHGDWD
DUFKLYLQJSURMHFWKDVEHHQLQVWDOOHGDQG\RXDUHD
PHPEHURIWKHSURMHFWWHDP
7RJHWKHUZLWKWKHXVHUGHSDUWPHQWV\RXKDYHFUHDWHGD
UHTXLUHPHQWVFDWDORJ
l &XVWRPHUVSHFLILFUHDGSURJUDPVPXVWEHZULWWHQ
l %XVLQHVVYLHZVPXVWEHFUHDWHGLQ6$3$6

SAP AG 2002

SAP AG BC670 1-6


7KH3URFHVVRI'DWD$UFKLYLQJ

&RQWHQWV
l 7KH3URFHVVRI'DWD$UFKLYLQJ
l 'DWD2EMHFWDQG$UFKLYLQJ2EMHFW
l $FFHVVWR$UFKLYHG'DWD

SAP AG 2002

SAP AG BC670 2-1


'DWD$UFKLYLQJ7RSLF2EMHFWLYHV

$WWKHFRQFOXVLRQRIWKLVXQLW\RXZLOOEHDEOHWR

l 'HVFULEHWKHSURFHVVRI'DWD$UFKLYLQJ
l ([SODLQWKHUHOHYDQWFRPSRQHQWV

S
SAP AG1999
P AG 2002S

SAP AG BC670 2-2


&RXUVH2YHUYLHZ'LDJUDP

&RXUVH2YHUYLHZ

7KH3URFHVVRI'DWD$UFKLYLQJ

$'.'HYHORSPHQW7RROV

3URJUDP/RJLFLQ'DWD$UFKLYLQJ

&XVWRPHU6SHFLILF5HDG3URJUDPV

%XVLQHVV9LHZVLQ6$3$6

$SSHQGL[

SAP AG 2002

SAP AG BC670 2-3


'DWD$UFKLYLQJ%XVLQHVV6FHQDULR

l 7KHXVHUGHSDUWPHQW,7GHSDUWPHQWDQGWKH
SURMHFWWHDPPHHWWRGLVFXVVWKHH[LVWLQJGDWD
DUFKLYLQJVROXWLRQZLWKLQWKHLUHQWHUSULVH
l 7KH\DOVROLVWWKHRSWLRQVLQWKHVWDQGDUG6$3
6\VWHPIRUDFFHVVLQJDUFKLYHGGDWD

S
SAP AG1999
P AG 2002S

SAP AG BC670 2-4


7KH$UFKLYLQJ3URFHVV

5'DWDEDVH )LOHV\VWHP 2IIOLQH


VWRUDJH

5
'DWDEDVH
'RFXPHQWV $UFKLYLQJREMHFW $UFKLYH
'DWDREMHFWV ILOHV

 

'DWDDUFKLYLQJVHVVLRQ   

SAP AG 2002

n R/3 documents are made up of records, which are stored in different tables in the R/3 database.
For the purposes of data archiving, a concrete R/3 document is a GDWDREMHFW.
n The data archiving process is composed of two steps.
&UHDWLRQRIDUFKLYHILOHVThe archiving program writes the files for archiving from the R/3
database to archive files.
'HOHWLRQRIGDWD - The delete program first reads the data in the archive files and then deletes the
records from the database.
n The removal of archive files to a tertiary storage medium can be seen as a third step in the archiving
process. This step occurs after the first two steps of the data archiving procedure have been
completed.
You should consider this third step to be part of the archiving process: It is not generally enough to
write the data to be archived to archive files and delete it from the database. The archive files must
be stored and managed to guarantee future access when required.

SAP AG BC670 2-5


'DWD2EMHFWVLQ5

5EXVLQHVVGRFXPHQWV
5GDWDEDVHWDEOHV

  !  " #$" &%$" #" "'"("


)  !  " #$" &%$" #" "'"("
7DEOH #  !  " #$" &%$" #" "'"("
%.3) "'"*"'"+"'"

 &%#%,-'./ 01$-+%
) &%#21$%-'0300-+,
7DEOH # &%#&#0-'4#- 1$ 
%6(* "'"*"'"+"'"

4  456 ,%&)87 


4  459# ,%&#:7
7DEOH 4  #459&1$&)87
%6(7 "'"+"'"*"'" 

 XQLTXHNH\

SAP AG 2002

n R/3 business documents are distributed across different tables in the R/3 database.
n The FI document 1000 1900000 1999 represents a concrete data object in R/3.
n Within the data archiving framework, all table records belonging to a data object are written together
(in context) to an archive file and then deleted from the database tables.

SAP AG BC670 2-6


$UFKLYLQJ2EMHFWV 

;=<?>A@$B<A@C>ED4F)DGB$>AH*I<?H J=K 7KH6758.785('(),1,7,21RIDQ


LMCNO D/P RQTS DUFKLYLQJREMHFWGHVFULEHVZKLFKWDEOHV
DUHWREHSURFHVVHGGXULQJGDWD
DUFKLYLQJ
;=<?>A@$B<A@C>ED4F)DGB$>AH*I<?H J=K
LM)NCO D/PT;RU L

$UFKLYLQJREMHFW
;=<?>A@$B<A@C>ED4F)DGB$>AH*I<?H J=K
LMNO D/PT;RUWV ),B'2&8017

;=<?>A@$B<A@C>ED4F)DGB$>AH*I<?H J=K
LMNCO D/P=XZY  $Q$5&+,9,1*2%-(&7LVDVHWRIOLQNHG
EXVLQHVVGDWDZKLFKLVSHULRGLFDOO\H[WUDFWHG
IURPWKHGDWDEDVHDUFKLYHGDQGGHOHWHG
;=<?>A@$B<A@C>ED4F)DGB$>AH*I<?H J=K DFFRUGLQJWRLQGLYLGXDOFULWHULD
LM)N[O D/PT;RUW\ IURPWKHFXUUHQWV\VWHP



SAP AG 2002

n Additional examples of archiving objects:

SD_VBAK Data structure Orders


SD_VBKA Data structure Sales activities
RV_LIKP Data structure Deliveries
PP_ORDER Data structure Production orders

n R/3 Release 4.6 contains more than 200 standard archiving objects.
n Archiving objects are defined by the individual applications.
n You can create customer-specific archiving objects for customer-specific Z and Y tables.

SAP AG BC670 2-7


$UFKLYLQJ2EMHFWV 

6WUXFWXUHGHILQLWLRQ
$UFKLYLQJ
REMHFWV ,QIRUPDWLRQDERXW
WKHSRLQWVOLVWHG $GGLWLRQDOIODJV
),B'2&8017 RQWKHULJKW IRUH[DPSOHVWDUWDWHQG
6'B9%$. LVVWRUHGLQWKH
6'B9%.$ V\VWHPIRUHYHU\ 3URJUDPVIRUDUFKLYLQJ
6'B9%5. DUFKLYLQJREMHFW DQGGHOHWLRQ
59B/,.3
&2B,7(0 7UDQVDFWLRQ$2%- &XVWRPL]LQJ
$0B$66(7 WHFKQLFDOVHWWLQJV
00B(%$1
00B(..2 &XVWRPL]LQJ
,'2& UHVLGHQFHWLPHVDSSOLFDWLRQ
:25.,7(0
36B3/$1
&2B25'(5 $UFKLYLQJFODVVHVXVHG


5HDGSURJUDPV

SAP AG 2002

n An archiving object must have programs for archiving and deleting.


Optional programs include programs for reloading, reporting, filling and emptying indexes,
preprocessing and postprocessing.
n The maintenance transaction is AOBJ.
n Start at end is an example of an additional indicator that is analyzed after after an archiving session
when the deletion job is run. A further indicator enables you to specify whether an index can be
created.
n Application-specific Customizing generally contains criteria to determine whether documents are
archivable or not. In addition to these criteria, a document must always have the status closed before
it can be archivable.

SAP AG BC670 2-8


$UFKLYLQJ6WHS'DWD$UFKLYLQJ

5 $UFKLYLQJ
'DWDEDVH SURJUDP

$UFKLYH
ILOH

SAP AG 2002

n During the first step, the archiving program creates an (initial) archive file.
The data to be archived is read from the database by a batch process and written to the archive file.
This process continues until one of the following occurs:

1. The archiving is finished: All the data for selection has been read and written
2. The archiving is not yet completed but the archive file has reached the maximum size that was
specified in Customizing.
3. The archiving is not yet completed but the archive file contains the specified number of objects
that was specified in Customizing.
n Only data from completed business processes is archivable.
n Master data can only be archived if a deletion indicator has been set in it.
Some archiving objects set the deletion indicator in a specific preprocessing program within the
framework of data archiving (for example, the archiving object CO_ORDER).

SAP AG BC670 2-9


$UFKLYLQJ6WHS'DWD'HOHWLRQ9DULDQW
'HOHWLRQ-REV3DUDOOHOWR$UFKLYLQJ

'HOHWLRQMREVVWDUW 3UHUHTXLVLWH
DXWRPDWLFDOO\DIWHUDQDUFKLYH 6WDUWDXWRPDWLVVHOHFWHGLQWHFKQLFDO
ILOHKDVEHHQFORVHG &XVWRPL]LQJIRUWKHDUFKLYLQJREMHFW

$UFKLYLQJ
5 SURJUDP
'DWDEDVH

$UFKLYH
'HOHWH $UFKLYH ILOH
SURJUDP ILOH

'HOHWH $UFKLYH
SURJUDP
ILOH

SAP AG 2002

n There is one deletion process for each archive file created.


n The deletion process can be started in three different ways.
n Variant 1 for starting the delete program:
After closing an archive file, ADK opens a new one and continues with the archiving process. The
system starts the delete program in parallel, which reads the archived records from the file which has
just been closed and deletes them from the database.
In this case, the delete jobs and the archiving jobs run in parallel.
n For this variant, Start automatic. must be set in Delete program settings in technical Customizing of
the archiving object.

SAP AG BC670 2-10


$UFKLYLQJ6WHS'DWD'HOHWLRQ9DULDQW
'HOHWH-REV6WDUWHG0DQXDOO\

$GPLQLVWUDWRUVWDUWVWKHGHOHWLRQ 3UHUHTXLVLWH
MREV0$18$//<LQWKHGDWD 6WDUWDXWRPDWLVQRWVHOHFWHG
DUFKLYLQJWUDQVDFWLRQDIWHUWKH LQWHFKQLFDO&XVWRPL]LQJIRU
DUFKLYLQJVHVVLRQLVILQLVKHG WKHDUFKLYLQJREMHFW

5
'DWDEDVH

'HOHWH $UFKLYH $UFKLYH


SURJUDP
ILOH ILOH

'HOHWH
SURJUDP

SAP AG 2002

n Variant 2 for starting the delete program:


The delete program is scheduled manually by the administrator once all archive files have been
closed.
The archiving session is completely finished.
There is one deletion process for each archive file created.
n For this variant, the Start at end indicator is set in the definition of the archiving object. Start
automatic. must NOT be set in Delete program settings in the technical Customizing of the
archiving object.

SAP AG BC670 2-11


$UFKLYLQJ6WHS'DWD'HOHWLRQ9DULDQW
'HOHWH-REV6WDUWHG$XWRPDWLFDOO\

'HOHWHMREVVWDUWHG$8720$7,&$//< 3UHUHTXLVLWH
DIWHUWKHDUFKLYLQJVHVVLRQKDV VWDUWDWHQGLVVHWLQWKH
ILQLVKHG GHILQLWLRQRIWKHDUFKLYLQJREMHFW

5
'DWDEDVH

'HOHWH $UFKLYH
SURJUDP ILOH

'HOHWH $UFKLYH
SURJUDP
ILOH

SAP AG 2002

n Variant 3 for starting the delete program:


The delete program is scheduled manually by the administrator once all archive files have been
closed.
The archiving session is completely finished.
There is one deletion process for each archive file created.
n For this variant, the Start at end indicator is set in the definition of the archiving object. Start
automatic. must NOT be set in Delete program settings in the technical Customizing of the
archiving object.
n Once an indicator has been set in an archiving object, it can not be removed.

SAP AG BC670 2-12


$UFKLYLQJ6WHS7HUWLDU\6WRUDJH0HGLD

l ([WHUQDOVWRUDJHV\VWHP
DGGUHVVHGYLD
$UFKLYH
6$3$UFKLYH/LQN
ILOH
$UFKLYH
5 l +60V\VWHPV
ILOH
$UFKLYH
'DWDEDVH l )LOHV\VWHPDYDLODEOHRQO\
ILOH
$UFKLYH
ILOH WR$'.
$UFKLYH
ILOH
&UHDWHDUFKLYHILOH
'HOHWHGDWD
)LQDOVWRUDJH
ORFDWLRQRI
DUFKLYHILOHV

SAP AG 2002

n There are various ways to store and administer archive files on external storage media.
Archive management always knows the exact location of an archive file.
Read/write authorizations are mandatory at UNIX-level for the directories used.
n Connection to a Hierarchical Storage Management system (HSM): An HSM system simulates an
infinitely large file system. The archive files created during an archiving session are stored in the
HSM file system. You just have to enter the HSM file system path in archiving object Customizing
as the target path for the archive files.
n Connection to an external archive system via SAP ArchiveLink: If you want to store the archive files
on an external storage system via SAP ArchiveLink, the archive files can only be passed to the third-
party product archive after the data has been successfully deleted from the database.
n Manual administration: If you do not want to store the archive files on an external archive or in an
HSM System, then the IT department can administer the files on tapes or CDs. There is no interface
to these files from SAP R/3.
n Ensure that backup strategies are in place for the relevant storage medium. It may also be necessary
to make new copies of the contents of CDs or WORMs after a number of years.

SAP AG BC670 2-13


$UFKLYLQJ3URFHVV6XPPDU\

<RXQRZNQRZ

l 7KHVWHSVRIWKHDUFKLYLQJSURFHVV
:ULWLQJGDWDWRDUFKLYHILOHV
]

'HOHWLQJGDWDIURPGDWDEDVH
]

)LQDOVWRUDJHRIDUFKLYHILOHVRQ
]
WHUWLDU\VWRUDJHPHGLD
l 7KDWDUFKLYLQJREMHFWVDUHWKHFHQWUDO
FRPSRQHQWVRIGDWDDUFKLYLQJ

SAP AG 2002

SAP AG BC670 2-14


([HUFLVHV

8QLW'DWD$UFKLYLQJDQG:RUNLQJZLWK$UFKLYHG'DWD

7RSLF7KH3URFHVVRI'DWD$UFKLYLQJ
$FFHVVXVLQJ6$3$6

At the conclusion of this exercise, you will be able to:


Carry out the Customizing required to start the delete jobs
Explain the relationship between data objects and archiving objects
Create an archive information structure that links 2 tables

1-1 &RQWUROWKHGHOHWHMRE

1-1-1 Which Customizing setting must you implement to prevent the delete jobs from
starting immediately so that you can schedule them manually?

1-1-2 Which setting leads to them starting immediately after an archive file has been
closed?

1-1-3 Which setting enables you to start the delete jobs automatically after the
complete archiving session is finished and all of the archive files have been
closed?

1-2 'DWD2EMHFWDQG$UFKLYLQJ2EMHFW

1-2-1 What is a data object?

1-2-2 Where is the definition (within the context of data archiving) of a data object
stored?

SAP AG BC670 2-15


6ROXWLRQV

8QLW'DWD$UFKLYLQJDQG:RUNLQJZLWK$UFKLYHG'DWD

7RSLF7KH3URFHVVRI'DWD$UFKLYLQJ
$FFHVVXVLQJ6$3$6

1-1 Solution to question 1-1

1-1-1 Tools, Administration, Management, Data Archiving


Enter the archiving object
Button <Customizing>
Select Technical Settings
Settings for delete program: Start autom should not be selected.

1-1-2 Tools, Administration, Management, Data Archiving


Enter the archiving object
Button <Customizing>
Select Technical Settings
Settings for delete program: Start autom should be selected.

1-1-3 Call transaction $2%-


Double click the archiving object
Select start at end

1-2 Solution to question 1-2

1-2-1 Data object


From the ADKs viewpoint, a data object is made up of all of the table records
that make up an R/3 business document.

1-2-2 Call transaction AOBJ


Select the archiving object
Select dialog structure structure definition

SAP AG BC670 2-16


$'.'HYHORSPHQW7RROV

&RQWHQWV
l 2YHUYLHZRIWKH$'.SURJUDPPLQJLQWHUIDFH
l 2YHUYLHZRIDUFKLYLQJFODVVHV

SAP AG 2002

SAP AG BC670 3-1


$'.'HYHORSPHQW7RROV7RSLF2EMHFWLYHV

$WWKHFRQFOXVLRQRIWKLVXQLW\RXZLOOEHDEOHWR

l /LVWWKHFRPSRQHQWSDUWVRIWKH$'.
SURJUDPPLQJLQWHUIDFH
l 8QGHUVWDQGWKHXVHDQGDSSOLFDWLRQRIDUFKLYLQJ
FODVVHV

SAP AG 1999
2002

SAP AG BC670 3-2


&RXUVH2YHUYLHZ'LDJUDP

&RXUVH2YHUYLHZ

7KH'DWD$UFKLYLQJ3URFHVV

$'.'HYHORSPHQW7RROV

'DWD$UFKLYLQJ3URJUDPPLQJ/RJLF

&XVWRPHU6SHFLILF5HDG3URJUDPV

%XVLQHVV9LHZVLQ6$3$6

$SSHQGL[

SAP AG 2002

SAP AG BC670 3-3


$'.'HYHORSPHQW7RROV%XVLQHVV6FHQDULR

l %HIRUHZRUNFDQEHJLQWKHGHYHORSHUVPXVWKDYH
DQRYHUYLHZRIWKH$'.SURJUDPPLQJLQWHUIDFH

SAP AG 1999
2002

SAP AG BC670 3-4


$'.3URJUDPPLQJ,QWHUIDFH$'.$3,

l $'.LQFOXGHVDVHULHVRIIXQFWLRQPRGXOHVWKDWDUHDUH
XVHGE\DOOSURJUDPVRQDFURVVDSSOLFDWLRQEDVLVGXULQJ
GDWDDUFKLYLQJ

l 7KHVHIXQFWLRQPRGXOHVZULWHGDWDWRDQGUHDGGDWDIURP
DUFKLYHILOHV

l 7KHVHOHFWLRQRIGDWDIRUDUFKLYLQJRUGHOHWLRQ WKDWLV
GDWDEDVHDFFHVV PXVWEHGHILQHGLQDUFKLYLQJDQG
GHOHWLRQSURJUDPVLQWKHUHOHYDQWDSSOLFDWLRQ

SAP AG 2002

n As well as reading and writing data, ADK also undertakes conversion tasks within the framework of
data archiving, for example:
Codepage changes (for example, HP/UX to AS/400)
Format conversion (for example, Compaq/Alpha to HP/UX)
Structure changes (for example, additional table fields)
Data compression and decompression
n Since Release 3.0, ADK is the only means of archiving data from R/3 database tables.
Archived data from Releases 2.1 and 2.2 are readable.

SAP AG BC670 3-5


$'.$3,)XQFWLRQ*URXS$5&+ 

$5&+,9(B&/26(B),/(
&'()#* +#,.-0/,213- * 4#576'89&1 * 64
& ':();* +#,.-0/, 13-24#,0<1.-06=:>7,?(91
&':();* +#,.-0/, 13-24#,0<:1@-2'#,0(#6'#A
&B':()#* +
,.-7/C,213-24#,0<:1.-7D 1 '#E(#1@-7D9F ,2(#* 5
&B':();* +
,.-7/C,213-06CF , 42-25?* G7,2D
&';(
)#* +#,@-?/,213-2'#,2(96'#A2-?* 495.6

  

    &':()9* +#,.-0/, 13-?D1@&1 * D 12* (9D
  !  #"  $ % &';()9* +#,@-?/,213-017&=9G0,
&B':(
)#* +#,@-?/,21@-.H* 1 )2-0(
E#':D 6'
$5&+,9(B1(:B2%-(&7
&';();* +
,3-?6CF,24?-2506'2-0(;6I42+9,:'D:* 64
&':(
)9* +#,.-06F, 4?- 576'2-?A#,2G?,?12,
&';(
)9* +
,3-06IF,24?-2576C'?-:86#+#,
&'()#* +#,.-06F, 42-25J6C'?-2'#,7&BA
$5&+,9(B23(1B)25B:5,7(
&';()9* +#,@- F26F E9FJ-0(
E;D21?6K8* L* 4;/;-2A&1.&
$5&+,9(B387B5(&25'
$5&+,9(B387B7$%/(
&';()9* +#,@- ';,0&A2-06=:>7,?(;1
&':(
)#* +#,.-2'#,2/* D21,2'?-0(G.&
D2D
&';(
)9* +#,.-2'#,GJ6#&A0-?6=>0,2(913-2A&1J&
&B':()#* +
,.-?';6G?G7=&
(M?-JHN6C';M
$5&+,9(B6$9(B2%-(&7
&';();* +
,3-?D9,71.- '9,?(96C';A2-0(E9':D6'
$5&+,9(B:5,7(B67$7,67,&6

SAP AG 2002

n The function group ARCH includes the function modules for access to ADK archive files.
n The function group AADM contains function modules for managing ADK archive files.
n The group ARCH is essential for customer developments.
n Archiving programs are created by the respective applications. The application programs selection
and check logic. The application uses the function modules listed above as the interface to ADK.

SAP AG BC670 3-6


$'.$3,)XQFWLRQ*URXS$5&+ 

$5&+,9(B&/26(B),/(
&';(#)#* +#,.-0/C,?1@- * 4#576C'
8#&
1 * 64
&'()9* +#,.-0/,21@-?4#,0<:1.-06=:>7,?(91
$5&+,9(B'(/(7(B2%-(&7B'$7$
&':();* +#,.-0/, 13-24#,0<:1@-2'#,0(#6'#A
&B':(
)#* +#,@-0/C,21@-?49,0<:1.-?D21 '9E;(;1@-?D;F2,2(* 5
OPQ
 2   
#  2;2P
#9 2 !  
"  $ % $5&+,9(B*(7B&86720,=,1*B'$7$
&B':();* +
,.-7/C,213-06CF:,?42-25?* G7,2D
&'()9* +#,.-0/,21@-?'#,2(#6'9A2-2* 495J6
&';(
)#* +#,@-?/,213-0D1J&#1* D 1 * (9D
&';()9* +#,@-?/,213-017&=9G0,
&B':(
)#* +#,@-?/,21@-.H* 1)?-0(
E#':D 6'
$5&+,9(B*(7B1(;7B2%-(&7
$5&+,9(B*(7B1(;7B5(&25'
$5&+,9(B*,9(B67$7,67,&6
&';();* +
,3-?6CF, 40-2506'2-0(;6I42+9,:'D:* 64
$5&+,9(B23(1B)25B'(/(7(
&'()9* +#,.-06F, 4?- 5J6'2-86#+#,
&B';(#)#* +#,@-?6F:,?42-2506'?- ';,7&A
&'()#* +#,.-2F26F E#FJ-0(
E:D 1?6I8* L* 4/#-?A &1.&
&'()9* +#,.-2';,0&A2-06=:>7,?(;1
&':(
)#* +#,.-2'#,2/* D21,2'?-0(G.&
D2D
&';()9* +#,@- ';,GJ6#&A2-76C=>7,2(#1@-?A&
1J&
&B';(
)#* +
,.-?';6G?G7=&(
M?-JHN6C'9M
&B';(
)9* +#,@-?D;,01J-2';,?(#6'#A?-7(E#':D6'
$5&+,9(B:5,7(B67$7,67,&6

SAP AG 2002

n Delete programs are created by the relevant applications. The application uses the function modules
listed above as the interface to ADK.

SAP AG BC670 3-7


:KHUH&DQ<RX)LQGWKH$'.$3,LQ5"

l )XQFWLRQPRGXOHV IRU$'.SURFHVVLQJ WKDWDUHUHOHDVHG


IRUFXVWRPHUVDUHORFDWHGLQWKHIXQFWLRQJURXS$5&+

l 3DWK
7RROV!$%$3:RUNEHQFK!2YHUYLHZ!
2EMHFW1DYLJDWRU!)XQFWLRQ*URXS$5&+

l 'LVSOD\WKHIXQFWLRQJURXS
([SDQGWKHIXQFWLRQPRGXOHV

SAP AG 2002

n Documentation on ADK can be found under:


BA-ABAP Workbench - BC Extended functin library - Archiving

SAP AG BC670 3-8


$UFKLYLQJ&ODVVHV 

qwSmnSf` gxSI]^C_` bVhykgK`zceXSIc qOS


mQSX` gpSK]^C_K` bIVBh~kBg`zcefSIc qwS
mQSf` giSK]^C_` bCVBhykgK`zceXSIc
S]^C_K` b`zce{j|T:}QV^#m SI]^C_K` b`zceX^IU S
gg SK]^C_K` ba`zceXj|T:}QVB^m

2 0:?: 22? v $ "#9N2 2N  ;2  :?#N00


2 0:?: :t2? 0 02 ;t?22 ;2  :?:00
2 0:?: 22? ;2  :?:00
2 0:?: 22? v $ "#2 2N  ;2  :? 00
0 02 ;t?22
v $ "#9N2 2N 
0 02  ?22

v $ "#9N2 2N 
:  2 :00

v $ "#9N2 2N 
0 02  ?22

v $ "#9N2 2N 
:  2 00

v $ "#9N2 2N 
:  2 #N00
2 0:?: 22? ;2  :?:00
\P]^C_a` b`dcef^CU S
gBg
RSITKU VXW%YNZO[ ^C_SIceKVihKj^CkClfVIcmng RaSITKU VuWv\PY
RKSKTKU VpoqNrqts
SAP AG 2002

n Use of archiving classes:


Within the framework of FI- and SD-document archiving, the function modules for archiving the
change document tables are called, and the change documents belonging to the relevant R/3 business
objects are stored together with them in the archive file.
n Archiving classes collect change documents.
n The archiving class Changedocu archives not only from CDHDR, but also from the second table
CDPOS.
n Data from archiving classes can only be accessed with the function modules belonging to the
archiving class itself.
These function modules, which are tailored specifically to suit the archiving class data, are
developed by the relevant applications.
n Data that is stored using archiving classes is not transparent for ADK. ADK cannot interpret data. It
reads archived data by using an application-specific function module.

SAP AG BC670 3-9


$UFKLYLQJ&ODVVHV 

l $UFKLYLQJFODVVHV
)XQFWLRQPRGXOHVDQGIRUPURXWLQHVEHORQJLQJWRD
EXVLQHVVREMHFWZKLFKLVQRWXVXDOO\DUFKLYHGRQLWVRZQEXW
ZKLFKLVXVHGDQGDUFKLYHGPRUHWKDQRQFHDVDVHUYLFH
IXQFWLRQZLWKLQWKHV\VWHP
([DPSOHVRIDUFKLYLQJFODVVHV
6$3VFULSWWH[WV
&KDQJHGRFXPHQWV
9DULDQWFRQILJXUDWLRQV
6$3$UFKLYH/LQNHQWULHV
,'2&V
:RUNLWHPV
+5WLPHGDWD
+5WUDYHOGDWD
&2VHWWOHPHQWGRFXPHQWV


SAP AG 1999
2002

n Release 4.6 contains 57 archiving classes.


n Archiving classes are maintained in transaction ACLA.
n Class-specific function modules are useful for customer-specific function modules that are required
to read data from archiving classes.
Form routines are important for the communication between ADK and archiving classes.

SAP AG BC670 3-10


$UFKLYLQJ&ODVVHV 

l 8VHRI$UFKLYLQJ&ODVVHV
$UFKLYLQJFODVVHVSURFHVVFRPSOH[FURVVDUFKLYLQJ
REMHFWORJLFDOGDWDREMHFWV
'DWDVWUXFWXUHVDUHXVHGDQGDUFKLYHGE\YDULRXV
DSSOLFDWLRQV

l $UFKLYLQJFODVVHVDUHFUHDWHGE\WKHUHVSRQVLEOH
SHUVRQVIURPWKHGHYHORSPHQWDUHD

SAP AG 2002

n 1RWH Archiving classes are not developed in the ADK develoment environment, which is released to
customers.

SAP AG BC670 3-11


$UFKLYLQJ&ODVVHV 

l $GYDQWDJHVRIDUFKLYLQJFODVVHV
5HXVDELOLW\ZLWKRXWDGGLWLRQDOZRUNORDG
1HZDUFKLYLQJFODVVHVFDQEHXVHGHDVLO\WRH[WHQG
DUFKLYLQJREMHFWV
9LHZRIWKHREMHFWDQGQRWLWVSK\VLFDOGDWD
5HWHQWLRQRIGDWDLQWHJULW\
&RQWDLQDUFKLYLQJGDWDDQGDUFKLYLQJPHWKRGV
&HQWUDOLPSOHPHQWDWLRQRIDUFKLYLQJIXQFWLRQDOLW\

SAP AG 2002

n Archiving classes reflect an object-oriented approach and encapsulate the methods for accessing
data.
Because of the data encapsulation, the calling program no longer has to know the specific data
structures and heirarchies. By using archiving classes, you can easily archive and read data for
which you have no detailed knowledge.

SAP AG BC670 3-12


$'.$3,&RQFOXVLRQ

<RXQRZNQRZ

l 7KHVFRSHRIWKH$'.
SURJUDPPLQJLQWHUIDFHZKLFK
LVUHOHDVHGWRFXVWRPHUV
l $UFKLYLQJFODVVHVSURYLGHWKH
PHDQVWRUHGXFHWKHVL]HRIWDEOHV
ZKLFKDUHVLPXOWDQHRXVO\ILOOHG
E\GLIIHUHQWDSSOLFDWLRQV

SAP AG 2002

SAP AG BC670 3-13


([HUFLVHV

8QLW$'.GHYHORSPHQWWRROV
7RSLF$VVLJQ$'.IXQFWLRQPRGXOHV
$VVLJQDUFKLYLQJFODVVHV

At the conclusion of this unit, you will be able to:


find and assign ADK function modules within the system
explain the reason for archiving classes
assign the archiving classes used

1-1 $'.IXQFWLRQPRGXOHV

1-1-1 Which function groups contain function modules released for customers?

1-1-2 Take a look at the function modules.

1-1-3 Which are used for deletion, which for archiving?

1-2 $UFKLYLQJFODVVHV

1-2-1 Why were archiving classes developed? Which data is archived/deleted with
them?

1-2-2 Who creates archiving classes?


Are customers allowed to create archiving classes?

1-2-3 Which archiving classes are used by the archiving object SD_VBKA?

SAP AG BC670 3-14


6ROXWLRQV

8QLW$'.'HYHORSPHQW7RROV
7RSLF$VVLJQLQJ$'.IXQFWLRQPRGXOHV
$VVLJQLQJDUFKLYLQJFODVVHV

1-1 Solution to question 1-1

1-1-1 The modules are contained in the function group ARCH

1-1-2 Tools, ABAP Workbench, Overview, Object Navigator


Select Function group
Entry: ARCH
Button Display
Open Function modules

1-1-3 Write: Archive_open_for_write


Archive_new_object
Archive_put_record
Archive_put_table
Archive_save_object
Archive_write_statistics
Archive_close_file

Delete: Archive_get_customizing_data
Archive_close_file
Archive_get_next_object
Archive_get_next_record
Archive_open_for_delete
Archive_delete_object_data
Archive_write_statistics

1-2 Solution to question 1-2

1-2-1 Archiving classes read and write objects to tables, which are not filled by
a specific business object, but which are used on a cross-application basis by
R/3 .

1-2-2 Archiving classes are created by the responsible application. The development
of archiving classes by customers is NOT supported.

1-2-3 Call transaction AOBJ


Flag the archiving object SD_VBKA
Select dialog structure archiving classes used
Result: address, changedocu, cu_config, k_total, k_unitcost, text

SAP AG BC670 3-15


'DWD$UFKLYLQJ3URJUDPPLQJ/RJLF

&RQWHQWV

l 'HILQLWLRQRIDUFKLYLQJREMHFWV
l &RQVWUXFWLQJDUFKLYLQJSURJDPV
l )XQFWLRQPRGXOHVLQDUFKLYLQJSURJUDPV
l &RQVWUXFWLQJGHOHWHSURJDPV
l )XQFWLRQPRGXOHVLQGHOHWHSURJUDPV
l ,PSRUWDQWSURFHGXUHVZKHQH[WHQGLQJVWDQGDUGDUFKLYLQJ
REMHFWVH[DPSOH,62,/

SAP AG 2002

SAP AG BC670 4-1


'DWD$UFKLYLQJ3URJUDPPLQJ/RJLF
8QLW2EMHFWLYHV

$WWKHFRQFOXVLRQRIWKLVXQLW\RXZLOONQRZ

l 7KHORJLFRIDUFKLYLQJSURJUDPV
l 7KHORJLFRIGHOHWHSURJUDPV
l 7KHSURFHGXUHIRUFUHDWLQJDQHZDUFKLYLQJ
REMHFW
l 7KHSURFHGXUHIRUH[WHQGLQJDVWDQGDUG
DUFKLYLQJREMHFW

SAP AG 1999
2002

SAP AG BC670 4-2


2YHUYLHZ'LDJUDP

&RXUVH2YHUYLHZ

7KH'DWD$UFKLYLQJ3URFHVV

$'.'HYHORSPHQW7RROV

'DWD$UFKLYLQJ3URJDPPLQJ/RJLF

&XVWRPHU6SHFLILF5HDG3URJDPV

%XVLQHVV9LHZVLQ6$3$6

$SSHQGL[

SAP AG 2002

SAP AG BC670 4-3


'DWD$UFKLYLQJ3URJDPPLQJ/RJLF
%XVLQHVV6FHQDULR

l 7KHSURJDPPHUVRIFXVWRPHUVSHFLILF
DUFKLYLQJREMHFWVZDQWWRXQGHUVWDQGWKH
ORJLFEHKLQG6$3GDWDDUFKLYLQJ

SAP AG 1999
2002

SAP AG BC670 4-4


$YDLODELOLW\RI$'.$3,

l $'.LVDYDLODEOHDVDGHYHORSPHQWWRRO

6$3GHYHORSHUVIRU6$3VWDQGDUGREMHFWV
&XVWRPHUV)RUFXVWRPHUVSHFLILFWDEOHVQRWIRU6$3
VWDQGDUGREMHFWV
&XVWRPHUVFDQXVHDGHYHORSHUVNH\WRH[WHQGWKH6$3
VWDQGDUGV\VWHP
w =DQG<DVDQH[WHQVLRQWRDQ6$3DUFKLYLQJREMHFW

&XVWRPHUVFDQFUHDWHDFFHVVURXWLQHVWRDUFKLYHGGDWD
w $QDO\VLVUHSRUWV
w 'LUHFWDFFHVVWRDVLQJOHGRFXPHQW
w %XVLQHVVYLHZVLQ6$3$6

SAP AG 1999
2002

SAP AG BC670 4-5


$Q$UFKLYLQJ2EMHFWV3URJUDPV

l $QDUFKLYLQJREMHFWVSURJUDPV

 
 !

 $   !" 
  
   #   
%  
 
     $ ( ')
&  ' !  ! !'' !    
 $ *+-,+.*
 /  ' !  
  $!

SAP AG 2002

n The minimum requirements for an archiving object are a write program and a delete program.
n Most archiving objects also contain additional reports and a single-document access function using
SAP AS.
n An archiving object can also contain programs for preprocessing, analysis, reloading and
postprocessing.
Optionally, there is also an index progam for direct access to a single document in an archive file.
However, direct single-document access is controlled using the generic functions of the Archive
Information System (SAP AS). Index programs are therefore unnecessary.
n You can create reload programs, but these should only ever be used immediately after an archiving
session for situations where the wrong data has been selected for archiving.
n The deletion indicator is often set for master data in the preprocessing program.
n Analysis programs make it easier to identify documents for selection and can identify documents that
cannot be archived due to business considerations.

SAP AG BC670 4-6


&UHDWLQJDQ$UFKLYLQJ2EMHFW

l &UHDWLQJDQDUFKLYLQJREMHFW
n WUDQVDFWLRQ$2%-

n 7KHIROORZLQJHQWULHVDUHPDQGDWRU\
6WHS$UFKLYLQJDQGGHOHWHSURJDPV
6WHS$UFKLYLQJREMHFWSDUDPHWHUV
6WHS7DEOHVZKLFKDUHDUFKLYHG
6WHS&XVWRPL]LQJVHWWLQJV
6WHS:KHUHDYDLODEOH$UFKLYLQJFODVVHVXVHG
6WHS:KHUHDYDLODEOH$YDLODEOHUHDGSURJUDPV

SAP AG 2002

SAP AG BC670 4-7


7UDQVDFWLRQ$2%-5HOHDVHWR
Change View Archiving Objects: Overview
Table view Edit Goto Selection Utilities System Help
QDREM
New Entries Variable list
Navigation
0.12 354 6748:9<;=->?2@
AABCD =5=5EE?5?5FH G$354$2 3 1? 12374 6?I
FJ48<G$374D2 3LKMD;NO;8:E!KPI$?:E?7@ ?

A 
A 
B
V$?6?:EXWJA;$AYO 
C D
BQRW$D Z 48M@ D 48S8?7@ G:;$1TS91 DU 374$2

0 Object Q$[ 0]\$\ ^ C 0pDescription


F$F?7@ F@ ?archiving
of the 1<I @ object 6 E N?5F D 8I q ;6? q ?$8M@$F `0$0M`ab:ZW program
0 Q[ \ C ^_^` 0pFF ?7@$FArq:A D @ Du @ D =RD E?7DtF s D
Archiving
`0$0M`ab:ZW
0M`a$bMcedM^VfMg V48TL?$85@14?MFJY$1; q 0.123746:?$V48T j0$0M`ab:Z
h0f7g$^f C ?7F@vY$;1r= D 8T7F
h:a [ 0M`:a$b7ced5^ 0512374 67489<;Y D 1:2 3746? qMD 8 D 9? q ?$85@wI D @ D `5\00 iQ 0M`
h:a [7i hVjk7\ 0512374 67489S23 D 89?7FS@;LaN5F$@; q 4:x489O@ D =5E?MF `5\ V i 0M`ab:ZW
h:a [ \ hj$jg ha []C ` 0d.^V Ai ? q ;(yz\hj$jg \ h$jjg 0
h^V^:k {7cvI;2 N q ?8M@
a!a0 0 [ C$gl h`Vj m 07`:ab a!c!0 85C@CX?1A 8}~V;` 9M| l I1$;;22$Ft?$}
INM"1{? N8I7FJ1$?7F?16}e|{4 ?I 14$2?.|-}$}$}`5\a0 Cl `0
`gh^ 0M`5`
aa Q a05V$Vh:a$g a D EE$2?8.@ ?1 A a D EE!= D 2$Tr051:2 374 65489Xa D EE= u D 2TMFU aa Q aV$h 00
aa Q V$j:k$k7cf5k a D EEa?8M@ ?1 A 0.27@4 6747@KV:;9$9489w0.12 3M46? aa aVk!00
aj l 0]W [ c i ^0 a$;:F@489 A h D F?$I<a$j Al 0 s j U ?1 D @489Sa$;872?18c i ^0 `g7Q 0]c i ^0
aj l 0]W [ `MnZZ a$;:F@489 A h D F?$I<a$j Al 0 s j U ?1 D @489Sa$;872?18<`MnZZ `g707`5n$ZZ
aj l 0]W [ \$ZZW a$;:F@489 A h D F?$I<a$j Al 0 s j U ?1 D @489Sa$;872?18P\$ZZW `g70p\Z$ZW
aj l 0Ro [ c i ^0 a$;:F@489 A h D F?$I<a$j Al 0 s j U ?1 D @489Sa$;872?18c i ^0 `g7 i c i ^0
aj l 0Ro [ `MnZZ a$;:F@489 A h D F?$I<a$j Al 0 s j U ?1 D @489Sa$;872?18<`MnZZ `g7 i `5n$ZZ
aj l 0Ro [ \$ZZW a$;:F@489 A h D F?$I<a$j Al 0 s j U ?1 D @489Sa$;872?18P\$ZZW `g7 i \Z$ZW
aj [ 05VVj [ \ C a$; q$U E?7@?E!K2 D 8:2$?E$E$?$ILI:Position... ;2 N q ?8M@F ^$8M@1KW`;$g7YO \07W`5\eo 5`
SAP AG 2002

n Navigation steps in transaction AOBJ:

Step 1: Archiving object


Step 2: Tables which are archived
Step 3: Tables in which you only delete
Step 4: Maintain network graphic
Step 5: Customizing settings
Step 6: Archiving classes used
Step 7: Read programs
Step 8: Customizing transactions
Step 9: Info tables belonging to archive files
Step 10: Assignment of exit routines at generation

SAP AG BC670 4-8


7UDQVDFWLRQ$2%-5HOHDVH

Dialog structure Object Description of archiving object


Archiving object CO_KSTRG Cost object with master and transaction data
Structure definition CO_ML_BEL Material ledger docs (MLHD/IT/PP/PP...)
Tables which you only del. CO_ML_DAT Material ledger records (CKMLPP, CKMLCR)
Maintain network graphic CO_ML_IDX Index entries material document: ledger
Customizing settings CO_ML_ML1 Material ledger period records (CKML1)
Archiving classes used CO_ORDER Orders with transaction data
Read progams CO_PROCESS Business process incl. transaction data
Customizing transactions CO_TEST Test only
Appl. information tables CS_BOM PP object lists
Exit-routine assignment CV_DVS Document management system
DATAFDLOG TR-TM: Record accesses to datafeed
EC_PCA_SUM Profit-Center-Rechnung: Summenstze
EIS_CF001 Archive object for aspect CF001
EIS_CF002 Archive object for aspect CF002
EIS_CF003 Archive object for aspect CF003
EIS_CF004 Archive object for aspect CF004
EIS_CF005 Archive object for aspect CF005
EIS_CF006 Archive object for aspect CF006
EIS_CF050 Archive object for aspect CF050
EIS_CF501 Archive object for aspect CF501
EIS_CF502 Archive object for aspect CF502
EIS_CF503 Archive object for aspect CF503

Position Entry 1 of 182


SAP AG 2002

SAP AG BC670 4-9


0LQLPXP5HTXLUHPHQWVSHU$UFKLYLQJ2EMHFW 

l 7UDQVDFWLRQ $2%-DUFKLYLQJREMHFW
(QWHUWKHDYDLODEOHSURJUDPV

3URJUDPVIRUWKHIROORZLQJSURFHVVHVFDQRUPXVWEH
DYDLODEOHIRUDQDUFKLYLQJREMHFW

3UHSURFHVVLQJ RSWLRQDO

&UHDWHDUFKLYHILOH V

'HOHWHGDWDIURPGDWDEDVH

3RVWSURFHVVLQJ RSWLRQDO

5HORDGGDWDWRWKHGDWDEDVH RSWLRQDO

SAP AG 1999
2002

n Possible functions of preprocessing progams:


Set the deletion indicator in the master data (for example, in PP)
Determine archivable data (for example, in SD)
n Archiving objects with postprocessing progams (Release 4.5A):
QM_CONTROL
PA_PDOC
FI_DOCUMNT
CATPROARCH

The postprocessing progam for the archiving object FI_DOCUMNT (FI documents) for example,
deletes data from the FI indexes.
n You can find SAP Notes on archiving objects in transaction 6$5$ by choosing the i symbol in the
activity screen (schedule archiving, schedule deletion,...).

SAP AG BC670 4-10


0LQLPXP5HTXLUHPHQWVSHU$UFKLYLQJ2EMHFW 

l 7UDQVDFWLRQ$2%-$UFKLYLQJREMHFW
(QWHULQJGHILQLWLRQIODJV

! %XLOGLQGH[
! 6WDUWDWHQG
! &URVVFOLHQW
! (QGGLDORJ
! ,QYDOLGIODJ
! 1RUHORDGILOHV

SAP AG 1999
2002

n Cross-application: The transaction SARA is client-specific. You can set this indicator if you want to
work on a cross-client basis.
n End dialog: During archiving, R/3 dialog operations should be stopped in order to avoid data
collisions. When scheduling the jobs, the administrator receives a warning that further checks will
not be carried out.
n Invalid: If archiving sessions are incomplete and there is no completed status, you can mark the entry
as invalid in archive administration.
If the invalid indicator is set for an archiving object, the indicator for invalid archive files cannot be
reversed in archive managment.
n no r. files (from Release 4.0A): When reloading data to the database, new archive files are created if
not all of the data from a session was reloaded. If this indicator is set, the system will not create any
new files.
n Prg.generated: Archiving objects that work with statistical or controlling data, generate their
programs based on individual user inputs at runtime. Example: MKIS, COPA1_*
n Build index: The archiving object is usually able to construct an index. There must also be an index
build program stored in AOBJ.

SAP AG BC670 4-11


0LQLPXP5HTXLUHPHQWVSHU$UFKLYLQJ2EMHFW 

l 7UDQVDFWLRQ$2%-VWUXFWXUHGHILQLWLRQ
(QWHUWKHWDEOHVIURPZKLFK\RXZDQWWRDUFKLYHGDWD
7KHHQWULHVUHSUHVHQWWKHDUFKLYLQJREMHFWVGDWDPRGHO

l 7UDQVDFWLRQ$2%-&XVWRPL]LQJVHWWLQJV
7HFKQLFDOVHWWLQJVVXFKDVILOHVL]HVFRPPLWFRXQWHUGHOHWH
SURJUDPYDULDQWVFRQQHFWLRQWRH[WHUQDOVWRUDJHV\VWHP
7KHWHFKQLFDOVHWWLQJVFDQEHPDLQWDLQHGE\WKHXVHULQ
WUDQVDFWLRQ6$5$

SAP AG 2002

n Entries in the structure definition:


Record no.: order definition only
n Parent segment: Name of the next highest structure in the hierarchy. Therefore, for the first record,
this field remains empty. From Release 3.0, entries are also only for defining the order.
In Release 2.2, archiving was organized hierachically.
n Segment: Subordinate segment in the archive heirarchy. Name of the structure belonging to the
archiving object. This field informs ADK (and its function module) which tables are to be processed.
The ADK uses the entries for the following functions:
Metadata for the archive file that is to be written
Information basis for transaction DB15

Structure: If a structure name is entered here, this structure will be used for conversions. This is
essential if you are working with logical databases and the structure name entered under segment is
a pseudonym for a real structure. ADK uses the entries in the same way as was described for
segments (see above).
n Technical Customizing:
From 4.6A, the commit counter can only be maintained in transaction AOBJ.

SAP AG BC670 4-12


0LQLPXP5HTXLUHPHQWVSHU$UFKLYLQJ2EMHFW 

l 7UDQVDFWLRQ$2%-DUFKLYLQJFODVVHVXVHG
(QWHUWKHDUFKLYLQJFODVVHVWKDWWKHDUFKLYLQJREMHFWXVHV

$QHQWU\LQWUDQVDFWLRQ$2%-PHDQVWKDWWKHDUFKLYLQJFODVV
LVXVHGE\WKHDUFKLYLQJREMHFW

l 7UDQVDFWLRQ$2%-UHDGSURJUDPV
LIWKHDYDLODEOHUHDGSURJUDPVDUHHQWHUHGWKHQWKHSURJUDPV
FDQEHFDOOHGIURPWKHFRQWH[WRIWKHDUFKLYLQJWUDQVDFWLRQ
6$5$

SAP AG 2002

n It is necessary to enter the archiving classes in AOBJ so that transaction '% and the Archive
Information System consider the archiving classes.
n Transaction '% determines the tables that belong to an archiving object or, conversely, the
suitable archiving object for a table.

SAP AG BC670 4-13


0LQLPXP5HTXLUHPHQWVSHU$UFKLYLQJ2EMHFW 

l 7UDQVDFWLRQ$2%-&XVWRPL]LQJWUDQVDFWLRQV

*URXSRIWUDQVDFWLRQVLQZKLFKDSSOLFDWLRQVSHFLILF
&XVWRPL]LQJPXVWEHFDUULHGRXW
,QDSSOLFDWLRQVSHFLILF&XVWRPL]LQJWKHDSSOLFDWLRQVDOORZ
FULWHULDIRUWKHDUFKLYDELOLW\RIGDWDWREHHQWHUHGZKLFKDUH
FKHFNHGGXULQJDQDUFKLYLQJVHVVLRQ
)RUWUDQVDFWLRQGDWDWKLVLVPDLQO\GHILQLQJUHVLGHQFHWLPHV
)RUPDVWHUGDWDWKLVLVPDLQO\VHWWLQJGHOHWLRQLQGLFDWRUV
7KHDSSOLFDWLRQVSHFLILFVHWWLQJVDUHFDUULHGRXWZLWKLQ
DSSOLFDWLRQ&XVWRPL]LQJ

SAP AG 1999
2002

SAP AG BC670 4-14


6XSSRUW&RPSRQHQWVLQ5

l 5! $([DPSOHDUFKLYLQJREMHFW%&B6%22.ZLWK
SURJDPVIRU
:ULWLQJDUFKLYHILOHV 6%22.$
'HOHWLQJDUFKLYHGGDWDIURPWKHGDWDEDVH 6%22.'
5HSRUWLQJIURPDUFKLYHILOHV 6%22.5
)LOOLQJDQDUFKLYHLQGH[ 6%22.,
l 5$([DPSOHDUFKLYLQJREMHFW(;$03/(
3URJDPVVLPLODUWR6%22.
56$5&+56$5&+56$5&+56$5&+
6LQJOHGRFXPHQWUHDG56$5&+ 

SAP AG 1999
2002

n Note: The archiving object EXAMPLE only simulates deletion of data from the database.
n Functionality read single document for SBOOK is realised via SAP AS;
The index construct program has a greater documentation character.

SAP AG BC670 4-15


3URJUDPPLQJ/RJLF$UFKLYLQJ 

l $XWKRUL]DWLRQFKHFN

l 5HDGVHOHFWLRQ

l 5HDG&XVWRPHU6SHFLILF
&XVWRPL]LQJ

l 'DWDVHOHFWLRQ

l ,PSOHPHQWFKHFNORJLF
IURPDEXVLQHVVORJLFSRLQWRIYLHZ

SAP AG 2002

n Authorization checks include the


authorizations for calling ADK function modules
authorizations for maintaining AOBJ
authorizations for creating and managing jobs
authorizations from the relevant application for writing the archive file
authorizations for maintaining the application-specific archiving Customizing
You must make sure that checks are implemented in exactly the same way as in online operations.
The selection of data from the database should be as specific as possible. Avoid reading
unnecessary data relating to authorization checks.
n The person responsible for the archiving must enter the required criteria in the selection screen.

n In the data selection, the database data is collected according to the selection criteria.
n The check logic establishes whether data records are archivable. It examines the residence times in
application-specific Customizing as well as specific additional internal check logic.

SAP AG BC670 4-16


3URJUDPPLQJ/RJLF$UFKLYLQJ 

l :ULWHGDWDREMHFW$'.$3,XVHG

$UFKLYHBRSHQBIRUBZULWH
w 'R
w $UFKLYHBQHZBREMHFW
$UFKLYHBSXWBUHFRUG
7(;7B$5&+,9(B2%-(&7
$UFKLYLQJ)0EHORQJLQJWRDQDUFKLYLQJFODVV
w $UFKLYHBVDYHBREMHFW
w (QGGR
$UFKLYHBZULWHBVWDWLVWLFV
$UFKLYHBFORVHBILOH

SAP AG 2002

n ARCHIVE_NEW_OBJECT prepares a data container in the main memory. This function module
also ensures communication with any archiving classes.
n ARCHIVE_PUT_RECORD writes a record in the prepared data container.
n TEXT_ARCHIVE_OBJECT is the archiving function module for the archiving class TEXT. It is
used to collect archiving class data for an object and to store it in its own data area on the main
memory.
n In ARCHIVE_SAVE_OBJECT, ADK takes the records from the data container and compresses it.
From the archiving classes, ADK requests the compressed archiving class data for the object and
writes it to the ADK file. At present, ADK cannot subsequently decompress this data.
n ARCHIVE_CLOSE_FILE releases all resources and starts the delete program if Start autom. has
been selected in Customizing.
If you forget the Archive_Close_File, the last archive file is not closed.

SAP AG BC670 4-17


$'.$3,$5&+,9(B23(1B)25B:5,7(

l ,QWHUIDFHSDUDPHWHUH[SRUW
DUFKLYHBKDQGOH

l ,QWHUIDFHSDUDPHWHULPSRUW
FDOOBGHOHWHBMREBLQBWHVWBPRGHFUHDWHBDUFKLYHBILOH
REMHFWFRPPHQWV

l )XQFWLRQPRGXOHIXQFWLRQDOLW\
&UHDWHDUFKLYHILOHLQWKHILOHV\VWHP
&UHDWHDUFKLYHKDQGOH

SAP AG 2002

n ADK has multi-instance capability.


Each handle addresses one instance. In one program, more than one archive can be read in parallel.
The handle, as it is used in ADK, is comparable with a file handle in the file management system.
n In transaction $2%- Customizing settings you can specify whether the delete program for the
archived data is to be called automatically.
n The archiving function modules use platform-independent filenames to create new archive files. In
transaction $2%- Customizing settings, you can specify the platform-independent filenames that
are to be used for your archiving object.
If you have not defined a filename, the system will automatically use the platform-independent
filename ARCHIVE_DATA_FILE to create the server-independent filename.
n The import parameters mentioned do not come from the technical settings for the archiving object.
They are selection parameters.
In the Comments parameter, you can enter a text that is automatically saved as management data
during the session.
n The function module informs the archiving classes used and makes an entry in the archive
management that signifies that an archiving session is in progress.

SAP AG BC670 4-18


$'.$3,$5&+,9(B1(:B2%-(&7

n ,QWHUIDFHSDUDPHWHULPSRUW
DUFKLYHBKDQGOH

l )XQFWLRQPRGXOHIXQFWLRQV
,QLWLDOL]HVDQHZGDWDREMHFW
'LVFDUGVWKHSURFHVVHGGDWD

SAP AG 2002

n This function module should always be called if a new data object is to be prepared for writing to an
archive.
n There can only be one data object per handle. When this function module is called, all of the data
from the current data object is forgotten, and all of the accompanying archiving classes are informed
that the following operations with this handle belong to a new data object.
n The archiving classes will forget all of the information about the current data object.
n The system does not check whether you have stored the current data object with the function module
ARCHIVE_SAVE_OBJECT.

SAP AG BC670 4-19


$'.$3,$5&+,9(B387B5(&25'

l ,QWHUIDFHSDUDPHWHULPSRUW
DUFKLYHBKDQGOH
UHFRUGBIODJ
UHFRUGBVWUXFWXUH
UHFRUG

l )XQFWLRQPRGXOHIXQFWLRQV
:LWKWKLVIXQFWLRQPRGXOH\RXFDQWUDQVIHUDGDWD
UHFRUGWRWKHGDWDREMHFWWKDWZDVSUHYLRXVO\
UHTXHVWHGZLWKWKHIXQFWLRQPRGXOH
$5&+,9(B1(:B2%-(&7$OORIWKHGDWDUHFRUGVWKDW
\RXSDVVWRWKHGDWDREMHFWDUHZULWWHQWRJHWKHUWRWKH
DUFKLYHILOHZKHQ\RXFDOOWKHIXQFWLRQPRGXOH
$5&+,9(B6$9(B2%-(&7

SAP AG 2002

n The import parameter record_flag is available for any supplementary information. For example, FI
uses it to mark records that are to be deleted.
n The import parameter record_structure is given the name of the structure that is to be transferred.
This name must be stored in the structure definition in AOBJ.
n The actual transferred data is transferred to the import parameter record.
If the structure named under record_structure is not the same as the record in record_real, the
system may issue the runtime error Archive cannot be read
n For complex data objects, you might have to first read and analyse all of the data records, before you
can decide whether this data object is to be archived.
n You do not have to remember the data records, or even re-read the data records from the database.
You can use the function mode to transfer the data records to the data object immediately.
n If you realize that the data records that you transferred should not be archived, call the function
module ARCHIVE_NEW_OBJECT. This ensures that the data that you transferred is discarded.
The data that you transferred to the archiving classes for archiving is also discarded.

SAP AG BC670 4-20


$'.$3,$5&+,9(B387B7$%/(

l ,QWHUIDFHSDUDPHWHULPSRUW
archive_handle
record_structure

l ,QWHUIDFHWDEOH
table

l )XQFWLRQPRGXOHIXQFWLRQDOLW\
With this function module, you transfer an internal table to the data
object that was called previously with the function module
ARCHIVE_NEW_OBJECT.
Each line of the internal table is placed in the data object as a
separate data record. All transferred data records are written
together to the archive file when you call the function module
ARCHIVE_SAVE_OBJECT

SAP AG 2002

n In the record_structure parameter, you enter the name of the name of the structure/table whose
objects are to be written.
n The data is transferred to an internal table via the table interface.
n If required, an archiving program typically selects all line items for one document in an internal
table. This internal table can be transferred, record by record, in its entirety to ADK.

SAP AG BC670 4-21


&RPSDULVRQ
$5&+,9(B387B5(&25'$5&+,9(B387B7$%/(

l :ULWHVRQHUHFRUGHDFK l :ULWHVDUUD\RIUHFRUGV

l 0RUHFRGLQJ l /HVVFRGLQJUHTXLUHGDVQRORRS
FRQVWUXFWLRQ
l /RZHUSHUIRUPDQFHDVUHFRUGV
DUHSURFHVVHGSHUUHFRUG l %HWWHUSHUIRUPDQFHDVUHFRUGVQRW
ZULWWHQLQGLYLGXDOO\

SAP AG 2002

SAP AG BC670 4-22


$'.$3,$5&+,9(B6$9(B2%-(&7

l ,QWHUIDFHSDUDPHWHUH[SRUW
DUFKLYHBQDPH
REMHFWBRIIVHW

l ,QWHUIDFHSDUDPHWHULPSRUW
DUFKLYHBKDQGOH

l )XQFWLRQPRGXOHIXQFWLRQDOLW\
7KLVIXQFWLRQPRGXOHZULWHVDGDWDREMHFWWRWKH
DUFKLYHILOH$VZHOODVWKHGDWDWUDQVIHUUHGZLWKWKH
IXQFWLRQPRGXOH$5&+,9(B387B5(&25'WKHGDWD
WKDWZDVWUDQVIHUUHGYLDWKHDUFKLYLQJFODVVHVZLOODOVR
EHWDNHQLQWRDFFRXQW

SAP AG 2002

n The export parameter object_offset enables you to find the object in the ADK archive file.
n The parameter archive_name returns the key for the ADK archive file.
n If the data object does not fit into the current archive file, the system closes the archive file and
opens a new archive file. The system then automatically calls the delete progam, unless this option
was switched off in transaction AOBJ "Customizing settings".

SAP AG BC670 4-23


$'.$3,$5&+,9(B:5,7(B67$7,67,&6

l ,QWHUIDFHSDUDPHWHULPSRUW
DUFKLYHBKDQGOH
VWDWLVWLFVBRQO\BSHUBUXQ
VWDWLVWLFVBRQO\BSHUBILOH IURP5HOHDVH

l )XQFWLRQPRGXOHIXQFWLRQDOLW\
:LWKWKLVIXQFWLRQPRGXOH\RXFDQFUHDWHVWDWLVWLFV
DERXWGDWDREMHFWVWKDW\RXKDYHZULWWHQWRDQDUFKLYH
ILOHXVLQJIXQFWLRQPRGXOH$5&+,9(B6$9(B2%-(&7
7KHVHVWDWLVWLFVDUHZULWWHQDVDOLVWDQGWKHUHIRUHDSSHDU
LQWKHDUFKLYLQJSURJUDPORJ

SAP AG 2002

n You can use the import parameter statistics_only_per_run to request totals statistics for the whole
arhiving session. The parameter statistics_only_per_file provides statistics for one archive file and
is, for this reason, only useful when used with a delete program.
n You must call this function module immediately before the function module
ARCHIVE_CLOSE_FILE , otherwise you will obtain incorrect values in the number fields.
n The size of the archive file in MB also appears in the output. If you run the archiving program for a
limited selection in test mode, you can use this output to estimate the required disk space.

SAP AG BC670 4-24


$'.$3,$5&+,9(B&/26(B),/(

l ,QWHUIDFHSDUDPHWHULPSRUW
DUFKLYHBKDQGOH

l )XQFWLRQPRGXOHIXQFWLRQDOLW\
7KHIXQFWLRQPRGXOHFORVHVWKHDUFKLYHILOH
7KHUHVRXUFHVZKLFKZHUHDOORFDWHGIRUDKDQGOHDUH
UHOHDVHG7KHKDQGOHLVWKHQLQYDOLGDQGFDQQRORQJHUEH
XVHG(YHU\DGGLWLRQDORSHUDWLRQZLWKWKLVKDQGOHWULJJHUV
WKHH[FHSWLRQ:521*B$&&(66B72B$5&+,9(

SAP AG 2002

n This function module is not only called when writing archives, but also within every ADK function.

SAP AG BC670 4-25


([DPSOH5HSRUW6%22.$ 

REPORT sbooka.

* data declaration
TABLES: sbook.
DATA: button(1) TYPE c,
create(1) TYPE c VALUE X,
no_delete(1) TYPE c VALUE X,
handle LIKE sy-tabix,
sbook_itab TYPE TABLE OF sbook WITH HEADER LINE,
data_object_id LIKE arch_idx_s-obj_id.

* selection criteria and parameters


SELECTION-SCREEN BEGIN OF BLOCK arch_booking WITH FRAME TITLE text-101.
SELECT-OPTIONS: o_carrid FOR sbook-carrid
DEFAULT LH ,
o_order FOR sbook-order_date
DEFAULT 19000101 TO 20020101.
SELECTION-SCREEN END OF BLOCK arch_booking.

SAP AG 2002

SAP AG BC670 4-26


([DPSOH5HSRUW6%22.$ 

SELECTION-SCREEN BEGIN OF BLOCK arch_control WITH FRAME TITLE text-102.


PARAMETERS: no_file LIKE button RADIOBUTTON GROUP radi,
del_test LIKE button RADIOBUTTON GROUP radi DEFAULT X,
del_prod LIKE button RADIOBUTTON GROUP radi.
SELECTION-SCREEN END OF BLOCK arch_control.

PARAMETERS comments TYPE admi_text LOWER CASE


DEFAULT This is test data for archiving with BC_SBOOK(103).

* select data from the database


SELECT * FROM sbook INTO TABLE sbook_itab
WHERE carrid IN o_carrid AND
order_date IN o_order.

* build ADK parameters from chosen button


IF no_file = X. create = . no_delete = . ENDIF.
IF del_test = X. create = X. no_delete = X. ENDIF.
IF del_prod = X. create = X. no_delete = . ENDIF.

SAP AG 2002

SAP AG BC670 4-27


([DPSOH5HSRUW6%22.$ 

* open a new archive session to archive data


CALL FUNCTION ARCHIVE_OPEN_FOR_WRITE
EXPORTING
call_delete_job_in_test_mode = no_delete
comments = comments
create_archive_file = create
object = BC_SBOOK
IMPORTING
archive_handle = handle.

LOOP AT sbook_itab.
CONCATENATE sy-mandt sbook_itab-carrid sbook_itab-bookid
INTO data_object_id.

* initialize a new data object


CALL FUNCTION ARCHIVE_NEW_OBJECT
EXPORTING
archive_handle = handle
object_id = data_object_id. " optional: ADK index

SAP AG 2002

SAP AG BC670 4-28


([DPSOH5HSRUW6%22.$ 

* put data records into ADKs data container


CALL FUNCTION ARCHIVE_PUT_RECORD
EXPORTING
archive_handle = handle
record_structure = SBOOK
record = sbook_itab.

* further (depending) records from other tables usually follow


*
* loop at <depending table X> where ...
* call function ARCHIVE_PUT_RECORD ...
* endloop.
* loop at <depending table Y> where ...
* call function ARCHIVE_PUT_RECORD ...
* endloop.

* write data object into the archive file


CALL FUNCTION ARCHIVE_SAVE_OBJECT
EXPORTING
archive_handle = handle.
ENDLOOP.
SAP AG 2002

SAP AG BC670 4-29


([DPSOH5HSRUW6%22.$ 

create the default spool list


CALL FUNCTION ARCHIVE_WRITE_STATISTICS
EXPORTING
archive_handle = handle.

* close the archive session


CALL FUNCTION ARCHIVE_CLOSE_FILE
EXPORTING
archive_handle = handle.

SAP AG 2002

SAP AG BC670 4-30


3URJUDPPLQJ/RJLF'DWD'HOHWLRQ 

l $UFKLYHBJHWBFXVWRPL]LQJBGDWD
l $UFKLYHBRSHQBIRUBGHOHWH
l 'R
Archive_get_next_object
Do
w Archive_get_next_record
Enddo
Archive_delete _object_data call archiving classes
If cut = cust_cut check commit counter
Perform Delete
endif
l (QGGR
l ,IFXW! SRVVLEOHUHPDLQLQJDPRXQWSURFHVVLQJ
3HUIRUP'HOHWH
HQGLI
l $UFKLYHBFORVHBILOH

SAP AG 1999
2002

n Function module ARCHIVE_GET_NEXT_OBJECT transfers the ADK data to the main memory.
n Form DELETE: Delete data from the database according to the read structure.

SAP AG BC670 4-31


$'.$3,$5&+,9(B*(7B&86720,=,1*B'$7$

l ,QWHUIDFHSDUDPHWHUH[SRUW
FRPPLWBFRXQWBIRUBGHOHWHBSUJ
PDLQWDLQBLQGH[

l ,QWHUIDFHSDUDPHWHULPSRUW
REMHFW DUFKLYLQJREMHFW

l )XQFWLRQPRGXOHIXQFWLRQDOLW\
7KLVIXQFWLRQPRGXOHGHOLYHUVVHWYDOXHVIURPWKH
DUFKLYLQJREMHFW&XVWRPL]LQJWRWKHDUFKLYLQJSURJDP
&XUUHQWO\RQO\WKRVHYDOXHVDUHSDVVHGZKLFKDUH
LPSRUWDQWIRUWKHGHOHWHSURJUDP+RZHYHUWKH
FRXQWHUIRUWKH&RPPLW:RUNFDQDOVREHXVHGIRUWKH
UHORDGSURJDP

SAP AG 2002

SAP AG BC670 4-32


$'.$3,$5&+,9(B23(1B)25B'(/(7(

l ,QWHUIDFHSDUDPHWHUH[SRUW
DUFKLYHBKDQGOH

l ,QWHUIDFHSDUDPHWHULPSRUW
REMHFW
WHVWBPRGH

l )XQFWLRQPRGXOHIXQFWLRQV
7KLVIXQFWLRQPRGXOHRSHQVDUFKLYHVWRGHOHWHIURP
WKHGDWDEDVHWKHGDWDWKH\FRQWDLQ7KHVWDWXVRIWKH
DUFKLYHILOHVLVPRGLILHGDFFRUGLQJO\LQDUFKLYH
DGPLQLVWUDWLRQ

SAP AG 2002

n The import parameter object specifies the name of the archiving object containing records for
deletion.
n The parameter test_mode specifies whether it is a live or test run. The parameter copies the
indicator from the relevant delete program variant that was specified on the selection screen of the
delete program.
n The parameter aindflag controls the interaction with the archive information system. All active
archive information structures are updated during the deletion run.
n Within the scope of the delete job, the function module ARCHIVE_CLOSE_FILE transfers, on
request, (technical settings in Customizing for the relevant archiving object) the archive files that
have been created using SAP ArchiveLink for storage to an external storage system.

SAP AG BC670 4-33


$'.$3,$5&+,9(B*(7B1(;7B2%-(&7

l ,QWHUIDFHSDUDPHWHUH[SRUW
REMHFW $UFKLYLHUXQJVREMHNW
REMHFWBRIIVHW
DUFKLYHBQDPH

l ,QWHUIDFHSDUDPHWHULPSRUW
DUFKLYHBKDQGOH

l )XQFWLRQPRGXOHIXQFWLRQV
7KLVIXQFWLRQPRGXOHUHDGVWKHQH[WGDWDREMHFWIRUD
KDQGOHIURPDQDUFKLYHWKDWKDVEHHQRSHQHGIRU
UHDGDFFHVV

SAP AG 2002

n The import parameter object contains the name of the archive objects processed.
n The parameters archive_offset and archive_name are relevant for writing an index.
n The data belonging to an archiving class is automatically passed on to the relevant archiving class.
This means that the data can be called by the archiving class immediately after the function module
has been called. Long texts and change documents are typical archiving classes.
You can only use function modules ARCHIVE_GET_NEXT_RECORD and
ARCHIVE_GET_NEXT_STRUCT_SPECIF to access data once a data object has been read from an
archive.
n The same functions are present in this function module as in the function module
ARCHIVE_OPEN_FOR_READ , because a new archive file is automatically opened for read access
when the current file has been read completely. This means that the same exceptions can be triggered
as in the function module ARCHIVE_OPEN_FOR_READ. You should take this into account when
writing your programs.

SAP AG BC670 4-34


$'.$3,$5&+,9(B*(7B1(;7B5(&25' 

l ,QWHUIDFHSDUDPHWHUH[SRUW
UHFRUG
UHFRUGBVWUXFXUH

l ,QWHUIDFHSDUDPHWHULPSRUW
DUFKLYHBKDQGOH
DXWRPDWLFBFRQYHUVLRQ

SAP AG 2002

n The export parameter record contains the name of the work area into which the data is to be
imported.
n Record_structure contains the name of the table or structure that is being processed.
n The data record that is returned by the ADK is unstructured and must be copied into a suitable work
structure.
n When ARCHIVE_GET_NEXT_RECORD is called, temporary automatic conversion takes place, if
required, such as adjustment of structure changes; adjustments to heterogeneous system
environments (codepage), and so on.

SAP AG BC670 4-35


$'.$3,$5&+,9(B*(7B1(;7B5(&25' 

l )XQFWLRQPRGXOHIXQFWLRQDOLW\
7KLVIXQFWLRQPRGXOHDOORZV\RXWRUHDGVHTXHQWLDOO\WKH
GDWDUHFRUGVFRQWDLQHGLQDGDWDREMHFW
$WWKHILUVWFDOODIWHUWKHIXQFWLRQPRGXOH
$5&+,9(B*(7B1(;7B2%-(&7KDVEHHQFDOOHGWKHILUVW
GDWDUHFRUGLVDXWRPDWLFDOO\UHWXUQHGDQGIURPWKHQRQ
HDFKIXUWKHUUHFRUGLVUHWXUQHGXQWLOWKHUHDUHQRPRUH
UHFRUGVWREHUHDGIURPWKHGDWDREMHFW

SAP AG 2002

n To read an archive file sequentially, it is sufficient to read the next data object in an external DO-
loop using function module ARCHIVE_GET_NEXT_OBJECT so that function module
ARCHIVE_GET_NEXT_RECORD can read the data object in an internal DO-loop.

SAP AG BC670 4-36


$'.$3,$5&+,9(B'(/(7(B2%-(&7B'$7$

l ,QWHUIDFHSDUDPHWHULPSRUW
DUFKLYHBKDQGOH

l )XQFWLRQPRGXOHIXQFWLRQDOLW\
7KLVIXQFWLRQPRGXOHFDOOVWKHGHOHWHPHWKRGVIRU
DOORIWKHUHJLVWHUHGDUFKLYLQJFODVVHVEHORQJLQJWR
WKHDUFKLYLQJREMHFW7KHDUFKLYHGGDWDIURPDOO
FODVVHVLVWKHQDXWRPDWLFDOO\GHOHWHGIURPWKH
GDWDEDVH

SAP AG 2002

n The function module ARCHVE_GET_NEXT_OBJECT must be called for each object - GLUHFWO\LQ
WKHORRS
n The ADK API of the archiving objects themselves does not provide any delete methods. You must
progam and call this functionality yourself.
This means that you must use the delete program to delete from the database all of the data that was
written to data objects in the archiving progam by ARCHIVE_PUT_RECORD.

SAP AG BC670 4-37


([DPSOH5HSRUW6%22.' 

REPORT sbookd.
* data declaration
CONSTANTS:
object LIKE arch_obj-object VALUE BC_SBOOK.
DATA:
handle LIKE sy-tabix,
buffer TYPE arc_buffer,
sel_files_itab TYPE TABLE OF arch_files,
sbook_wa LIKE sbook,
sbook_itab TYPE TABLE OF sbook,
commit_cnt LIKE arch_usr-arch_comit,
object_cnt TYPE i,
arkey LIKE arch_idx_s-archivekey,
object_id LIKE arch_idx_s-obj_id,
offset LIKE arch_idx_s-obj_offset,
index_tab TYPE TABLE OF arch_idx_s WITH HEADER LINE,
index_flag LIKE arch_usr-arch_index,
sum_objects TYPE i VALUE 0,
stat_itab TYPE TABLE OF arch_stat,
tabfield LIKE arch_stat.
SAP AG 2002

n The variable buffer is divided into the following parts:


buffer_segment and buffer_rname. The name of the table for deletion is contained in buffer_rname.
buffer_segment specifies the work area containing the record for deletion.

SAP AG BC670 4-38


([DPSOH5HSRUW6%22.' 

PARAMETERS: testrun DEFAULT X AS CHECKBOX. " do not delete


" from database

* open a new archive session to delete data


CALL FUNCTION ARCHIVE_OPEN_FOR_DELETE
EXPORTING
object = object
test_mode = testrun
IMPORTING
archive_handle = handle
EXCEPTIONS
OTHERS = 01.
IF sy-subrc <> 0.
WRITE / No file can be accessed(001).
EXIT.
ENDIF.

SAP AG 2002

SAP AG BC670 4-39


([DPSOH5HSRUW6%22.' 

* get customizing data from the archive object


CALL FUNCTION ARCHIVE_GET_CUSTOMIZING_DATA
EXPORTING
object = object
IMPORTING
commit_count_for_delete_prg = commit_cnt
maintain_index = index_flag.

* loop to get the next data object from the archive file(s)
CLEAR object_cnt.
DO.
ADD 1 TO object_cnt.
CALL FUNCTION ARCHIVE_GET_NEXT_OBJECT
EXPORTING
archive_handle = handle
IMPORTING
object_id = object_id
object_offset = offset
archive_name = arkey
EXCEPTIONS
end_of_file = 01.
SAP AG 2002

SAP AG BC670 4-40


([DPSOH5HSRUW6%22.' 

IF sy-subrc = 1.
EXIT.
ENDIF.

* build an index to allow for random access to data objects


*** This index is optional. Try to use the Archive Information
*** System SAP AS instead.

IF index_flag IS INITIAL.
* no index is to be built according to customizing
ELSEIF testrun IS INITIAL.
MOVE: object_id TO index_tab-obj_id,
arkey TO index_tab-archivekey,
offset TO index_tab-obj_offset.
APPEND index_tab.
PERFORM save_index_tab ON COMMIT.
ENDIF.

SAP AG 2002

SAP AG BC670 4-41


([DPSOH5HSRUW6%22.' 

* loop to get data records from ADKs data container


DO.
CALL FUNCTION ARCHIVE_GET_NEXT_RECORD
EXPORTING
archive_handle = handle
IMPORTING
record = buffer-segment
record_structure = buffer-rname
EXCEPTIONS
end_of_object = 01.
IF sy-subrc = 1.
EXIT.
ENDIF.
* keep data records in mind; take their structure into account
CASE buffer-rname.
WHEN SBOOK.
MOVE buffer-segment TO sbook_wa.
APPEND sbook_wa TO sbook_itab. " will be deleted in db
* when ... " further structures
ENDCASE.
ENDDO.
SAP AG 2002

SAP AG BC670 4-42


([DPSOH5HSRUW6%22.' 

IF testrun IS INITIAL AND object_cnt = commit_cnt.


PERFORM delete_from_table. " actual delete from database
CLEAR object_cnt. " restart counting up to
ENDIF. " value of commit counter
ENDDO.

IF testrun IS INITIAL AND object_cnt > 1.


PERFORM delete_from_table. " deleting last package
ENDIF.

* provide statistics
tabfield-tabname = .
tabfield-count = sum_objects.
APPEND tabfield TO stat_itab.
tabfield-tabname = SBOOK.
APPEND tabfield TO stat_itab.
CALL FUNCTION ARCHIVE_GIVE_STATISTICS
EXPORTING
archive_handle = handle
TABLES
table = stat_itab.
SAP AG 2002

SAP AG BC670 4-43


([DPSOH5HSRUW6%22.' 

* write statistics
CALL FUNCTION ARCHIVE_WRITE_STATISTICS
EXPORTING
archive_handle = handle
statistics_only_per_file = X.

* get all processed files for update of index status


CALL FUNCTION ARCHIVE_GET_ARCHIVE_FILES
EXPORTING
archive_handle = handle
TABLES
archive_files = sel_files_itab.

* close the archive session


CALL FUNCTION ARCHIVE_CLOSE_FILE
EXPORTING
archive_handle = handle.

SAP AG 2002

SAP AG BC670 4-44


([DPSOH5HSRUW6%22.' 

* set status "index created" in SARA administration


IF index_flag IS INITIAL.
* no index has been built according to customizing
ELSEIF testrun IS INITIAL.
CALL FUNCTION ARCHIVE_ADMIN_SET_STATUS
EXPORTING
files_are_converted =
index_created = X
TABLES
archive_files = sel_files_itab.
ENDIF.

*---------------------------------------------------------------------*
* FORM DELETE_FROM_TABLE *
*---------------------------------------------------------------------*
* global: sbook_itab, sum_objects
*---------------------------------------------------------------------*
FORM delete_from_table.
DATA: tabcount TYPE i VALUE 0.
DELETE sbook FROM TABLE sbook_itab. " delete job restartable
COMMIT WORK.

SAP AG 2002

n Commit Work then triggers the actual deletion of data from the archiving classes.
The delete routine belonging to the archiving classes is called via a Perform ... On Commit, that is
the actual deletion only takes place at a database commit.
n The collection of data belonging to an archiving class which is to be deleted, occurs via a call of
ARCHIVE_DELETE_OBJECT_DATA. This function module is started once per call of
ARCHIVE_GET_NEXT_OBJECT .

SAP AG BC670 4-45


([DPSOH5HSRUW6%22.' 

DESCRIBE TABLE sbook_itab LINES tabcount.


sum_objects = sum_objects + tabcount.
REFRESH sbook_itab.
ENDFORM. " DELETE_FROM_TABLE

*---------------------------------------------------------------------*
* Form SAVE_INDEX_TAB *
*---------------------------------------------------------------------*
* global: index_tab *
*---------------------------------------------------------------------*
FORM save_index_tab.
DELETE arch_idx_s FROM TABLE index_tab.
INSERT arch_idx_s FROM TABLE index_tab.
REFRESH index_tab.
ENDFORM. " SAVE_INDEX_TAB

SAP AG 2002

SAP AG BC670 4-46


$'.$3,$GGLWLRQDO&XVWRPHU5HOHYDQW)0V

l $UFKLYHBJHWBLQIRUPDWLRQ

l $UFKLYHBRSHQBIRUBPRYH

SAP AG 1999
2002

n Archive_get_information
This function module enables you to determine the latest information about an archive handle. This
includes the question of when the archive files were written, what their underlying structure is, and
so on.
This data is important, for example, for tailoring your own reporting programs if a table s data
structure has changed.
n Archive_open_for_move
This function module enables you to read archive files in order to write data objects from these
archive files to new archive files. You must call it if you want to reload individual data objects from
archive files to the R/3 System.

SAP AG BC670 4-47


6WDQGDUG7DEOHVDQG&XVWRPHUVSHFLILF7DEOHV

6WDQGDUGWDEOH &RPELQDWLRQRI &XVWRPHUVSHFLILF<=


ZLWK VWDQGDUGWDEOHV WDEOHVZKLFKORJLFDOO\
FXVWRPHUVSHFLILF DQGFXVWRPHUVSHFLILF EHORQJWR5VWDQGDUG
DSSHQGVWUXFWXUH <=WDEOHV WDEOHV

FXVWRPHU
VSHFLILF
$ =WDEOH
3 FXVWRPHU =&
VWDQGDUG VWDQGDUG VWDQGDUG
3 VSHFLILF LQGHSHQGHQW
WDEOH WDEOH WDEOH
( =WDEOH RI
$ % &
1 === VWDQGDUG
' WDEOH&

([WHQVLRQQRW
&UHDWHFXVWRPHUVSHFLILF ([WHQVLRQQHFHVVDU\
DOZD\VQHFHVVDU\
DUFKLYLQJREMHFW FRQWDFW\RXU6$3
FRQVXOWDQW

SAP AG 2002

n 1RWH
In R/3 standard tables, you are only allowed to delete using R/3 standard programs!

SAP AG BC670 4-48


3URFHGXUHIRU([WHQGLQJD6WDQGDUG$UFKLYLQJ
2EMHFW

l /LVWWKHPRGLILFDWLRQVWKDWKDYHEHHQFDUULHGRXW
l $QDO\VHWKHPRGLILFDWLRQVWRVHHZKHWKHUFKDQJHVDUH
UHTXLUHGWRH[LVWLQJDUFKLYLQJREMHFWVRUDUFKLYLQJFODVVHV
l &DWHJRUL]HWKHFXVWRPHUVSHFLILFWDEOHVZLWKWKHKHOSRIWKH
GDWDPRGHOXVHG
ZKHUHGRHVWKHWDEOHVLWLQWKHGDWDPRGHO
l &KHFNZKHWKHUGHSHQGHQFLHVRQRWKHUDUFKLYLQJREMHFWV
KDYHEHHQFUHDWHG

SAP AG 1999
2002

n 1RWH:
To ensure that the standard archiving progams continue to function correctly, the extensions must be
carried out in the customer namespace in a new progam.
n 1RWH:
When extending a standard archiving object, ensure that the performance of the standard archiving
progam is not reduced.

SAP AG BC670 4-49


([WHQVLRQ'HSHQGHQFLHV

l 6WDUWLQJSRLQW
New dependencies by introducing new documents
New dependencies due to customer-specific requirements

l 3RVVLEOHFRQVHTXHQFHV
Maintain new checks in existing archiving programs:
User exits possible for SD archiving objects
Update the network graphic for documentation

SAP AG 2002

n Some industry-specific requirements call for modifications to the transport process. For example, in
IS-OIL, it was necessary, to introduce a new delivery-related document. Delivery documents must
not be archived until the new subsequent document has been closed.
n User exits in SD are discussed in course BC660.

SAP AG BC670 4-50


([WHQVLRQ$SSHQG6WUXFWXUHLQ6WDQGDUG7DEOH

l 6WDUWLQJSRLQW
New fields were inserted into the standard tables using the
Append/Include technique

l &RQVHTXHQFHV
As long as the archiving object or archiving classes write the
original table entries, no changes are required to write or delete
programs.
Analysis programs must be adjusted in case the fields have to be
displayed.
Check whether dependencies have arisen.

SAP AG 2002

n Check the archiving program to see whether structures are written instead of the original tables. If so,
the archiving program transfers the table entries to these structures. In this case, the archiving
program and the structures must be adjusted in line with the changed data.

SAP AG BC670 4-51


([WHQVLRQ1HZ7DEOHVIRU6WDQGDUG'RFXPHQWV

l 6WDUWLQJSRLQW
Information on standard documents is stored in customer-specific
tables

l &RQVHTXHQFHV
Use transaction AOBJ to extend the archiving object structure to
include customer-specific tables
Copy and adjust the write- and delete progams
Copy and adjust the reporting progam (optional)
Monitor potential new dependencies

SAP AG 2002

SAP AG BC670 4-52


([DPSOH([WHQVLRQWR00B0$7%(/ 

l $GGRQ,62,/

)RUJRRGVPRYHPHQWVLQWKHRLOLQGXVWU\\RXPXVWHQWHU
WHPSHUDWXUHDQGGHQVLW\GDWDLQWKHGDWDEDVHIRUHYHU\
PDWHULDOLWHP
7KLVGDWDLVVWRUHGLQLWVRZQWDEOHZKLFKPXVWEHDUFKLYHG
DQGGHOHWHGWRJHWKHUZLWKWKHVWDQGDUGWDEOHV0.3)DQG
06(*

SAP AG 1999
2002

SAP AG BC670 4-53


([DPSOH([WHQVLRQWR00B0$7%(/ 

l 6WDQGDUGGDWDPRGHO

0.3)
!06(*

l ([WHQGHGGDWDPRGHO,62,/

0.3)
!06(*
!06(*2
!06(*2

SAP AG 2002

n In the above data model of MM-data, there is also NAST data. Within the context of data archiving,
this data is deleted only.

SAP AG BC670 4-54


([DPSOH([WHQVLRQWR00B0$7%(/ 

l $QDO\]HGHSHQGHQFLHV

In contrast to the standard system, the material document may still


be required in certain situations (not mseg-oiexgnum) for a
process called netting, which follows billing/invoice verification. In
the section oil_put_oiaqb, the system checks whether this process
has been completed
Cross-application dependencies to other archiving objects are not
given

SAP AG 2002
1999

SAP AG BC670 4-55


([DPSOH([WHQVLRQWR00B0$7%(/ 

l $QDO\]HWKHVWDQGDUGDUFKLYLQJSURJUDPZLWKUHIHUHQFHWR
IORZORJLFDQGSHUIRUPDQFHRSWLPL]DWLRQ
3URJUDPVHDUFKHVIRUWKHRSWLPXPVWUDWHJ\WRVHOHFWWKH
GRFXPHQWVWREHDUFKLYHG
VHOHFWLRQYLDKHDGHURULWHPGDWD
,IWKHVHOHFWLRQXVHVLWHPGDWDWKHV\VWHPXVHVDGDWDEDVH
YLHZ
3URJUDPZRUNVZLWKG\QDPLF64/
3URJUDPUHGHWHUPLQHVWKHVHOHFWLRQFULWHULDWRNHHSWKHGDWD
IRUVHOHFWLRQWRDPLQLPXP
3URJUDPZRUNVZLWKFHQWUDODXWKRUL]DWLRQFKHFNLQJWRUHVWULFW
WKHDPRXQWRIGDWDWREHVHOHFWHGDQGSURFHVVHG
3URJUDPZULWHVKHDGHUGDWDLQGLYLGXDOO\ZLWK
$5&+,9(B387B5(&25'DQGDOOLWHPGDWDIURPDGRFXPHQW
ZLWK$5&+,9(B387B7$%/(

SAP AG 1999
2002

n 1RWH: From a check logic viewpoint, MM_MATBEL should be seen as a simply structured
archiving object.

SAP AG BC670 4-56


([DPSOH([WHQVLRQWR00B0$7%(/ 

l $GMXVWPHQWVWRVWDQGDUGDUFKLYLQJSURJUDP

,QVHUWUHTXLUHGGDWDGHILQLWLRQ
,QVHUWSURFHVVLQJORJIRUQHZGDWD
,QVHUWVHOHFWLRQRIQHZGDWD
,QVHUWDUFKLYDELOLW\FKHFNV
,QVHUWWKHZULWLQJRIWDEOHUHFRUGVLQWKHDUFKLYHILOHVDIWHUWKH
DVVLJQHGWDEOHVKDYHEHHQZULWWHQLQWKHVWDQGDUGV\VWHP

SAP AG 1999
2002

SAP AG BC670 4-57


([DPSOH([WHQVLRQWR00B0$7%(/ 

l $GMXVWPHQWVWRVWDQGDUGGHOHWHSURJUDP
,QVHUWUHTXLUHGGDWDGHFODUDWLRQ
)LOOWKHLQWHUQDOWDEOHVIRUQHZGDWDDIWHUGDWDKDVEHHQUHDG
IURPWKHDUFKLYHILOH V
w 3URJUDPPLQJVLPLODUWRVWDQGDUGWDEOHSURFHVVLQJ
w 7KHQHZSURJDPFRGHLVLQVHUWHGEHKLQGWKHSURFHVVLQJRI
WKHPDVWHUWDEOH
,QVHUWDGHOHWHVHTXHQFHIRUWKHQHZGDWD
w 3URJUDPPLQJVLPLODUWRVWDQGDUGWDEOHSURFHVVLQJ
w 7KHQHZSURJDPFRGHLVLQVHUWHGEHKLQGWKHSURFHVVLQJRI
WKHPDVWHUWDEOH

SAP AG 1999
2002

n In some cases, data has to be deleted only. Such data is not transferred to the archive file, but simply
deleted from the database. An example of this is the message control data for MM and SD
documents.

SAP AG BC670 4-58


([WHQVLRQ6XPPDU\ 

l $GMXVWLQJWKHDUFKLYLQJSURJUDPV

&RS\WKHVWDQGDUGSURJUDPLQWKHFXVWRPHUQDPHVSDFH
$QDO\]HWKHDUFKLYLQJSURJUDPFDUHIXOO\
'HWHUPLQHWRZKLFKDOUHDG\DUFKLYHGWDEOHWKHQHZWDEOH
ORJLFDOO\EHORQJV
'HWHUPLQHZKHUHLQWKHDUFKLYLQJSURJUDPWKHPDVWHUWDEOHLV
SURFHVVHG
([WHQGWKHGHILQLWLRQRIWKHUHTXLUHGGDWDVWUXFWXUHV
([WHQGWKHVHOHFWLRQRIGDWDIURPWKH=WDEOH
,IQHFHVVDU\H[WHQGWKHDUFKLYDELOLW\FKHFNV
([WHQGWKHWUDQVIHURIGDWDIURPWKH=WDEOHWR$'.

SAP AG 1999
2002

n 1RWH A careful analysis of the archiving program is essential, because the programs are generally
optimized with regard to performance.
To avoid problems in future, check that the performance of the write and delete programs is still
satisfactory after the new tables have been added.
n User exits are not offered so that performance can be further optimized and new structures can be
included in the standard system at any time.
n New developments may lead to future changes in the underlying program logic of the standard
archiving objects. For example, the SD document programs have already been redesigned.

SAP AG BC670 4-59


([WHQVLRQ&RQFOXVLRQ 

l $GMXVWLQJWKHGHOHWHSURJUDP

'HWHUPLQHWKHSRLQWDWZKLFKWKHGDWDUHFRUGVDUHWREH
GHOHWHG
w &$6(VWUXFWXUHDIWHUFDOOLQJWKHIXQFWLRQPRGXOH
$5&+,9(B*(7B1(;7B5(&25'
w /LVWRIGHOHWHFDOOV

([WHQGWKHGHOHWHFDOOVWRLQFOXGH\RXURZQWDEOH V

SAP AG 1999
2002

SAP AG BC670 4-60


([WHQVLRQ&RQFOXVLRQ 

l $GMXVWLQJDUHSRUWLQJSURJUDP RSWLRQDO

([WHQGLQJWKHRXWSXWVWUXFWXUH
([WHQGLQJWKHRXWSXWRIWKHGDWD

SAP AG 1999
2002

SAP AG BC670 4-61


([WHQVLRQ(YDOXDWLRQ

l :HUHFRPPHQGWKDW\RXGRQRWH[WHQGDVWDQGDUG
DUFKLYLQJREMHFW
l ,IWKLVLVXQDYRLGDEOHFRQWDFW\RXU6$3FRQVXOWDQW
l 5HFRPPHQGHGSURFHGXUH
8VHDFXVWRPHUVSHFLILFDUFKLYLQJREMHFWWRDUFKLYH\RXURZQ
<RU=WDEOHVWKDWEHORQJWRDVWDQGDUGDUFKLYLQJREMHFW
:ULWHUHSRUWVWKDWUHDGDQGPHUJHWKHDUFKLYHILOHVEHORQJLQJ
WRWKHVWDQGDUGREMHFWDQGWRFXVWRPHUVSHFLILFREMHFW

SAP AG 1999
2002

n After modifying a standard archiving object, you should check whether the same level of throughput
performance can be maintained as before you made the modification.

SAP AG BC670 4-62


'DWD$UFKLYLQJ3URJUDPPLQJ/RJLF&RQFOXVLRQ

<RXQRZNQRZ
l 7KHORJLFRIDQDUFKLYLQJSURJDP
l 7KHORJLFRIDGHOHWHSURJDP
l 3URFHGXUHIRUFUHDWLQJDQHZ
DUFKLYLQJREMHFW
l 3URFHGXUHIRUH[WHQGLQJDQ
DUFKLYLQJREMHFW

SAP AG 2002

SAP AG BC670 4-63


([HUFLVHV

8QLW3URJUDP/RJLFLQ'DWD$UFKLYLQJ
7RSLF$UFKLYLQJ67,&.(7

At the conclusion of this exercise, you will be able to:


Write data from the customer table STICKET to an archiving file

Your enterprise has the customer table STICKET.


This table has been identified as a critical table, and is to be reduced in
size.
First, you must write an archiving program.

1-1 Create an archiving program for STICKET. Use program SBOOKA as template.
Program name: ZBCSTICKxxA. XX stands for your group number.
Type: Executable program
Status: Test program
Application: Basis

1-1-1 Create an archiving program that archives records from the table STICKET.

Selection parameters: Airline (carrid) and booking number (bookid).

1-1-2 Configure your program so that the user can decide


- Whether to create an archive file
- Whether to use the test run variant or live run variant if the deletion program is
to be run immediately.

1-1-3 Write an archive file only if the parameter has been set as follows.
Sequence of function modules:
Open archive file for write job
Initialize new data object
Transfer data record
Save data object

1-1-4 Ensure that the statistics are written with the standard statistics module before
you close the archive file.

SAP AG BC670 4-64


2-1 Create deletion program for STICKET. Use the program SBOOKD as a template.
Program name: ZBCSTICKxxD. xx stands for your group number.
Type: Executable program
Status: Test program
Application: Basis

2-1-1 Enter a parameter that determines whether the deletion run is to be a test run, or
whether data is really to be deleted.

2-1-2 Sequence of function modules:


Retrieve file for deletion
Read Customizing data (Commit counter/Start deletion job
Loop 1: Read archiving record object from data container
Loop 2: Copy record in buffer and run deletion routine if the deletion indicator
is set.
Output statistics
Close file

2-1-3 No index is to be built.

SAP AG BC670 4-65


6ROXWLRQV

8QLW'DWD$UFKLYLQJ3URJUDPPLQJ/RJLF
7RSLF&XVWRPL]LQJDQG7HVWLQJ%&67,&.[[

At the conclusion of this unit, you will be able to:


Create an archiving object in transaction AOBJ
Test a new archiving object

The customer-specific table STICKET exists in your organization. This


table is recognized as being a critical table. The size of this table needs to
be reduced.
After you have written the necessary programs, you must create the
archiving object in your system.

1-1 Create the archiving object ZBCSTICKxx. (XX represents your group number.)

1-1-1 Create the archiving object in transaction AOBJ.


Specify BC as the work area and use input help to select application
component Basis.

1-1-2 Enter your archiving and delete programs

1-1-3 Publicize the structure definitions: You are processing the table STICKET

1-1-4 Maintain the Customizing settings:

1-1-4-1 Your logical filename should link to the path Archive_data_file

1-1-4-2 Enter the file size 100 MB and leave the number of objects blank

1-1-4-3 After data archiving, the file is not going to be stored in an external
optical archive.

1-1-4-4 Do not start the delete program immediately, but rather manually.
Create 2 delete program variants: TESTxx for a test delete run and
PRODxx for the production delete run

SAP AG BC670 4-66


2-1 Start an archiving and delete run in transaction SARA for your newly created archiving
object.

2-2 Additional task


Display the archived data via SAP AS

2-2-1 In the Archive Information System, create an archive information structure for
your newly created archiving object.

2-2-2 Activate your archive information structure.

Fill your archive information structure with the data from your archiving
session.

Display the data in the Archive Explorer.

SAP AG BC670 4-67


6ROXWLRQV

8QLW'DWD$UFKLYLQJ3URJUDPPLQJ/RJLF
7RSLF$UFKLYLQJ67,&.(7

1-1 Tools, ABAP Workbench, Development, ABAP Editor

Enter SBOOKA, Button Copy


Enter ZBCSTICKxxA. (xx represents your group number.)
Copy all available parts of the program
Save as local object

Exchange table SBOOK for STICKET


Exchange the archiving object BC_SBOOK for ZBCSTICKxx
Note: Pay attention to upper/lower case

1-1-1 to 1-1-4 see example solution: Program ZZBC670_Archiving

2-1 Tools, ABAP Workbench, Development, ABAP Editor

Enter SBOOKD, Copy button.


Enter ZBCSTICKxxD. (xx represents your group number.)
Copy all available parts of the program
Save as local object

Exchange table SBOOK for STICKET


Exchange archiving object BC_SBOOK for ZBCSTICKxx
Note: Pay attention to upper/lower case

2-1-1 to 2-1-3 see example solution: Program ZZBC670_Delete

SAP AG BC670 4-68


5(3257==%&BDUFKLYLHUHQ

GDWDGHFODUDWLRQ
7$%/(667,&.(7
'$7$%87721  7<3(&
&5($7(  7<3(&9$/8(
;

12B'(/(7(  7<3(&9$/8(
;

+$1'/(/,.(6<7$%,;
67,&.(7B,7$%7<3(7$%/(2)67,&.(7:,7++($'(5/,1(

VHOHFWLRQFULWHULDDQGSDUDPHWHUV
6(/(&7,216&5((1%(*,12)%/2&.$5&+B%22.,1*:,7+)5$0(7,7/(7(;7
6(/(&7237,2162B&$55,')2567,&.(7&$55,'
'()$8/7
/+

2B%22.,')2567,&.(7%22.,'
6(/(&7,216&5((1(1'2)%/2&.$5&+B%22.,1*

6(/(&7,216&5((1%(*,12)%/2&.$5&+B&21752/:,7+)5$0(7,7/(7(;7
3$5$0(7(5612B),/(/,.(%877215$',2%87721*52835$',
'(/B7(67/,.(%877215$',2%87721*52835$','()$8/7
;

'(/B352'/,.(%877215$',2%87721*52835$',
6(/(&7,216&5((1(1'2)%/2&.$5&+B&21752/

3$5$0(7(56&200(1767<3($'0,B7(;7/2:(5&$6(
'()$8/7
7KLVLVWHVWGDWDIRUDUFKLYLQJZLWK%&B6%22.
 

FUHDWHFXUVRUIRUGDWDVHOHFWLRQ
'$7$'%B&856257<3(&85625
23(1&85625:,7++2/''%B&85625)25
6(/(&7 )52067,&.(7
:+(5(&$55,',12B&$55,'$1'
%22.,',12B%22.,'

EXLOG$'.SDUDPHWHUVIURPFKRVHQEXWWRQ
,)12B),/( 
;
&5($7( 

12B'(/(7( 

(1',)
,)'(/B7(67 
;
&5($7( 
;
12B'(/(7( 
;
(1',)
,)'(/B352' 
;
&5($7( 
;
12B'(/(7( 

(1',)

RSHQDQHZDUFKLYHVHVVLRQWRDUFKLYHGDWD
&$//)81&7,21
$5&+,9(B23(1B)25B:5,7(

(;3257,1*
&$//B'(/(7(B-2%B,1B7(67B02'( 12B'(/(7(
&200(176 &200(176
&5($7(B$5&+,9(B),/( &5($7(
2%-(&7 
=%&67,&.

SAP AG BC670 4-69


,03257,1*
$5&+,9(B+$1'/( +$1'/(
'2
JHWQH[WUHFRUGV XSWR
)(7&+1(;7&85625'%B&85625,1727$%/(67,&.(7B,7$%3$&.$*(6,=(
,)6<68%5&1(
(;,7
(1',)

LQLWLDOL]HDQHZGDWDREMHFW
&$//)81&7,21
$5&+,9(B1(:B2%-(&7

(;3257,1*
$5&+,9(B+$1'/( +$1'/(

SXWGDWDUHFRUGVLQWR$'.
VGDWDFRQWDLQHU
&$//)81&7,21
$5&+,9(B387B7$%/(

(;3257,1*
$5&+,9(B+$1'/( +$1'/(
5(&25'B6758&785( 
67,&.(7

7$%/(6
7$%/( 67,&.(7B,7$%

ZULWHGDWDREMHFWLQWRWKHDUFKLYHILOH
&$//)81&7,21
$5&+,9(B6$9(B2%-(&7

(;3257,1*
$5&+,9(B+$1'/( +$1'/(
(1''2

FORVHGDWDEDVHFXUVRU
&/26(&85625'%B&85625

FUHDWHWKHGHIDXOWVSRROOLVW
&$//)81&7,21
$5&+,9(B:5,7(B67$7,67,&6

(;3257,1*
$5&+,9(B+$1'/( +$1'/(

FORVHWKHDUFKLYHVHVVLRQ
&$//)81&7,21
$5&+,9(B&/26(B),/(

(;3257,1*
$5&+,9(B+$1'/( +$1'/(

SAP AG BC670 4-70


5(3257==%&B/2(6&+(1

GDWDGHFODUDWLRQ
&2167$176
2%-(&7/,.($5&+B2%-2%-(&79$/8(
=%&67,&.

'$7$
+$1'/(/,.(6<7$%,;
%8))(57<3($5&B%8))(5
67,&.(7B:$/,.(67,&.(7
67,&.(7B,7$%7<3(7$%/(2)67,&.(7
5(&25'B,7$%7<3(7$%/(2)67,&.(7
&200,7B&17/,.($5&+B865$5&+B&20,7
2%-(&7B&177<3(,
680B2%-(&767<3(,9$/8(
67$7B,7$%7<3(7$%/(2)$5&+B67$7
7$%),(/'/,.($5&+B67$7

3$5$0(7(567(67581'()$8/7
;
$6&+(&.%2;GRQRWGHOHWH
IURPGDWDEDVH
RSHQDQHZDUFKLYHVHVVLRQWRGHOHWHGDWD
&$//)81&7,21
$5&+,9(B23(1B)25B'(/(7(

(;3257,1*
2%-(&7 2%-(&7
7(67B02'( 7(67581
,03257,1*
$5&+,9(B+$1'/( +$1'/(
(;&(37,216
27+(56 
,)6<68%5&!
:5,7(
1RILOHFDQEHDFFHVVHG
 
(;,7
(1',)

JHWFXVWRPL]LQJGDWDIURPWKHDUFKLYHREMHFW
&$//)81&7,21
$5&+,9(B*(7B&86720,=,1*B'$7$

(;3257,1*
2%-(&7 2%-(&7
,03257,1*
&200,7B&2817B)25B'(/(7(B35* &200,7B&17

ORRSWRJHWWKHQH[WGDWDREMHFWIURPWKHDUFKLYHILOH V
&/($52%-(&7B&17
'2
$''722%-(&7B&17
&$//)81&7,21
$5&+,9(B*(7B1(;7B2%-(&7

SAP AG BC670 4-71


(;3257,1*
$5&+,9(B+$1'/( +$1'/(
(;&(37,216
(1'B2)B),/( 
,)6<68%5& 
(;,7
(1',)

&$//)81&7,21
$5&+,9(B*(7B7$%/(

(;3257,1*
$5&+,9(B+$1'/( +$1'/(
5(&25'B6758&785( 
67,&.(7

$//B5(&25'6B2)B2%-(&7 
;

7$%/(6
7$%/( 5(&25'B,7$%

$33(1'/,1(62)5(&25'B,7$%7267,&.(7B,7$%

,)7(67581,6,1,7,$/$1'2%-(&7B&17 &200,7B&17
3(5)250'(/(7(B)520B7$%/(DFWXDOGHOHWHIURPGDWDEDVH
&/($52%-(&7B&17UHVWDUWFRXQWLQJXSWR
(1',)YDOXHRIFRPPLWFRXQWHU
(1''2

,)7(67581,6,1,7,$/$1'2%-(&7B&17!
3(5)250'(/(7(B)520B7$%/(GHOHWLQJODVWSDFNDJH
(1',)

SURYLGHVWDWLVWLFV
7$%),(/'7$%1$0( 


7$%),(/'&2817 680B2%-(&76
$33(1'7$%),(/'7267$7B,7$%
7$%),(/'7$%1$0( 
67,&.(7

$33(1'7$%),(/'7267$7B,7$%
&$//)81&7,21
$5&+,9(B*,9(B67$7,67,&6

(;3257,1*
$5&+,9(B+$1'/( +$1'/(
7$%/(6
7$%/( 67$7B,7$%

ZULWHVWDWLVWLFV
&$//)81&7,21
$5&+,9(B:5,7(B67$7,67,&6

(;3257,1*
$5&+,9(B+$1'/( +$1'/(
67$7,67,&6B21/<B3(5B),/( 
;


SAP AG BC670 4-72


FORVHWKHDUFKLYHVHVVLRQ
&$//)81&7,21
$5&+,9(B&/26(B),/(

(;3257,1*
$5&+,9(B+$1'/( +$1'/(


)250'(/(7(B)520B7$%/(

JOREDO67,&.(7BLWDEVXPBREMHFWV

)250'(/(7(B)520B7$%/(
'$7$7$%&28177<3(,9$/8(
'(/(7(67,&.(7)5207$%/(67,&.(7B,7$%GHOHWHMREUHVWDUWDEOH
&200,7:25.
'(6&5,%(7$%/(67,&.(7B,7$%/,1(67$%&2817
680B2%-(&76 680B2%-(&767$%&2817
5()5(6+67,&.(7B,7$%
(1')250'(/(7(B)520B7$%/(

SAP AG BC670 4-73


8QLW'DWD$UFKLYLQJ3URJUDPPLQJ/RJLF
7RSLF&XVWRPL]LQJDQGWHVWLQJWKHDUFKLYLQJREMHFW

1-1 Create archiving object ZBCSTICKxx for STICKET.

1-1-1 Call transaction AOBJ


Button <New entries >
Object name: ZBCSTICKxx / Text: Archiving object for STICKET/Group xx

1-1-2 Write program: ZBCSTICKxxA / Delete program: ZBCSTICKxxD


Save archiving object
Return to initial screen

1-1-3 Flag the archiving object ZBCSTICKxx


Double click on the dialog structure structure definition
Enter STICKET in the field Segment
Save the archiving object
Return to initial screen
1-1-4 Flag the archiving object ZBCSTICKxx
Double click on the dialog structure Customizing settings

1-1-4-1 Enter logical filename: Archive_data_file

1-1-4-2 Enter Size of archive file: Size in MB 100

1-1-4-3 No entry under connection to archive system

1-1-4-4 Entry under delete program settings: Mark Not scheduled


Entry for test run variants: TESTxx
Entry for production run variants: PRODxx.
For both variants: Button <Variants>
Supply the variants with suitable deletion indicator: Test X

Productive: no entry

SAP AG BC670 4-74


2-1 Tools, administration, management, Data Archiving.
Enter archiving object ZBCSTICKxx Test archiving progam:
Button <Archiving>
Maintain variant groupxx; the course instructor will tell you which data is to be
archived
Return to initial screen Create archive files

Button <Start date>


Choose: Immediately
Save and return to initial screen Create archive files

Button <Spoolparameter>
Printer: LP01
Hardware type: printer
Save and return to initial screen Create archive files

Button <execute>
The system will create the archiving jobs.
Monitor jobs with button <Job overview>
Return to screen: Archive management: entry screen

Test delete progam:


Button <Delete>
Start data immediately and maintain spool parameter with LP01 as above

Button Archive selection


From the popup which appears, select your own archiving session
Save
Button <execute>
The system will create the delete jobs.
Monitor jobs with button <Job overview >
Return to screen: Archive management: entry screen

2-2 Additional exercise: Displaying archived data using SAP AS

2-2-1 Create archive information structure for object ZBCSTICKXX.


Button<Info system> in transaction SARA
Button <Customizing>
Entry name TASBCSTICKXX
Button<Create>
Field catalog: BCSTICKXX
Transfer fields by saving
Button <Activate>
Return to initial screen in Archive Information System
Button <Status per Infostructure>
Select Infostructure and Button <Build structure>
Button <Archive Explorer>
Enter ZBCSTICKXX. Infostructure is selected by the system
Display data

SAP AG BC670 4-75


6HTXHQWLDO5HDG3URJUDPV

&RQWHQWV
l /RJLFRIVHTXHQWLDOUHDGSURJDPV
l /RJLFRIUHDGLQJIURPDUFKLYLQJFODVVHV
l &UHDWLQJDVHTXHQWLDOUHDGSURJUDPZLWKDQGZLWKRXW
DUFKLYLQJFODVVHV

SAP AG 2002

SAP AG BC670 5-1


6HTXHQWLDO5HDG3URJUDPV8QLW2EMHFWLYHV

$WWKHFRQFOXVLRQRIWKLVXQLW\RXZLOOEHDEOHWR

l &UHDWHDVHTXHQWLDOUHDGSURJUDP
l 'LVSOD\DUFKLYLQJFODVVHVLQDUHDGSURJUDP

SAP AG 1999
2002

SAP AG BC670 5-2


&RXUVH2YHUYLHZ'LDJUDP

&RXUVH2YHUYLHZ

7KH'DWD$UFKLYLQJ3URFHVV

$'.'HYHORSPHQW7RROV

'DWD$UFKLYLQJ3URJUDPPLQJ/RJLF

&XVWRPHU6SHFLILF5HDG3URJUDPV

%XVLQHVV9LHZVLQ6$3$6

$SSHQGL[

SAP AG 2002

SAP AG BC670 5-3


6HTXHQWLDO5HDG3URJUDPV%XVLQHVV6FHQDULR

l <RXKDYHWRFUHDWHFXVWRPHUVSHFLILFUHDG
SURJUDPVIRU\RXURZQDUFKLYLQJREMHFWVDVZHOO
DVIRUVWDQGDUG5DUFKLYLQJREMHFWV
l 7KHSURJUDPPHUVKDYHWROHDUQWKHORJLFRIUHDG
SURJUDPV
l 7KHQHZUHDGSURJUDPVPXVWDOVREHDEOHWRUHDG
DQGGLVSOD\DUFKLYLQJFODVVHV

SAP AG 1999
2002

SAP AG BC670 5-4


2YHUYLHZ$FFHVVWR$UFKLYHG'DWD

l 'LUHFWDFFHVVWRDGRFXPHQWIURPWKHDSSOLFDWLRQ
),B'2&8017DQG00B0$7%(/

l $UFKLYH,QIRUPDWLRQ6\VWHP 6$3$6

l $%$3(YDOXDWLRQUHSRUWV
UHWULHYHGIURPWKHDSSOLFDWLRQ
FXVWRPHUVSHFLILFUHSRUWV

SAP AG 1999
2002

n Single document access from the application is available for FI DOCUMNT, and from Release 4.0,
from MATBEL.
n Programs for reporting archive files are provided by the application and are available in transaction
SARA.

SAP AG BC670 5-5


6HTXHQWLDO5HDG3URJUDPPLQJ/RJLF

l $UFKLYHBRSHQBIRUBUHDG

l $UFKLYHBJHWBQH[WBREMHFW
Archive_get_next_record

l $UFKLYHBFORVHBILOH

SAP AG 1999
2002

n The read logic in delete programs is similar to that in read programs. The function module
ARCHIVE_OPEN_FOR_DELETE is replaced with ARCHIVE_OPEN_FOR_READ.

SAP AG BC670 5-6


$'.$3,$5&+,9(B23(1B)25B5($'

l ,QWHUIDFHSDUDPHWHUH[SRUW
object (archiving object)

l ,QWHUIDFHSDUDPHWHULPSRUW
archive_handle (pointer to the selected archiving sessions)

l )XQFWLRQPRGXOHIXQFWLRQDOLW\
Authority-Check on S_ARCHIVE
Prepares and dsiplays a dialog box that displays all archiving
sessions: The user selects the relevant archiving session.
Creates Archive_handle

SAP AG 2002

n ADK has multi-instance capability.


Each handle addresses an instance. In a program, more than one archive can be read in parallel. The
handle, as it is used in ADK, can be compared to the file handle in the file management system.
n In addition to the S_ARCHIVE authorization check, there may be application-specific authorizations
that should be checked.

SAP AG BC670 5-7


$'.$3,$5&+,9(B*(7B1(;7B2%-(&7

l ,QWHUIDFHSDUDPHWHUH[SRUW
archive_handle (pointer to the selected archiving sessions)

l ,QWHUIDFHSDUDPHWHULPSRUW
object_offset (where is the object in the archive file)
archive_name (key to the archive file)

l )XQFWLRQPRGXOHIXQFWLRQV
Reads the first or next data object and transfers the data
from the archive to ADK.

l ([FHSWLRQ(QGRIILOH

SAP AG 2002

n The function module reads the next data object in the archive file.
n Information such as object_offset and archive_name are necessary if SAP AS is to be able to access
a document directly.
n The information defined here is relevant for direct access to a document using the function module
ARCHIVE_READ_OBJECT (see unit Direct access via SAP AS).
n The function module operates in the same way, regardless of whether it is called from a read, delete
or reload program.

SAP AG BC670 5-8


$'.$3,$5&+,9(B*(7B1(;7B5(&25'

l ,QWHUIDFHSDUDPHWHUH[SRUW
archive_handle (pointer to the selected archiving sessions)

l ,QWHUIDFHSDUDPHWHULPSRUW
record (content of an individual table record in the object)
record_structure (table name, from which record is taken)

l )XQFWLRQPRGXOHIXQFWLRQDOLW\
Retrieves the table records belonging to an object in a buffer
area

l ([FHSWLRQ(QGRIREMHFW

SAP AG 2002

SAP AG BC670 5-9


$'.$3,$5&+,9(B*(7B7$%/( 

l ,QWHUIDFHSDUDPHWHULPSRUW
archive_handle
record_structure
all_records_of_object
automatic_conversion

l ,QWHUIDFH7DEOH
Table
l Function module functions
This function module was developed to simplify the implementation of
the read operation. Several data records are read for the structure that
is specified with record_structure and then stored in an internal table.

SAP AG 2002

n The parameter record_structure transfers the name of the structure or table containing the objects to
be read.
n ALL_RECORDS_OF_OBJECT = ''
In this case, the function module functions in a similar way to the function module
ARCHIVE_GET_NEXT_STRUCT_SPECIF.
All records are simply read sequentially for the specified structure until the structure changes. All
read data records are placed in the internal table TABLE.
Reading continues with ARCHIVE_GET_NEXT_RECORD. This automatically reads the next
unread data record. Similarly, when the function module ARCHIVE_GET_TABLE is called, it reads
from the next unread data record.
n ALL_RECORDS_OF_OBJECT =X
In this case, the function module reads all data records for the specified structure in the whole data
object. The data objects read are stored in table TABLE. It does not matter if between the data
records with the specified structure RECORD_STRUCTURE there are data records with other
structures. All data records for the specified structure are collected in the current data object,
regardless of their place in the current data object.
Further reading is possible with ARCHIVE_GET_NEXT_RECORD. In this case, regardless of the
data records that were read with ARCHIVE_GET_TABLE; the next data record is read from when
ARCHIVE_GET_NEXT_RECORD was called. If ARCHIVE_GET_NEXT_RECORD was not yet
called, the first data record is read.

SAP AG BC670 5-10


&RPSDULVRQ
$5&+,9(B*(7B5(&25'$5&+,9(B*(7B7$%/(

l 5HDGVRQHUHFRUG l 5HDGVDUUD\RIUHFRUGV
l 0RUHFRGLQJUHTXLUHGVLQFH l %\GHIDXOWVXSSOLHVDOOUHFRUGVRI
&$6(TXHU\PXVWEHSURFHVVHG WKHVDPHW\SHWKDWRFFXULQ
VHTXHQFHLQWKH$'.ILOHLQDILOH
l 2SHUDWLRQVLQPDLQPHPRU\
!/HVVFRGLQJ
0RYHGDWDWRZRUNDUHD
!ORZHUVSHUIRUPDQFH l 3HUIRUPDQFHLPSURYHGZLWKPDVV
SURFHVVLQJ

SAP AG 2002

n The parameter DOOUHFRUGV enables all records to be read that belong to a specific type, regardless of
whether they are arranged sequentially in the ADK file or not.
n The records are made available to the read program in the same sequence as they were transferred by
PUT_RECORD or PUT_TABLE.

SAP AG BC670 5-11


$'.$3,$5&+,9(B&/26(B),/(

l ,QWHUIDFHSDUDPHWHUH[SRUW
archive_handle (pointer to the selected archiving sessions)

l )XQFWLRQPRGXOHIXQFWLRQDOLW\
Closes the archive file
Releases the resources of an archive handle

SAP AG 2002

n The archive handle is invalid after the function module is run and cannot be reused. Each additional
operation with this handle triggers the exception WRONG_ACCESS_TO_ARCHIVE .

SAP AG BC670 5-12


6HTXHQWLDO$FFHVV/RJLF 

 
   "! #$%'&()+*,-".

$7DEOH
%7DEOH
&7DEOH
[
/02143 576'89 :46;$8<- /8/6=
$%$3SURJUDP
ZLWKLQWHUQDO ^ 'DWDFRQWDLQHUZLWK
WDEOHV
> 4> K @LCM NOQPSRGOTUP'V9O+WT+P K OX@Y K9Z FXUUHQWGDWDREMHFW
$
^ %
? 4> K @LCM NOQPSRGOTUP'V9O+WT+P K XO @Y 9K Z $UFKLYH
% ILOH
^ % F/021G3 576C8HF6$I-8;6".4I-8 J  960GI
4> K @LCM NOQPSRGOTUP'V9O+WT+P K XO @Y 9K Z &
@ \
&

] /A0B13 576C890
D- 2E6C8<"3%D96

SAP AG 2002

n Step 1: Check whether the named archive file is available. Open files.
n Step 2: The first object is transferred from the archive file to an area in the main memory that
is only accessible to ADK.
n Step 3: From the main memory area, the object is transferred record by record to a variable of
the read program. The contents of the variables of the read program. The contents of the
variables can then be processed as required.
n You can work with ARCHIVE_GET_TABLE as well as with ARCHIVE_GET_NEXT_RECORD.

SAP AG BC670 5-13


6HTXHQWLDO$FFHVV/RJLF 

'HFODUDWLRQ
,QWHUQDOWDEOHV LWDE$LWDE%LWDE&

RSHQH[LVWLQJDUFKLYHILOH V IRUUHDGDFFHVV
$5&+,9(B23(1B)25B5($'
H[SRUWDUFKLYLQJREMHFW
LPSRUWDUFKLYHBKDQGOH

UHDGQH[WREMHFWIURPDUFKLYHILOHLQ$'.GDWDFRQWDLQHU
$5&+,9(B*(7B1(;7B2%-(&7
H[SRUWDUFKLYHBKDQGOH
>LPSRUWDUFKLYHBNH\RIIVHW@ _ `Jab
_ '&(ab
UHDGQH[WUHFRUGIURPFRQWDLQHULQ$%$3UHSRUW d"a- a )e* -fb
_ ` ab a gaS#'a"_ a")_ 
$5&+,9(B*(7B1(;7B5(&25' _ C&cab
H[SRUWDUFKLYHBKDQGOH  --,dCbca" 
LPSRUWUHFRUGBVWUXFWXUHUHFRUG aX#'a"%_ a9)_ 
ZULWHUHFRUGLQOLVW

FORVHDUFKLYHILOHV
$5&+,9(B&/26(B),/(
H[SRUWDUFKLYHBKDQGOH
SAP AG 2002

n The function module ARCHIVE_OPEN_FOR_READ supplies the data sequentially according to the
order in which they are stored in the ADK archive file.
If you want a different order, you must sort them in the main memory.

SAP AG BC670 5-14


([DPSOH5HSRUW6%22.5 

report sbookr.

* data declaration
data: handle like sy-tabix,
buffer like arc_buffer,
sbook_wa like sbook,
number_of_records_read type i.

* open existing archive files


call function ARCHIVE_OPEN_FOR_READ
exporting
object = BC_SBOOK
importing
archive_handle = handle
exceptions
others = 1.

if sy-subrc <> 0.
write: / File open error.
SAP AG 2002

SAP AG BC670 5-15


([DPSOH5HSRUW6%22.5 

exit.
endif.

clear number_of_records_read.
* loop to get the next data object from the archive file(s)
do.
call function ARCHIVE_GET_NEXT_OBJECT
exporting
archive_handle = handle
exceptions
end_of_file = 1
others = 2.
if sy-subrc <> 0.
exit.
endif.

* get data records from the data container


do.

SAP AG 2002

n If the last archive file was read to the end, end of file is triggered.

SAP AG BC670 5-16


([DPSOH5HSRUW6%22.5 

call function ARCHIVE_GET_NEXT_RECORD


exporting
archive_handle = handle
importing
record = buffer-segment
record_structure = buffer-rname
exceptions
end_of_object = 1
others = 2.
if sy-subrc <> 0.
exit.
endif.

add 1 to number_of_records_read.
enddo.
enddo.

SAP AG 2002

n In step 3, the data from the main memory is transferred to a work area in the program using
ARCHIVE_GET_NEXT_RECORD.
The data in one object belongs to various tables.
n The work area in our example is arc_buffer. Arc_buffer is split into buffer_rname, which contains
the name of the table to which the transferred record belongs, and buffer_segment, in which the data
is to be stored.
n Up to Release 4.6C, the segments have a size of 8K.

SAP AG BC670 5-17


([DPSOH5HSRUW6%22.5 

write: / Number of records read:, number_of_records_read.


uline.
write / Last record read:.
case buffer-rname.
when SBOOK.
sbook_wa = buffer-segment.
write: / CARRID :, sbook_wa-carrid,
/ BOOKID :, sbook_wa-bookid,
/ CONNID :, sbook_wa-connid,
/ FLDATE :, sbook_wa-fldate,
/ CUSTOMID :, sbook_wa-customid,
/ ORDER_DATE:, sbook_wa-order_date,
/ ....
* when ...
* If the archive object contained more than one table
* (different buffer-rname), more cases would be needed.
endcase.

SAP AG 2002

n Buffer_segment is an unstructured area from which the data must be transferred to a structured work
area.
How the work area is defined depends on the table record that is currently being read.
n If you are working with the function module ARCHIVE_GET_TABLE, the transfer to a work area is
omitted since the internal table forms the work area and includes the correct records from the table
for an object.

SAP AG BC670 5-18


([DPSOH5HSRUW6%22.5 

* close the archive session


call function ARCHIVE_CLOSE_FILE
exporting
archive_handle = handle.

SAP AG 2002

SAP AG BC670 5-19


3URJUDPPLQJ/RJLF5HDG$UFKLYLQJ&ODVVHV

l $UFKLYHBRSHQBIRUBUHDG

$UFKLYHBJHWBQH[WBREMHFW

w Archive_get_next_record
w CU_CONFIG_READ_ARCHIVE_OBJECT
(Archiving class Variant configuration)
w TEXT_SELECT_ ARCHIVE_OBJECT
(Archiving class TEXT)
w READ_TEXT
(Archiving class TEXT)

l $UFKLYHBFORVHBILOH

SAP AG 1999
2002

n The data that was stored together with an archiving object using the archiving module or an
archiving class cannot be accessed directly by ADK.
n The data is transferred to ADK by the read module in the archiving class.

SAP AG BC670 5-20


:KHUHWR)LQG$UFKLYLQJ&ODVVHVLQ5

l )URP5HOHDVH*0DQDJHPHQWLQ7UDQVDFWLRQ$&/$
l )URP5HOHDVH&5HSRUW&ODVVB%URZVHU

l 1DPLQJ FRQYHQWLRQIRUDUFKLYLQJIXQFWLRQPRGXOH
<archiving class>_archive_object

l 1R QDPLQJFRQYHQWLRQIRUUHDGIXQFWLRQPRGXOH
Possible name
<archiving class>_read_archive_object
Identical to the read function module, which also reads the
database: For example: Read_text for archiving class texts

SAP AG 1999
2002

n Report Class_Table_Search enables the assignment of table and archiving class.


It outputs not only the respective archiving classes but also the relevant function group.
The listed naming conventions are applicable within the function group for the function modules.
n )XQFWLRQPRGXOHIRUUHDGLQJDQDUFKLYLQJFODVV
There is no naming convention for the function module for reading data.
n 3URFHGXUH
1. Specify the function group of the archiving class in transaction ACLA.
2. Determine the function modules of the function group.
3. Determine the read function module using the program documentation.
n )XQFWLRQPRGXOHIRUDUFKLYLQJDQDUFKLYLQJFODVV
To call the function module, choose 7RROV-> $%$3:RUNEHQFK->'HYHORSPHQW->)XQFWLRQ
%XLOGHU
Use the naming convention described above.

SAP AG BC670 5-21


5HDGLQJ$UFKLYLQJ&ODVVHV

l 'HWHUPLQLQJWKHIXQFWLRQJURXSRIWKHDUFKLYLQJFODVV
Release 3.0: Transaction AOBJ
Release 3.1 bis 4.6: Transaction ACLA

l 'HWHUPLQLQJWKHUHDGPRGXOHRIWKHUDFKLYLQJFODVV
Transaction SE80, enter function group
Display function modules
Read documentation

SAP AG 2002

n 1RWH: The Archive_handle must also be included with the function modules for the archiving classes.

SAP AG BC670 5-22


5HDG$UFKLYLQJ&ODVVHV 

l &ODULI\ZKLFKILHOGVDUHWREHGLVSOD\HG
What fields does the used structure contain?

l $QDO\]HWKHDUFKLYHGGDWDXVLQJWKHDUFKLYLQJSURJDP

l 'HWHUPLQHZKHUHGDWDLVWREHUHDG
Logical assignment of contents to the archived tables

l 'HWHUPLQHZKHUHGDWDLVWREHGLVSOD\HG
Logical assignment of contents to the archived tables

SAP AG 2002
1999

n There is a link to the function module documentation which explains the interface.
The function module must be released.
The interfaces can be complex - for example, the archiving class TEXT supplies data for headers and
line items.
n Logical assignment of data: Position texts from orders can, for example, only be read if the relevant
order positions are available in the program.

SAP AG BC670 5-23


5HDG$UFKLYLQJ&ODVVHV 

l %XLOGWKHDUFKLYLQJFODVVLQWRWKHUHOHYDQWUHSRUW

Optional: Create checkbox field Output yes/no.


Create necessary data structures.
Read data using function module.
If necessary:
Collect data in advance using the selection module
Display the data in list format.

SAP AG 1999
2002

n You can use the documentation to determine which data structures are to be created and the interface
for the read module.
n You are advised to make archiving class data available as an option by adding a checkbox, rather
than having to process it in the read program, since, generally, this data is not of interest to all users.

SAP AG BC670 5-24


([DPSOH2XWSXW7H[WV 

* DEFINITION DATA

* Texts / Classes
tables: thead, tline.

types: begin of vb_text,


head like thead,
lines like tline occurs 5,
end of vb_text.

data: l_tname like thead-tdname occurs 0 with header line,


l_text type vb_text occurs 0 with header line,
xvbbk like thead occurs 0 with header line,
xvbbp like thead occurs 0 with header line.

data: xlines like tline.

SAP AG 2002

SAP AG BC670 5-25


([DPSOH2XWSXW7H[WV 

* Select the texts in an internal table after


* Calling the function module ARCHIVE_GET_NEXT_OBJECT
call function 'TEXT_SELECT_ARCHIVE_OBJECT'
exporting
archive_handle = archive_handle
object ='VBBK' text object header
tables
selections = xvbbk.

call function 'TEXT_SELECT_ARCHIVE_OBJECT'


exporting
archive_handle = archive_handle
object ='VBBP' text object line item
tables
selections = xvbbp.
loop at xvbbk.
xvbbp = xvbbk.
append xvbbp.
endloop.

SAP AG 2002

SAP AG BC670 5-26


([DPSOH2XWSXW7H[WV 

* Read the text data and output in list format


if text = X.
format color col_heading intensified.
write: /2 text-130.
format color col_background intensified.
write: / sy-uline(105).
format color col_heading intensified.
write: / sy-vline,
2 text-135,
9 sy-vline,
10 text-140,
105 sy-vline.

SAP AG 2002

SAP AG BC670 5-27


([DPSOH2XWSXW7H[WV 

sort xvbbp.
loop at xvbbp.

call function TEXT_READ_ARCHIVE_OBJECT


exporting
archive_handle = archive_handle
id = xvbbp-tdid
language = xvbbp-tdspras
name = xvbbp-tdname
object = xvbbp-tdobject
client = sy-mandt
importing
header = l_text-head
tables
lines = l_text-lines
exceptions
not_found =1
wrong_access_to_archive = 2
others = 3.

SAP AG 2002

SAP AG BC670 5-28


([DPSOH2XWSXW7H[WV 

format color col_background intensified off.


i = i + 1.
j = i mod 2.
if j = 0.
format color col_normal intensified off.
else.
format color col_normal intensified.
endif.
write: / sy-vline,
2 l_text-head-tdobject,
9 sy-vline.
if not l_text-lines[] is initial.
loop at l_text-lines into xlines.
write: 10 xlines-tdline.
endloop.
write: 105 sy-vline.
endif.
endloop.
write: / sy-uline(105).
endif.
endform.
SAP AG 2002

SAP AG BC670 5-29


$UFKLYHG'DWDDQG'DWDIURPWKH2QOLQH'DWDEDVH

l 6HOHFWLRQDQGRXWSXWRIGDWDIURPWKHRQOLQHGDWDEDVH
l &UHDWHFKHFNER[
'R\RXZDQWWRHGLWDUFKLYHGGDWDLQWKHUHSRUW"

l 2SWLRQDO
h &DOO$'.IXQFWLRQPRGXOHWRUHDGDUFKLYHGGDWD

h 2XWSXWDUFKLYHGGDWD

SAP AG 2002

n You can use check boxes to make processing as sophisticated as you want.

SAP AG BC670 5-30


([HUFLVH5HDG6DOHV$FWLYLWLHV'DWD0RGHO

N ?ij
L"kml+nkSo
pQq l qsrQp
N ? O'tV

N ?j>
u'lSv k p
l+w qsx ySx qz
N ? O'tV

N ? i N N $? |}> N ?9{> > nSn'o%k pmp


@QlS k M+w ~ 2 v k q ke Z~ w r+ k q V > u-T v x pQq u >A{ u'weo x Qq
n ~ w r+ k qp v ~S sv ~+ k pmp l k p m -SQ q km q%p
m-Q-X
N ?{+>\
{ l o q +ko

@9k q o%lSv
+l nen'o%k pUp
 l+l k  k q
SAP AG 2002

SAP AG BC670 5-31


([HUFLVH5HDG6DOHV$FWLYLWLHV7DEOH6WUXFWXUH
7B
VBELN SD document no. of a sales activity in sales support
ERDAT Date on which the record was created
ERZET Entry time
ERNAM Name of person who created the object
AEDAT Last changed on
AEZET Time last change was made
AENAM Name of person who changed object
KTAAR Sales Activity Type for Sales Support
VBTYP SD document category
......
7"
VBELN Sales document number
POSNR Item number of the SD document
PARVW Partner function
KUNNR Customer number
LIFNR Account number of vendor or creditor
PERNR Personnel Number
PARNR Number of contact person
ADRNR Address
ABLAD Unloading point
LAND1 Country key
ADRDA Address indicator

"
VBELV Preceding sales and distribution document
POSNV Preceding item of an SD document
VBELN Subsequent sales and distribution document
POSNN Subsequent item of an SD document
VBTYP_N Document category of subsequent document
RFMNG Referenced quantity in base unit of measure
MEINS Base unit of measure

SAP AG 2002

SAP AG BC670 5-32


6HTXHQWLDO5HDG3URJUDPV8QLW&RQFOXVLRQ

<RXDUHQRZDEOHWR
l &UHDWHVHTXHQWLDOUHDG
SURJUDPVIRUDQDUFKLYLQJ
REMHFW
l 5HSRUWDUFKLYLQJFODVVHV
EHORQJLQJWRDQDUFKLYLQJ
REMHFWLQUHDGSURJUDPV

SAP AG 2002

SAP AG BC670 5-33


([HUFLVHV

8QLW&XVWRPHU6SHFLILF5HSRUWLQJ
7RSLF3URJUDPIRUDUFKLYHGVDOHVDFWLYLWLHV
5HDGZLWKRXWDUFKLYLQJFODVVHV

At the conclusion of these exercises, you will be able to:


Create a program that reads the archived sales activities without using
archiving classes

You have archived sales activities and want to create a reporting program
for them.

1-1 Reporting program for archived sales activities


Copy the report Z00VBKAREAD to your report ZxxVBKAREAD
This report already contains a column header.
The program also contains data definitions for all of the tables used in SD_VBKAD

1-2 8VHWKHOLVWKHDGHUWRIDPLOLDUL]H\RXUVHOIZLWKWKHOLVWOD\RXW
/RRNDWWKH6'B9%.$GDWDPRGHORQWKHODVWSDJHLQWKLVXQLW
+HUH\RXFDQDOVRILQGWKHGHILQLWLRQVWUXFWXUHIRUWDEOHV9%.$9%3$9%)$

1-3 Build the function module ARCHIVE_OPEN_FOR_READ into your program

1-4 Build the function module ARCHIVE_GET_NEXT_OBJECT into your program

SAP AG BC670 5-34


1-5 With the help of the function module ARCHIVE_GET_TABLE, read each table from
SD_VBKA .
Record_structure is respectively: VBKA
VBFA
VBPA

Call the function module 3 times with each new Record_structure. (Export parameter
record_structure)
Process all of the records belonging to an object (export parameter all_record_of_object).
Pass the archive_handle (export parameter archive_handle).

Import a table with the hitlists of the individual table records. The table, to which the
data is transferred, is for VBFA and VBPA the internal table X<original table name>.
For VBKA, the structure YVBKA is imported. YVBKA is then assigned to XVBKA.

1-6 Close the archive file with the function module ARCHIVE_CLOSE_FILE

1-7 Output the data in the format of a layout in a form routine


OUTPUT_DOC_INFO.

1-7-1 Output the data from XVBKA: the required names can be found in the appendix.
document no. starting at position 2
sales activity type starting at position 14
creation date starting at position 21
created by starting at position 40
change date starting at position 56

1-7-2 Loop via XVBPA


partner function starting at position 21
contact person number starting at position 40
address starting at position 47

1-7-3 Loop via XVBFA


document number of subsequent document starting at position 60
type of subsequent document starting at position 71

2-1 Test the program in transaction 6(

3-1 If the data is output correctly, enter your program in transaction AOBJ as a read program
for SD_VBKA and test it again by calling it from transaction SARA.

SAP AG BC670 5-35


8QLW&XVWRPHU6SHFLILF5HSRUWLQJ
7RSLF3URJUDPIRUVDOHVDFWLYLWLHVIRUDVDOHVRUGHU
5HDGZLWKDUFKLYLQJFODVVHV

At the conclusion of these exercises, you will be able to:


Create a program to read archived sales activities using the archiving
class TEXT

You have archived sales activities and want to create a reporting program
for them.

1-1 Output archived sales activities with texts


Copy the program Z00VBKAREADTEXT to your program ZxxVBKAREADTEXT

1-2 Build into the program (in the output form routine after the output of the last table) the
reporting of texts that have been archived with a sales activity.

1-2-1 First collect the texts belonging to an object by calling the function module
SELECT_TEXT_ARCHIVE_OBJECT
Export parameter: Archive_handle

Import parameter: Entries - Text_entries


Table: txt_tab

SAP AG BC670 5-36


1-3 If the call is successful and text_entries > 0
Read the actual texts

Loop via table txt_tab


For each record, call function module TEXT_READ_ARCHIVE_OBJECT

Export parameter: ID: txt_tab.tdid


language: txt_tab-tdspras
name: txt_tab-tdname
object: tst_tab-tdobject
archive_handle

A table (lines) is returned containing the texts found. It is read according to text lines.

1-4 Output the data:

Loop via Text_lines


Text at position 4 (text_lines-tdline)

SAP AG BC670 5-37


6ROXWLRQV

8QLW&XVWRPHU6SHFLILF5HSRUWLQJ
7RSLF3URJUDPIRUDUFKLYHGVDOHVDFWLYLWLHV
5HDGZLWKRXWDUFKLYLQJFODVVHV

1-1 Tools, ABAP Workbench, Development, ABAP Editor

Copy Z00VBKAREAD to ZxxVBKAREAD. (XX represents your group number)

1-2 Information in appendix

1-3 to 1-7 See sample program ZSDVBKAREAD

2-1 Tools, ABAP Workbench, Development, ABAP Editor

Enter ZxxVBKAREAD. (XX represents your group number.)


Execute program

3-1 Call transaction AOBJ

Mark SD_VBKA
Dialog structure read progams
Enter ZxxSDVBKA
Save

SAP AG BC670 5-38


5(3257=6'9%.$5($'


DUFKLYHUHDGSURJUDPIRUVDOHVDFWLYLWHV



7$%/(69%.$9%)$9%3$

'$7$;9%.$/,.(9%.$2&&856:,7++($'(5/,1(
<9%.$/,.(9%.$2&&856:,7++($'(5/,1(

;9%)$/,.(9%)$2&&856:,7++($'(5/,1(
<9%)$/,.(9%)$2&&856:,7++($'(5/,1(

;9%3$/,.(9%3$2&&856:,7++($'(5/,1(

%(*,12);9%.$
,1&/8'(6758&785(9%.$
'$7$(1'2);9%.$

'$7$$5B+$1'/(7<3(6<7$%,;

&$//)81&7,21
$5&+,9(B23(1B)25B5($'

(;3257,1*
2%-(&7 
6'B9%.$

,03257,1*
$5&+,9(B+$1'/( $5B+$1'/(
(;&(37,216
27+(56 

,)6<68%5&!
:5,7(
HUURURSHQILOH

6723
(1',)

:5,7(
'2

&$//)81&7,21
$5&+,9(B*(7B1(;7B2%-(&7

(;3257,1*
$5&+,9(B+$1'/( $5B+$1'/(
(;&(37,216
27+(56 

SAP AG BC670 5-39



,)6<68%5&!
(;,7
(1',)

7DEOH9%.$KDVRQO\RQHUHFRUGIRUHDFKVDOHVDFWLYLW\,QWKHGDWD
VWUXFWXUH\RXILQG9%.$$)7(59%8.7KHUHIRUH\RXPXVWUHDGVHYHUDO
UHFRUGVLP\RXXVHIXQFWLRQPRGXOH
$5&+,9(B*(7B1(;7B5(&25'

7KHSURJUDPSHUIRUPDQFHZLOOEHEHWWHULI\RXXVHIXQFWLRQPRGXOH
$5&+,9(B*(7B7$%/(WRILQGDQGUHDGWKH9%.$UHFRUG

&$//)81&7,21
$5&+,9(B*(7B7$%/(

(;3257,1*
$5&+,9(B+$1'/( $5B+$1'/(
5(&25'B6758&785( 
9%.$

$//B5(&25'6B2)B2%-(&7 
;

7$%/(6
7$%/( <9%.$
(;&(37,216
27+(56 
5($'7$%/(<9%.$,1'(;,172;9%.$

&$//)81&7,21
$5&+,9(B*(7B7$%/(

(;3257,1*
$5&+,9(B+$1'/( $5B+$1'/(
5(&25'B6758&785( 
9%)$

$//B5(&25'6B2)B2%-(&7 
;

7$%/(6
7$%/( ;9%)$
(;&(37,216
27+(56 

&$//)81&7,21
$5&+,9(B*(7B7$%/(

(;3257,1*
$5&+,9(B+$1'/( $5B+$1'/(
5(&25'B6758&785( 
9%3$

$//B5(&25'6B2)B2%-(&7 
;

7$%/(6
7$%/( ;9%3$
(;&(37,216
27+(56 

3(5)250287387B'2&B,1)2

(1''2

SAP AG BC670 5-40


&$//)81&7,21
$5&+,9(B&/26(B),/(

(;3257,1*
$5&+,9(B+$1'/( $5B+$1'/(

)250287387B'2&B,1)2

:5,7(;9%.$9%(/1;9%.$.7$$5;9%.$(5'$7
;9%.$(51$0;9%.$$('$7

/223$7;9%3$
:5,7(;9%3$3$59:;9%3$3$515;9%3$$'515
(1'/223

/223$7;9%)$
:5,7(;9%)$9%(/1;9%)$9%7<3B1
(1'/223

(1')250

SAP AG BC670 5-41


8QLW&XVWRPHUVSHFLILFUHSRUWLQJ
7RSLF3URJUDPIRUDUFKLYHGVDOHVDFWLYLWLHV
5HDGZLWKDUFKLYLQJFODVVHV

1-1 Tools, ABAP Workbench, Development, ABAP Editor

Copy Z00VBKAREADTEXT to ZxxVBKAREADTEXT.(XX represents your group


number)

1-2 to 1-4 see sample program ZSDVBKAREADTEXT

SAP AG BC670 5-42


5(3257=6'9%.$5($'7(;7


DUFKLYHUHDGSURJUDPIRUVDOHVDFWLYLWHV



7$%/(69%.$9%)$9%3$

3$5$0(7(56$86*7(;7$6&+(&.%2;

'$7$<9%.$/,.(9%.$2&&856:,7++($'(5/,1(

;9%)$/,.(9%)$2&&856:,7++($'(5/,1(
<9%)$/,.(9%)$2&&856:,7++($'(5/,1(

;9%3$/,.(9%3$2&&856:,7++($'(5/,1(

%(*,12);9%.$
,1&/8'(6758&785(9%.$
'$7$(1'2);9%.$

'$7$7;7B7$%/,.(7+($'2&&856:,7++($'(5/,1(
'$7$7(;7B/,1(6/,.(7/,1(2&&856:,7++($'(5/,1(
'$7$7(;7B(175,(6/,.(6<7),//

'$7$$5B+$1'/(7<3(6<7$%,;

&$//)81&7,21
$5&+,9(B23(1B)25B5($'

(;3257,1*
2%-(&7 
6'B9%.$

,03257,1*
$5&+,9(B+$1'/( $5B+$1'/(
(;&(37,216
27+(56 

,)6<68%5&!
:5,7(
QRDUFKLYHILOHV

6723
(1',)

:5,7(
'2

SAP AG BC670 5-43


&$//)81&7,21
$5&+,9(B*(7B1(;7B2%-(&7

(;3257,1*
$5&+,9(B+$1'/( $5B+$1'/(
(;&(37,216
27+(56 

,)6<68%5&!
:5,7(
QRREMHFW

(;,7
(1',)

7DEOH9%.$KDVRQO\RQHUHFRUGIRUHDFKVDOHVDFWLYLW\,QWKHGDWD
VWUXFWXUH\RXILQG9%.$$)7(59%8.7KHUHIRUH\RXPXVWUHDGVHYHUDO
UHFRUGVLP\RXXVHIXQFWLRQPRGXOH
$5&+,9(B*(7B1(;7B5(&25'

7KHSURJUDPSHUIRUPDQFHZLOOEHEHWWHULI\RXXVHIXQFWLRQPRGXOH
$5&+,9(B*(7B7$%/(WRILQGDQGUHDGWKH9%.$UHFRUG

&$//)81&7,21
$5&+,9(B*(7B7$%/(

(;3257,1*
$5&+,9(B+$1'/( $5B+$1'/(
5(&25'B6758&785( 
9%.$

$//B5(&25'6B2)B2%-(&7 
;

7$%/(6
7$%/( <9%.$
(;&(37,216
27+(56 

;9%.$ <9%.$

&$//)81&7,21
$5&+,9(B*(7B7$%/(

(;3257,1*
$5&+,9(B+$1'/( $5B+$1'/(
5(&25'B6758&785( 
9%)$

$//B5(&25'6B2)B2%-(&7 
;

7$%/(6
7$%/( ;9%)$
(;&(37,216
27+(56 

&$//)81&7,21
$5&+,9(B*(7B7$%/(

(;3257,1*
$5&+,9(B+$1'/( $5B+$1'/(
5(&25'B6758&785( 
9%3$

$//B5(&25'6B2)B2%-(&7 
;

7$%/(6

SAP AG BC670 5-44


7$%/( ;9%3$
(;&(37,216
27+(56 

3(5)250287387B'2&B,1)2

(1''2

&$//)81&7,21
$5&+,9(B&/26(B),/(

(;3257,1*
$5&+,9(B+$1'/( $5B+$1'/(


)250287387B'2&B,1)2



)250287387B'2&B,1)2

'$7$;67$'0B/,1(67<3(1
'$7$7(;71$0(/,.(7+($'7'1$0(

:5,7(;9%.$9%(/1;9%.$.7$$5;9%.$(5'$7
;9%.$(51$0;9%.$$('$7

/223$7;9%3$
:5,7(;9%3$3$59:;9%3$3$515;9%3$$'515
(1'/223

/223$7;9%)$
:5,7(;9%)$9%(/1;9%)$9%7<3B1
(1'/223

,)$86*7(;7 
;


6HOHFWWH[WEHORQJLQJWRWKHFXUUHQWGRFXPHQW

&$//)81&7,21
7(;7B6(/(&7B$5&+,9(B2%-(&7

(;3257,1*
$5&+,9(B+$1'/( $5B+$1'/(
,03257,1*
(175,(6 7(;7B(175,(6
7$%/(6
6(/(&7,216 7;7B7$%

SAP AG BC670 5-45


(;&(37,216
27+(56 

,)7(;7B(175,(6!$1'6<68%5& 
ORRSWKURXJKDOOWH[WHQWULHV
/223$77;7B7$%
5HDGWKHWH[W
&$//)81&7,21
7(;7B5($'B$5&+,9(B2%-(&7

(;3257,1*
$5&+,9(B+$1'/( $5B+$1'/(
,' 7;7B7$%7','
/$1*8$*( 7;7B7$%7'635$6
1$0( 7;7B7$%7'1$0(
2%-(&7 7;7B7$%7'2%-(&7
7$%/(6
/,1(6 7(;7B/,1(6
(;&(37,216
27+(56 
'LVSOD\WKHWH[WRQVFUHHQ

/223$77(;7B/,1(6
:5,7(7(;7B/,1(67'/,1(
(1'/223
6.,3
(1'/223
(1',)

(1',)

(1')250

SAP AG BC670 5-46


'LUHFW5HDG$FFHVVWR$UFKLYHG'DWD

&RQWHQWV
l /RJLFRIGLUHFWUHDGDFFHVVXVLQJ6$3$6
l &UHDWLQJDEXVLQHVVYLHZIRU00B0$7%(/LQ6$3$6

SAP AG 2002

SAP AG BC670 6-1


'LUHFW5HDG$FFHVV8QLW2EMHFWLYHV

$WWKHFRQFOXVLRQRIWKLVXQLW\RXZLOOEHDEOHWR

l &UHDWHEXVLQHVVYLHZVIRUDUFKLYLQJREMHFWVLQ
6$3$6

SAP AG 1999
2002

SAP AG BC670 6-2


&RXUVH2YHUYLHZ'LDJUDP

&RXUVH2YHUYLHZ

7KH'DWD$UFKLYLQJ3URFHVV

$'.'HYHORSPHQW7RROV

'DWD$UFKLYLQJ3URJUDPPLQJ/RJLF

&XVWRPHU6SHFLILF5HDG3URJUDPV

%XVLQHVV9LHZVLQ6$3$6

$SSHQGL[

SAP AG 2002

SAP AG BC670 6-3


'LUHFW5HDG$FFHVV%XVLQHVV6FHQDULR

l <RXKDYHWRFUHDWHDEXVLQHVVYLHZIRUDQ
DUFKLYLQJREMHFWLQ6$3$6

SAP AG 1999
2002

SAP AG BC670 6-4


$UFKLYH5HSRUWLQJZLWK6$3$6

l 0HWKRGVLQGHSHQGHQWRIDUFKLYLQJREMHFW

l *HQHULFVROXWLRQIRUSUHVHQWLQJDUFKLYHGGDWD

l 'LUHFWVLQJOHGRFXPHQWDFFHVV

l &RQILJXUDEOH

SAP AG 2002
1999

n The archived data can always be presented in a technical view. Business views are available in the
standard system for selected objects and customers can create their own additional business views.
The available function modules can serve as frameworks.
n Specific archiving sessions can be selected for reporting purposes.
Also, specific archive information structures can be selected as reporting inputs.
n At technical view level, additional functions such as search, sort and summarize are provided.

SAP AG BC670 6-5


)LHOG&DWDORJV

l )LHOGFDWDORJ
&RQWDLQVIURPWKHDUFKLYLQJREMHFWVGDWDEDVHWDEOHV
w .H\ILHOGV
w )LHOGVWKDWDUHLPSRUWDQWIRUFXVWRPHUVVHDUFK
IXQFWLRQDOLW\

)LHOGFDWDORJILHOGVDUHDYDLODEOHWRWKH$UFKLYH,QIRUPDWLRQ
6\VWHP
)LHOGFDWDORJVDUHSURYLGHGE\WKHDSSOLFDWLRQV
&XVWRPHUVFDQGHILQHWKHLURZQILHOGFDWDORJVWRPHHWWKHLU
VSHFLILFUHTXLUHPHQWV

SAP AG 1999
2002

SAP AG BC670 6-6


&UHDWLQJ)LHOG&DWDORJIRU00B0$7%(/

l )LHOGFDWDORJIRU00B0$7%(/

l &UHDWHILHOGFDWDORJ

Fld. catalog Description Arch.object File Offset

Fi-Docs. Fi-Docs. FI_DOCUMNT D D


Zcoitem Controlling CO_ITEM K K
Mmatbel Material docs MM_MATBEL D D

SAP AG 2002

n Archive information structures are based on field catalogs.


There is one table per archive information structure, which incorporates all records from all of the
selected archiving sessions.
n By making file and offset entries, you can guarantee the uniqueness of the key for all archiving
sessions.
n Explanation of the entries in the slide:
FI documents are unique for every application key, as the fiscal year is part of the key.
Therefore, the archive key and the offset do not have to be included in the key.
In other applications, keys can be reassigned after an archiving session.
Therefore, for example in SD, the name of the archive file (which is declared as part of the key
in SAP AS), guarantees uniqueness over more than one archiving session.
Cost centers may have many line items that do not fit into a data object.
In order to keep the key unique, the offset in an archive file is incorporated into a key.

SAP AG BC670 6-7


6WDQGDUG)LHOG&DWDORJ00B0$7%(/

l )LHOGVHOHFWLRQLQFOXGHVDOOILHOGVWKDW\RXZDQWWRXVHIRU
\RXUVHDUFK

fld.no. target fld. key source tab. source fld. mand.


10 MBLNR x MSEG MBLNR
20 MJAHR x MSEG MJAHR
25 ZEILE x MSEG ZEILE
30 VGART MKPF VGART
40 BLDAT MKPF BLDAT
50 BUDAT MKPF BUDAT
.....
110 MATNR MSEG MATNR
120 WERKS MSEG WERKS
.....

l :KHQWKHILHOGFDWDORJLVFUHDWHGWKHNH\ILHOGVIURPWDEOH
06(*PXVWEHDVVLJQHGWRWDEOH0.3)XVLQJWKHIXQFWLRQ
DGGLWLRQDOVRXUFHILHOGV

SAP AG 1999
2002

n This field catalog contains fields from table MKPF and fields from table MSEG. If more than one
table is used, the function additional source fields is used.
n The field catalog key fields from table MSEG must also be present in table MKPF and are assigned
to table MKPF using the function additional source fields.

SAP AG BC670 6-8


$OWHUQDWLYH)LHOG&DWDORJIRU00B0$7%(/ 

l 7KHPDWHULDOQXPEHULV\RXUVHDUFKFULWHULRQ

l 3RVVLEOHILHOGVHOHFWLRQIRUWKHILHOGFDWDORJ

Fld.no. Target fld. Key Source tab. Source fld. mand.

10 matnr x mseg matnr x


20 mblnr x mseg mblnr
30 mjahr x mseg mjahr

l 7KHSRLQWHUWRDGGLWLRQDOVRXUFHILHOGVLVRPLWWHG

SAP AG 2002

SAP AG BC670 6-9


6$3$6&RPSRQHQWV

6$35DSSOLFDWLRQ FXVWRPHU

VHWVXS

QILHOGFDWDORJVSHUDUFKLYLQJREMHFW

FDUU\ILHOGVRYHUWR

QDUFKLYHLQIRUPDWLRQVWUXFWXUHV
EDVHGRQDILHOGFDWDORJ

5HSRUWLQJ
SURJUDP

SAP AG 2002

n The field catalogs are assigned to archiving objects. They contain fields from the archiving object
tables. These fields can be incorporated in archive information structures. Standard field catalogs are
delivered with the archive information system. You should only create customer-specific field
catalogs as exceptions.
n Archive information structures are the foundation for reporting within the Archive Information
System. They are defined using the Archive Retrieval Configurator and are based on the field
catalogs. Customers incorporate into the archive information structures the key fields that uniquely
identify an object and the data fields that meet their information requirements.
These fields are filled with the archived data and thereby allow the archive files to be reported.
n Archive information structures must be activated. When they are activated, a transparent table with
defined data structures is created in R/3. A reporting program is also generated.
The table is filled with data during the deletion part of the archiving session. The table can also be
filled in a separate process as an administrative function. Reporting is based on this data.

SAP AG BC670 6-10


$UFKLYH,QIRUPDWLRQ6WUXFWXUHV

l $UFKLYHLQIRUPDWLRQVWUXFWXUH

The archive information structure contains an extract of the


archived data.
Information structures are dependent on the archiving object..
There can be more than one information structure for each
archiving object.
There is a transparent database table for each information
structure.

SAP AG 2002
1999

n Several field catalogs can be defined for one archiving object.


n Several archive information structures can also be defined for one archiving object.
n However, an archive information structure always refers to one specific field catalog.
n Fields used in archive information structures must be contained in the assigned field catalog.

SAP AG BC670 6-11


)LOOLQJWKH$UFKLYH,QIRUPDWLRQ6WUXFWXUHV

5
'DWDEDVH

'HOHWH $UFKLYH $UFKLYH


SURJUDP ILOH ILOH
'HOHWH
SURJUDP $UFKLYH $UFKLYH
ILOH ILOH

9DULDQW 9DULDQW
ILOOGXULQJ ILOODIWHUH[SOLFLW
GHOHWHUXQ LQVWUXFWLRQIURP6$3$6

SAP AG 2002

n Both variants are equally valid.


n Automatic fill during delete program run:
If an information structure is active, it s filled automatically during the archiving sessions delete
program run.
n By explicitly activating and deactivating the information structures before the start of the delete
program run, you can specify that only WKRVHinformation structures that are always going to be used
as a means of accessing information are to be filled.
n Explicit instruction from SAP AS:
You can fill the archive information structure tables at any time with data from existing archive files.
To do this, go to SAP AS administration.

SAP AG BC670 6-12


'DWD'LVSOD\LQ6$3$6

l 5HSRUWLQJGDWDIURPWKHDUFKLYHLQIRUPDWLRQVWUXFWXUH
The structure table entries are displayed on the screen as in
SE16.
No access to the ADK file is required for this display.

l 'RXEOHFOLFNDWDEOHOLQHIRUGLUHFWDFFHVVWRWKHGDWD
REMHFWLQWKH$'.DUFKLYH
The data display is possible for all archiving objects in a technical
view. This view lists the individual tables with their values.
You can program a business view of the data.

SAP AG 2002

n The standard system in Release 4.6 contains business views for 14 objects.
Further business views are planned.
Customer-specific business views can also be created by the customer.

SAP AG BC670 6-13


5HSRUWLQJ$UFKLYH,QIR6WUXFWXUHV$UFKLYH([SORUHU

UWV@XZY3[3X \"]_^ `AYbaAced?f[3gZh g3\"]i^ `WYj[B\ZV@g>gZY

 
       "!$#$#&%('*) % l 7KHV\VWHPJHQHUDWHVD
UHSRUWLQJSURJUDPIRUHDFK
#+ -,"
!$ 0.$. . . . . .1
. . . . . . . . . ./
......
..........
LQIRUPDWLRQVWUXFWXUH
2  3 -"45 .................... 
.................... l $UFKLYHDFFHVVLVQRW
UHTXLUHGIRUWKLVVWHS
67 5" 898:" - ;<<

UkVg>l@lg$Vmh-^ [3]@g

     =  >


8+  ? @" 47!*#A#+%*'()B%
5HSRUWLQJ
SURJUDP #7 4," 'B C?  ) @ D 2  3 -"E5
F<C<<<< FCG.HFE<. FIIJ  4 +  K 3ILM-;
F<C<<<F FCG.HFE<. FIIJ 40  >LCNOAJCPHNL7IJM;
F<C<<<G FCG.HFE<. FIIJ  4 +  K 3ILM-N
F<C<<<Q FCG.HFE<. FIIJ ")>,SR>OTIJ
....

SAP AG 2002

n Call transaction SARI


Button Archive Explorer
Select the desired archiving object and archive information structure.

The system displays the table records from the archive information structure table.
The display is the same as the table view in transaction SE16.

n 1RDFFHVVWRDUFKLYHILOHVLVUHTXLUHGIRUWKLVOLVWRIVWUXFWXUHUHFRUGVFRQWDLQLQJDQH[WUDFWRI
DUFKLYHGGDWD

n From this list you can branch to an objects technical view. This view is possible for all objects that
can be accessed in SAP AS.

SAP AG BC670 6-14


$FFHVVWR,QGLYLGXDO'DWD2EMHFWV7HFKQLFDO9LHZ

  "   =  3 8+  7  7!*#$"#?%*'() % '( >0K CD," E ? qsr@  8t " 4" u qK &> v
#? 4," '3 4 Z)BC HD 2  > 4C5 <<<FswQM-<<FC!(#$"#7%$'$)B%
FC<<<<< FCG. FE<. FCIIJ 2 " > 
FC<<<<F FCG. FE<. FCIIJ %Z0  LNCOAJCPHNL7IJM-;  qK &Oyx$zR F{#y ," >8+ 4 , 4
FC<<<<G FCG. FE<. FCIIJ 2 " >   qK +!$#7|$%3O F 2 -. @K 7 3  -," "C-@K 8
FC<<<<Q FCG. FE<. FCIIJ ")>,SR Oon IJp  qK +!$#7|$%(| G}'* . @K C+C4. K   ," 2 4.
.... +^ [**h X"ZX>]@X`Ag3\"]  qK +!$#7R>O F{!*#kM4#&q~r4Cu!* @  >K," E

aygZh g3\>]*]m3gZg[*^V@g3
A^ [**h X"li*YB\"]m^ `AY

+^ [**h X"X[>]@g$V(ZX]X
U*g \B*Y*^H\XZh(^ g"

 " "   =  = @@ 4+!(#$"#7%$'$)B%


Oy8 B  >q~r4C3 
. QEw;. <<      =  =@ @ ?"!$#$"#?%*'$)B%
Oy8 > @ -CD Qw;. << !A# 'B . B%" Ok8  !W" 
<
'* 83ECD #?% <<<<<<<FE<<<IC; <<<F G<<<<<<<; F F< FC G<<. << x$B
z  "KsD  FCIIJ <<<F G<<<<<<<N F F < QCw;. << x$B
!kK  Iw
*" H  <

SAP AG 2002

n By double clicking, you can access the archived document directly from the list display.
n You access individual data record in the offset, which is stored in the archive information structure.
The relevant archive file is read directly.
n For direct access to the archived data, the system checks the authorization objects S_ARCHIVE and
S_TABU_DIS.
For more information on the creation of customer-specific authorization objects, refer to SAP Note
175901.

SAP AG BC670 6-15


$FFHVVWR,QGLYLGXDO'DWD2EMHFWV%XVLQHVV9LHZ

 "      >


8+ @ 7@ @" 4?!*#("#7%*'A) %
#7 4," 'B C? B)3@ D 2  3 -"45
FC<<<<< FEG. FC<.-FEIIJ 2 " > 
FC<<<<"F FEG. FC<.-FEIIJ % 0  LNEOWJEPHNL?IJM-;
FC<<<<G FEG. FC<.-FEIIJ 2 " >  '( 0K CD 4"
 K u6& 4 ,  &555
FC<<<<Q FEG. FC<.-FEIIJ "),eR3Oon IJp
....
+^ [**h XbZX>]@X`A@g3\]
#7 4," FC<<<<Q #& ," "HD0 z)BF
aygZh g3\>]*]m3gZg[$^4V@g3 2  3 -5) 'R>OTn IJp
A^ [**h X>li*YB\"]m^ `AY

+^ [**h XX[3]gZV(ZX>]@X 2 D48+4  % K'( 2 )">!


+>[*^HY g[3[$^ g 2 4 @8Sq" <

!( >@ - K, 4


!  -"CD '$)>6
#7 4," > C4" D F

SAP AG 2002

n The business view of a data record is created using function modules. They are listed in table
AIND_STR5.

SAP AG BC670 6-16


3URJUDPPLQJ/RJLF'LUHFW6LQJOH'RFXPHQW
$FFHVV

l $UFKLYHBUHDGBREMHFW
Archive_get_next_record
READ_TEXT (Archiving class TEXT)

l $UFKLYHBFORVHBILOH

SAP AG 1999
2002

n ARCHIVE_READ_OBJECT includes ARCHIVE_OPEN_FOR_READ and


ARCHIVE_GET_NEXT_OBJECT and searches the required data object in the archive file.
n Before calling the function module again, ARCHIVE_CLOSE_FILE must be called for the returned
handle.

SAP AG BC670 6-17


$'.$3,$5&+,9(B5($'B2%-(&7

l Interface parameter import


Object
Archive key
Offset
l Interface parameter export
archive_handle
l Function module functionality:

This function module reads a specific data object from an archiving object in an
archiving file and returns a handle for further processing. If the archive file was
stored using ArchiveLink, it is also possible to read the data object using this
function module. The different forms of processing are dealt with by this
function module.
After the data object has been read by ARCHIVE_READ_OBJECT, you can
access the data using the function module ARCHIVE_GET_NEXT_RECORD or
using the handle.

SAP AG 2002

n The name of the archiving object is transferred in the interface parameter object. The archive key
supplies the archive file and the offset of the required doucment in the arhcive file.
n In turn, the information for offset and archive key are copied from the archive information structure
table from SAP AS.
n Note:
The function module is intended for interactive reporting - that is - for the display on screen of a
specific document.
It is not intended for reading documents in archive files in the context of sequential evaluations.

SAP AG BC670 6-18


6WUXFWXUHRID5HDG3URJUDPZLWK'LUHFW$FFHVV

'HFODUDWLRQ
,QWHUQDOWDEOHV LWDE$LWDE%LWDE& 

'HWHUPLQH$UFKLYHNH\DQG2IIVHW
VHOHFWVLQJOHDUFKLYHBNH\RIIVHWIURP,QGH[7DEOH
ZKHUH
LPSRUWDUFKLYHBNH\RIIVHW

,QFOXGHREMHFWLQWKH$'.ZRUNDUHD
$5&+,9(B5($'B2%-(&7
H[SRUWDUFKLYHBNH\RIIVHW
LPSRUWDUFKLYHBKDQGOH 

,QFOXGHLQSURJDPWKHQH[WUHFRUGEHORQJLQJWRREMHFW
$5&+,9(B*(7B1(;7B5(&25' 3`*`WB[ `h `AY oX[
H[SRUWDUFKLYHBKDQGOH V@g3\>`V@B[XZV@g*V@g[BgZY>]
LPSRUWUHFRUGBVWUXFWXUHUHFRUG

2XWSXWUHFRUG

&ORVHDUFKLYHILOHV
$5&+,9(B&/26(B),/(
H[SRUWDUFKLYHBKDQGOH
SAP AG 2002

n If necessary, you must also read an archiving class

SAP AG BC670 6-19


9LHZVLQ6$3$6

 -q"K         @" 4+!*#("#7%*'()B%


#+ -," ' ? "@ HD 2  H"E5
F<<<<< FCG.-F~<.HFCIIJ 2  H 
F<<<<F FCG.-F~<.HFCIIJ % "0 " eLCNOWJEPHNL7IJM4;
F<<<<G FCG.-F~<.HFCIIJ 2  H  'A 0"K CD "
 KC 4," @u8= C >," C 555
F<<<<Q FCG.-F~<.HFCIIJ )",SR3Oon IJp
....
'( 0"K CD," 4 + q_r

2 K C3," H,,> "0K D
@  K  HD
#? 4," FC<<<<Q #y ," -D"0 z)BF
2   5")3'R Oon IJp

  Ks3 v


'( 0"K CD," 4 7@  8z6 2 D84  %BK'$ 2 )"!
 30 , - 2 4 89q" <

z K ,jp OkK 4    7 qK  !A 
KC," 
Ok (' 2  %Z;
!k @ -"CD '*)>6
#? 4," > C D F

SAP AG 2002

n The business view of a data record is created using function modules. They are listed in the table
AIND_STR5.

SAP AG BC670 6-20


'LDORJ%R[%XVLQHVV9LHZ

l &UHDWHDGLDORJER[WH[WIRUVHOHFWLQJWKHEXVLQHVVYLHZ

Table entry with name of the display function module in table


AIND_STR5

w Object name: <processed archiving object >


w Display function module: Name of the function module created
w Line: Defines the sequence in the dialog box
w text: Display text in the dialog box,
link to application-specific view

SAP AG 2002
1999

n Create entries:

1) Call table AIND_STR5 via


Tools -> ABAP Workbench -> Overview -> Data Browser

2) Button CREATE

3) Carry out entries for


Object
Function
Line
Text

4) Button SAVE -> entry written in table

SAP AG BC670 6-21


7DEOH$,1'B675

OBJECT FUNCTION LINE TEXT

MM_MATBEL 05 matdoc - technical


MM_MATBEL MM_MATBEL_DISPLAY_DATA_DYN 40 copied screen
MM_MATBEL MM_MATBEL_DISPLAY_DATA 01 display data from fm
RV_LIKP 05
RV_LIKP RV_LIKP_01_DISPLAY_DATA 01 delivery - document
RV_LIKP RV_LIKP_01_DISPLAY_DATA2 02 display originals
SD_VBAK 05
SD_VBAK SD_VBAK_01_DISPLAY_DATA 01 order - document
SD_VBAK SD_VBAK_01_DISPLAY_DATA2 02 display originals
SD_VBRK 05
SD_VBRK SD_VBRK_01_DISPLAY_DATA 01 billing document
SD_VBRK SD_VBRK_01_DISPLAY_DATA2 02 display originals

SAP AG 2002

n Note:
As soon as an application-specific display function has been entered in table aind_str5, the technical
view no longer appears.

If you want to provide both options, you must also create an entry for the technical view in
aind_str5. This entry has the value space for the function. Text can also remain empty.

n Entries must be transported manually.


You can use the function table entry -> transport entries in transaction SE16 to do this.

SAP AG BC670 6-22


)XQFWLRQ0RGXOH%XVLQHVV9LHZ

l &UHDWHIXQFWLRQPRGXOHLQFXVWRPHUQDPHVSDFH

Create function group <zxxxxx>.

Create function module <zyyyyy> in function group.

Adjust function module in line with the selected object.

SAP AG 2002
1999

n Create function group: Tools -> ABAP Workbench -> Overview -> Object Browser

SAP AG BC670 6-23


)XQFWLRQ0RGXOH,QWHUIDFH

l ,QWHUIDFHVLPLODUWRIXQFWLRQPRGXOH
.$6+B$5&+,9(B'$7$B2%-(&7B6+2:

l 3DVVLQJSDUDPHWHUV

I_ARCHIVEKEY
Name of archive file as it appears in archive management

I_OFFSET
Offset of data object in the archive for direct access

SAP AG 2002
1999

SAP AG BC670 6-24


2XWSXWRIWKH%XVLQHVV9LHZ

l 2XWSXWFRQWURORSWLRQV


The list output is programmed directly in the function module.


Display on the customer-specific screen, which switches to list
processing.
You can use an existing program for the list processing.

SAP AG 2002
1999

SAP AG BC670 6-25


2XWSXW'LUHFWO\IURPWKH)XQFWLRQ0RGXOH

l &RQWURORXWSXWZLWKRXWDVFUHHQ


The list output occurs directly in the function module.


Create a list structure using WRITE statements.

SAP AG 1999
2002

n As soon as there is more than one function module in the function group, the globally used tables and
data must be present in the global area.

SAP AG BC670 6-26


2XWSXW'LUHFWO\IURPWKH)000B0$7%(/ 

function mm_matbel_display_data.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(I_ARCHIVEKEY) LIKE ADMI_FILES-ARCHIV_KEY
*" VALUE(I_OFFSET) LIKE ARCH_IDX-OFFSET
*" EXCEPTIONS
*" OBJECT_NOT_FOUND
*"----------------------------------------------------------------------

tables: arc_buffer, mkpf, mseg, makt.


data: handle like sy-tabix.
data: xmaktx like makt-maktx.

call function ARCHIVE_READ_OBJECT


exporting
object = MM_MATBEL
archivkey = i_archivekey
offset = i_offset
importing
archive_handle = handle
exceptions
others = 12.
SAP AG 2002

SAP AG BC670 6-27


2XWSXW'LUHFWO\IURPWKH)000B0$7%(/ 

if not sy-subrc is initial.


message id sy-msgid type I number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
exit.
endif.
do.
call function ARCHIVE_GET_NEXT_RECORD
exporting
archive_handle = handle
importing
record = arc_buffer-segment
record_structure = arc_buffer-rname
exceptions
end_of_object = 1.
if sy-subrc = 1.
exit.
endif.

SAP AG 2002

SAP AG BC670 6-28


2XWSXW'LUHFWO\IURPWKH)000B0$7%(/ 

case arc_buffer-rname.
when MKPF.
mkpf = arc_buffer-segment.
write: / , mkpf-mblnr, mkpf-mjahr.
write: / sy-uline(105).
format color col_heading intensified.
skip 2.

write: /2 Posting date:,


18 mkpf-budat,
66 'Name:',
73 mkpf-usnam.
skip 2.
write: /2 Items.
skip 1.
write: /4 'Pos',
10 Amount,
30 'EME',

SAP AG 2002

SAP AG BC670 6-29


2XWSXW'LUHFWO\IURPWKH)000B0$7%(/ 

35 Material,
55 Plant,
60 Loc.

write: /35 Material short text,


73 'BwA'.

skip 1.

when 'MSEG'.
mseg = arc_buffer-segment.
write: /5 mseg-zeile, mseg-matnr.
write: /4 mseg-zeile,
10 mseg-erfmg,
30 mseg-erfme,
35 mseg-matnr,
55 mseg-werks,
60 mseg-lgort.

SAP AG 2002

SAP AG BC670 6-30


2XWSXW'LUHFWO\IURPWKH)000B0$7%(/ 

select maktx into xmaktx from makt where matnr = mseg-matnr.


endselect.
write: /35 xmaktx,
73 mseg-bwart.

endcase.
enddo.

call function ARCHIVE_CLOSE_FILE


exporting
archive_handle = handle.
endfunction.

SAP AG 2002

SAP AG BC670 6-31


2XWSXWZLWK6FUHHQDQG/LVW3URFHVVLQJ

l &RQWRORXWSXW


Create screen for function group


Screen-call in function module with switch to list function


Fill and output lists

SAP AG 2002
1999

SAP AG BC670 6-32


6FUHHQ/LVW2XWSXW00B0$7%(/ 

function mm_matbel_display_data_dyn.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(I_ARCHIVEKEY) LIKE ADMI_FILES-ARCHIV_KEY
*" VALUE(I_OFFSET) LIKE ARCH_IDX-OFFSET
*" EXCEPTIONS
*" OBJECT_NOT_FOUND
*"----------------------------------------------------------------------

refresh: i_mkpf, i_mseg.

call function ARCHIVE_READ_OBJECT


exporting
object = MM_MATBEL
archivkey = i_archivekey
offset = i_offset
importing
archive_handle = handle
exceptions
others = 12.
SAP AG 2002

SAP AG BC670 6-33


6FUHHQ/LVW2XWSXW00B0$7%(/ 

if not sy-subrc is initial.


message id sy-msgid type E number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.

do.
call function ARCHIVE_GET_NEXT_RECORD
exporting
archive_handle = handle
importing
record = arc_buffer-segment
record_structure = arc_buffer-rname
exceptions
end_of_object = 1.
if sy-subrc = 1.
exit.
endif.

SAP AG 2002

SAP AG BC670 6-34


6FUHHQ/LVW2XWSXW00B0$7%(/ 

case arc_buffer-rname.

when MKPF.
i_mkpf = arc_buffer-segment.
append i_mkpf.

when MSEG.
i_mseg = arc_buffer-segment.
append i_mseg.

endcase.
enddo.

call screen 200.

call function ARCHIVE_CLOSE_FILE


exporting
archive_handle = handle.
endfunction.
SAP AG 2002

SAP AG BC670 6-35


6FUHHQ/LVW2XWSXW00B0$7%(/ 

2 v 7 eK  Z0"  "C" 


process before output.
module status_0200.

module display_list_materialdocuments.
IORZORJLF
%  ,P- >@0
VFUHHQ
 4  "KE4 qK 
 ," P
 8, 4

process after input.


module user_command_200.
)890HD8= , "K EP  HD
q + "v 
+
K  B0 4 C 

SAP AG 2002

SAP AG BC670 6-36


6FUHHQ/LVW2XWSXW00B0$7%(/ 

module status_0200 output.

suppress dialog.
leave to list-processing and return to screen 0.

* SET PF-STATUS xxxxxxxx.


* SET TITLEBAR xxx.

endmodule. " STATUS_0200 OUTPUT

module user_command_0200 input.

endmodule. " USER_COMMAND_0200 INPUT

SAP AG 2002

SAP AG BC670 6-37


6FUHHQ/LVW2XWSXW00B0$7%(/ 

module display_list_materialdocument output.

write: /2 Booking date:,


18 i_mkpf-budat,
66 Name:,
73 i_mkpf-usnam.
skip 2.
write: /2 Items.
skip 1.
write: /4 'Pos',
10 Set,
30 'EME',
35 'Material',
55 Plant
60 'LOrt'.

write: /35 'Material short text,


73 'BwA'.
skip 1.
SAP AG 2002

SAP AG BC670 6-38


6FUHHQ/LVW2XWSXW00B0$7%(/ 

loop at i_mseg.
write: /4 i_mseg-zeile,
10 i_mseg-erfmg,
30 i_mseg-erfme,
35 i_mseg-matnr,
55 i_mseg-werks,
60 i_mseg-lgort.

select maktx into xmaktx from makt where matnr = i_mseg-matnr.


endselect.
write: /35 xmaktx,
73 i_mseg-bwart.
endloop.

endmodule. " DISPLAY_LIST_MATERIALDOCUMENT OUTPUT

SAP AG 2002

SAP AG BC670 6-39


'LVSOD\LQJ$UFKLYHG2ULJLQDOVRI5'RFXPHQW 

l 'HWHUPLQHZKLFKEXVLQHVVREMHFWW\SHWKHGRFXPHQWLV
DVVLJQHGWR
l &UHDWHNH\YDULDEOHLQSURJUDP
l &RQVWUXFWNH\YDULDEOHFRUUHVSRQGLQJWRNH\RIWKHEXVLQHH
REMHFWW\SH
7KHNH\LVGHILQHGLQWKH%XVLQHVV2EMHFW5HSRVLWRU\ %25 
l &DOO)XQFWLRQ0RGXOH
$5&+,9B',63/$<B0(7$

Export: Name of the business object type
Key varialbe

Result: Display the archived originals, or a hit list of the originals

SAP AG 2002
1999

n As you can access the Business Object Repository in transaction 6:2


n SAP ArchiveLink assigns a document type and a business object type to the archived originals
n The document type identifies the original document. Examples:
FIIINVPREL Incoming invoice preliminary posting
FIIINVOICE Incoming invoice without verification
SDOORDER Order acknowledgement
......
n Archived originals are always related to an R/3 business object.
The key of the accompanying business object is uniquely identified via the assignment to a business
type. This is necessary for search strategies.

SAP AG BC670 6-40


'LVSOD\LQJ$UFKLYHG2ULJLQDOVRI5'RFXPHQW 

l 'HWHUPLQHZKLFKEXVLQHVVREMHFWW\SHWKHGRFXPHQWLV
DVVLJQHGWR


Report assignment of archived document to object type

w Path: Tools -> Business Documents -> Basic Settings -> Links
(transaction 2$&)
w Examples:
Doc. type Description Object type
FIIINVOICE incoming invoice BKPF
FIIINVPREL invoice preliminary posting BKPF
SDOORDER order acknowledgement VBAK
MMOORDER order EKKO
......

SAP AG 1999
2002

n If the object type is not found in ArchiveLink, you can set a breakpoint in the display transaction for
the object at SWU_OBJECT_PUBLISH and debug so that the correct object type is transferred to
OBJTYPE.
n It is also possible to analyze link tables in ArchiveLink. By default, tables TOA01, TOA02, and
TOA03 are used. The R/3 key for the object is stored here together with the object type and the
document type.

SAP AG BC670 6-41


'LVSOD\$UFKLYHG2ULJLQDORI5'RFXPHQW 

l &UHDWHNH\GHILQLWLRQV
YDULDEOHZLWKNH\RIWKHEXVLQHVVGRFXPHQW!


data: <variable name> like sapb-sapobjid. key to be passed

data: begin of objectid, variable constructed
according to the key of the
business object type
end of objectid.

l &RQVWUXFWNH\DFFRUGLQJWREXVLQHVVREMHFW

move <database field 1> to objectid-<xxx>.
move <database field 2> to objectid-<zzz>.
......
Object_id = objectid.

SAP AG 2002
1999

SAP AG BC670 6-42


'LVSOD\$UFKLYHG2ULJLQDORI5'RFXPHQW 

l &DOOIXQFWLRQPRGXOH$5&+,9B',63/$<B0(7$

call function ARCHIV_DISPLAY_META
exporting
sap_object = <Business object type>
object_id = <variable with key to business document >
exceptions
others = 1.

l 7KHIXQFWLRQPRGXOHGLVSOD\VWKHDUFKLYHGRULJLQDO
,IPRUHWKDQRQHGRFXPHQWLVDUFKLYHGSHU5GRFXPHQW
WKHXVHUREWDLQVDKLWOLVWIURPZKLFKWRVHOHFWWKHGHVLUHG
RULJLQDO

SAP AG 2002

SAP AG BC670 6-43


([DPSOH'LVSOD\$UFKLYHG2ULJLQDO 

function fi_documnt_display_data_originale.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(I_ARCHIVEKEY) LIKE ADMI_FILES-ARCHIV_KEY
*..........
*"----------------------------------------------------------------------
..........
data: begin of objectid,
oidbukrs like bkpf-bukrs,
oidbelnr like bkpf-belnr,
oidgjahr like bkpf-gjahr,
end of objectid.
data: object_id like sapb-sapobjid.

..........
call function 'ARCHIVE_READ_OBJECT
..........

SAP AG 2002

SAP AG BC670 6-44


([DPSOH'LVSOD\$UFKLYHG2ULJLQDO 

do.
call function 'ARCHIVE_GET_NEXT_RECORD
........
case arc_buffer-rname.
when 'BKPF'.
bkpf = arc_buffer-segment.
........
endcase.
enddo.
..........
* Output data
write: / ' ', bkpf-bukrs, bkpf-belnr, bkpf-gjahr.
write: / sy-uline(105).
format color col_heading intensified.
write: / sy-vline,
2 Posting date,
16 sy-vline,
17 Local currency,
..........
SAP AG 2002

SAP AG BC670 6-45


([DPSOH'LVSOD\$UFKLYHG2ULJLQDO 

write: / sy-vline,
2 bkpf-budat,
16 sy-vline,
17 bkpf-hwaer,
..........
* Output archived original of document
* Construct key
move bkpf-bukrs to objectid-oidbukrs.
move bkpf-belnr to objectid-oidbelnr.
move bkpf-gjahr to objectid-oidgjahr.
object_id = objectid.

* Call function module ArchiveLink


call function ARCHIV_DISPLAY_META
exporting
sap_object = BKPF
object_id = object_id
exceptions
others = 1.
SAP AG 2002

SAP AG BC670 6-46


$GGHQGXP'LVSOD\LQJ$UFKLYLQJ&ODVVHV

l 'LVSOD\LQJDUFKLYLQJFODVVHVLVSRVVLEOHLQ6$3$6IURP
5HOHDVH$

l ,Q5HOHDVH%GLVSOD\RI33B25'(5LQ6$3$6LVDOUHDG\
LPSOHPHQWHG
l 3URJUDPPDEOHGLVSOD\IXQFWLRQVIRUDUFKLYQJFODVVHVZLWK
GLUHFWDFFHVVZLWKRXWXVLQJ6$3$6

Fill an index for the archived data or use a table in SAP AS

Implement a reporting program that accesses an individual document
in the archiving class using the index.

SAP AG 2002
1999

n For more information on the previous development of PM_ORDER, refer to SAP Note 135784.
Compare also Note 195425 for development regarding PM_ORDER, PM_QMEL,
SM_QMEL, and QM_QMEL.
n Further Notes on archiving classes in SAP AS:
183774, 181598, 156780

SAP AG BC670 6-47


6LQJOH'RFXPHQW$FFHVVWR$UFKLYLQJ&ODVVHV 

l 3URJUDP)LOO$'.LQGH[WDEOH

l )LOO

$UFKLYHBRSHQBIRUBUHDG

'R

w $UFKLYHBJHWBQH[WBREMHFW
w )XQFWLRQPRGXOHIRUUHDGLQJWKHFODVV!
)LOODFXVWRPHUVSHFLILFWDEOHZLWK$'.LQGH[YDOXHV

(QGGR

$UFKLYHBFORVHBILOH

SAP AG 1999
2002

n With the function module Archive_get_next_object, you can determine the archive key and the
offset of the document. Both of these are required for direct access to a document.
n With the help of the function module, which reads the archiving class, you obtain the information
that is required for an ADK-index.
n You then store the ADK-index information in a customer-specific table.

SAP AG BC670 6-48


6LQJOH'RFXPHQW$FFHVVWR$UFKLYLQJ&ODVVHV 

l 3URJUDP'LUHFWDFFHVVWRDGRFXPHQW

l )LOO

5HDGWKH$'.LQGH[WDEOH

$UFKLYHBUHDGBREMHFW

w )XQFWLRQPRGXOHIRUUHDGLQJWKHFODVV!
$UFKLYHBFORVHBILOH

SAP AG 1999
2002

SAP AG BC670 6-49


'LUHFW5HDG$FFHVV8QLW&RQFOXVLRQ

<RXDUHQRZDEOHWR
l ,QWHJUDWHDEXVLQHVVYLHZIRUDQ
DUFKLYLQJREMHFWLQ6$3$6
l ,QWHJUDWHGLVSOD\RIDUFKLYHGRULJLQDOV
IRUDQ5GRFXPHQWLQ6$3$6

SAP AG 2002

SAP AG BC670 6-50


([HUFLVHV

8QLW6$3$6%XVLQHVV9LHZV
7RSLF&UHDWLQJD%XVLQHVV9LHZIRU00B(%$1

At the conclusion of these exercises, you will be able to:


Display archived purchase requisitions via a business view in SAP AS

You have archived purchase requisitions and, in addition to the technical


views, the user department wants to have a business view

1-1 Create new function group ZBC670_xx. Here, create function module
ZZMM_EBANxx, using as a template ZZMM_EBAN00.
The function is part of Basis (Application S).

Create the following global data for the function module:

Table arc_buffer
Field handle like sy-tabix
Internal table i_eban like eban
Field ok-code like sy-ucomm

Familiarize yourself with the interface

1-1-2 Refresh table i_eban.

1-1-3 Call function module ARCHIVE_READ_OBJECT. The transferred object is


MM_EBAN. i_archive key and i_offset are also transferred. The function
module returns a handle.

1-1-4 In a loop, call ARCHIVE_GET_NEXT_RECORD. This transfers parts of


arc_buffer. The exception is end_of object. After calling the function module,
EXIT if the exception is fulfilled.

1-1-5 In a CASE structure, query the contents of ARC_BUFFER_RNAME and fill the
internal table i_eban with the data from ARC_BUFFER_SEGMENT.

1-1-6 Close the archive file

SAP AG BC670 6-51


1-1-7 Call screen 300 and create it using forward navigation.

1-1-8 Declare in PBO Module status_0300 that you want to make a list output, not
screen processing (suppress screen dialog and leave to list processing).

Set the PF-STATUS INLI

Create an empty PAI module status_0300 by double clicking. The module


involves no processing.

After module status_0300, call module display_liste_mm_eban.


Create this module using forward navigation, and output the data in it for
MM_EBAN

1-1-9 The list layout is as follows:

Line 1:
Position 2: Text Purchase requisition
Position 23: BANFN from table EBAN
Position 40: Text Document type
Position 50: BSART from table EBAN

Line 4:
Position 2: Text Purchase requisition items

Line 7
Position 4: Text Pos
Position 20: Text Material

Line 8
Position 20: Text Requested quantity

Line 10:
Position 4: BNFPO from table EBAN
Position 20: MATNR from table EBAN

Line 11:
Position 20: MNGE from table EBAN

2-1 Create an entry in table aind_str5 for your business view. Enter your function module.
Name your view View_xx , where xx is your group number.

3-1 Call the Archive Information System. Select as object MM_EBAN and view the
archived documents from the structure table.
Branch to the detail view by double clicking, and try to select your business view.

SAP AG BC670 6-52


8QLW6$3$6%XVLQHVV9LHZV
7RSLF'LVSOD\DQ$UFKLYHG2ULJLQDO /HWWHU LQ6$3$6

At the conclusion of these exercises, you will be able to:


Use SAP AS to display the optically archived original document for a
purchase requisition

The user department wants to see not only the purchase requisition, but
also the optically archived original document

1-1 Call your function module from the previous exercise.

2-1 Determine which business object in ArchiveLink belongs to a purchase requisition. The
document type used is called MYLETTER.

3-1 In the list output module, create a variable that reflects the key of the business object.
Create a second variable object_id , that links to sapb-sapobjid.

4-1 Supply your variable of the business object key with the field BANFN from table
EBAN and assign the variable to the variables object_id

5-1 At the end of your list output, call function module


ARCHIV_DISPLAY_META

Export parameter:
sap_object = <business object type defined >
object_id = Variable <object_id>

SAP AG BC670 6-53


6ROXWLRQV

8QLW%XVLQHVV9LHZVLQ6$3$6
7RSLF&UHDWLQJD%XVLQHVV9LHZIRU00B(%$1

1-1 Tools, ABAP Workbench, Overview, Object Navigator

From menu, choose: Workbench Edit Object Function Group Create.


Enter group name: ZBC670_xx

Switch to display for function group ZBC670_00


Expand function modules
Mark function module ZZMM_EBAN00
Right mouse click: Copy

Enter: ZZMM_EBANxx (xx represents your group number)


Function group: ZBC670
Button <Copy>

Double click ZZMM_EBANxx.

Create global data: From menu, choose Goto Global Data.


For data definition, see sample solution ZZMM_EBAN

1-1-2 to 1-1-9 see sample solution ZMM_EBAN

2-1 Call transaction 6(


Table: aind_str5, button <execute>
Button <create>
Object: MM_EBAN
Function: ZMM_EBANxx
Line: The instructor will give you this; must not be more that 15 per object
Text: BANF xx
Button <save>

3-1 Tools, Administration, Administration, Archiving, Button <Info system>,


Archive Explorer
Object: MM_EBAN
Archive info structure: ZAIMM_EBAN
Button <execute>
Double-click on a document number from the displayed list
Select your own business view

SAP AG BC670 6-54


)81&7,21==00B(%$1

 /RNDOH6FKQLWWVWHOOH
,03257,1*
5()(5(1&( ,B$5&+,9(.(< 7<3($'0,B),/(6$5&+,9B.(<
5()(5(1&( ,B2))6(7 7<3($5&+B,';2))6(7

WDEOHVDUFBEXIIHUHEDQJOREDOGHILQLHUW

GDWDKDQGOHOLNHV\WDEL[
UHIUHVKLBHEDQ

FDOOIXQFWLRQ
$5&+,9(B5($'B2%-(&7

H[SRUWLQJ
REMHFW 
00B(%$1

DUFKLYNH\ LBDUFKLYHNH\
RIIVHW LBRIIVHW
LPSRUWLQJ
DUFKLYHBKDQGOH KDQGOH
H[FHSWLRQV
RWKHUV 

LIQRWV\VXEUFLVLQLWLDO
PHVVDJHLGV\PVJLGW\SH
,
QXPEHUV\PVJQR
ZLWKV\PVJYV\PVJYV\PVJYV\PVJY
H[LW
HQGLI
GR

FDOOIXQFWLRQ
$5&+,9(B*(7B1(;7B5(&25'

H[SRUWLQJ
DUFKLYHBKDQGOH KDQGOH
LPSRUWLQJ
UHFRUG DUFBEXIIHUVHJPHQW
UHFRUGBVWUXFWXUH DUFBEXIIHUUQDPH
H[FHSWLRQV
HQGBRIBREMHFW 

LIV\VXEUF 
H[LW
HQGLI
FDVHDUFBEXIIHUUQDPH
ZKHQ
(%$1

LBHEDQ DUFBEXIIHUVHJPHQW
DSSHQGLBHEDQ

SAP AG BC670 6-55


HQGFDVH
HQGGR

FDOOIXQFWLRQ
$5&+,9(B&/26(B),/(

H[SRUWLQJ
DUFKLYHBKDQGOH KDQGOH

$XVJDEHGHU'DWHQEHU'\QSURPLW/LVWSURFHVVLQJ
FDOOVFUHHQ

(1')81&7,21

SAP AG BC670 6-56


Logic

352&(66%()25(287387
02'8/(67$786B
02'8/(GLVSOD\BOLVWHBPPBHEDQ
352&(66$)7(5,1387
02'8/(86(5B&200$1'B

02'8/(67$786B287387

VXSSUHVVGLDORJ
OHDYHWROLVWSURFHVVLQJDQGUHWXUQWRVFUHHQ

6(73)67$786
,1/,

6(77,7/(%$5
[[[


(1'02'8/(67$786B287387

0RGXOH',63/$<B/,67(B00B(%$1287387

WH[W

02'8/(',63/$<B/,67(B00B(%$1287387
ZULWH
%HVWHOODQIRUGHUXQJ

LBHEDQEDQIQ

%HOHJDUW

LBHEDQEVDUW

VNLS
ZULWH
%HVWHOODQIRUGHUXQJVSRVLWLRQHQ


VNLS
ZULWH
3RV


0DWHULDO

ZULWH
$QIRUGHUXQJVPHQJH


VNLS
ZULWHLBHEDQEQISR
LBHEDQPDWQU
ZULWHLBHEDQPHQJH

(1'02'8/(',63/$<B/,67(B00B(%$1287387


SAP AG BC670 6-57


0RGXOH86(5B&200$1'B,1387

WH[W

02'8/(86(5B&200$1'B,1387

(1'02'8/(86(5B&200$1'B,1387


0RGXOH86(5B&200$1'B,1387

WH[W

02'8/(86(5B&200$1'B,1387

(1'02'8/(86(5B&200$1'B,1387

SAP AG BC670 6-58


8QLW%XVLQHVV9LHZVLQ6$3$6
7RSLF'LVSOD\DQ$UFKLYHG2ULJLQDO /HWWHU LQ6$3$6

At the conclusion of these exercises, you will be able to:


Use SAP AS to display the optically archived original document for a
purchase requisition.

The user department wants to see not only the purchase requisition, but
also the optically archived original document

1-1 Call your function module from the previous exercise.

2-1 Determine which business object in ArchiveLink belongs to a purchase requisition. The
document type used is called MYLETTER.

(QWHUWUDQVDFWLRQ6(7DEOH72$6HDUFKIRUGRFXPHQWW\SH0</(77(5
7KHREMHFWW\SHWKDWLVVWRUHGLQWKHUHFRUGLVWKHRQHEHLQJVHDUFKHGIRU

3-1 to 5-1: See sample solution function module ZZMM_EBAN_ORIGINALE.

SAP AG BC670 6-59


)81&7,21==00B(%$1B25,*,1$/(

 /RNDOH6FKQLWWVWHOOH
,03257,1*
5()(5(1&( ,B$5&+,9(.(< 7<3($'0,B),/(6$5&+,9B.(<
5()(5(1&( ,B2))6(7 7<3($5&+B,';2))6(7


UHIUHVKLBHEDQ

GDWDEHJLQRIREMHFWLG
RLGEDQIQOLNHHEDQEDQIQ
HQGRIREMHFWLG
GDWDREMHFWBLGOLNHVDSEVDSREMLG

FDOOIXQFWLRQ
$5&+,9(B5($'B2%-(&7

H[SRUWLQJ
REMHFW 
00B(%$1

DUFKLYNH\ LBDUFKLYHNH\
RIIVHW LBRIIVHW
LPSRUWLQJ
DUFKLYHBKDQGOH KDQGOH
H[FHSWLRQV
RWKHUV 

LIQRWV\VXEUFLVLQLWLDO
PHVVDJHLGV\PVJLGW\SH
,
QXPEHUV\PVJQR
ZLWKV\PVJYV\PVJYV\PVJYV\PVJY
H[LW
HQGLI
GR
FDOOIXQFWLRQ
$5&+,9(B*(7B1(;7B5(&25'

H[SRUWLQJ
DUFKLYHBKDQGOH KDQGOH
LPSRUWLQJ
UHFRUG DUFBEXIIHUVHJPHQW
UHFRUGBVWUXFWXUH DUFBEXIIHUUQDPH
H[FHSWLRQV
HQGBRIBREMHFW 

LIV\VXEUF 

SAP AG BC670 6-60


H[LW
HQGLI
FDVHDUFBEXIIHUUQDPH
ZKHQ
(%$1

LBHEDQ DUFBEXIIHUVHJPHQW
DSSHQGLBHEDQ

HQGFDVH
HQGGR

FDOOIXQFWLRQ
$5&+,9(B&/26(B),/(

H[SRUWLQJ
DUFKLYHBKDQGOH KDQGOH

PRYHLBHEDQEDQIQWRREMHFWLGRLGEDQIQ
REMHFWBLG REMHFWLG

FDOOIXQFWLRQ
$5&+,9B',63/$<B0(7$

H[SRUWLQJ
VDSBREMHFW 
%86

REMHFWBLG REMHFWBLG
H[FHSWLRQV
RWKHUV 
LIV\VXEUFQH
H[LW
HQGLI

$XVJDEHGHU'DWHQEHU'\QSURPLW/LVWSURFHVVLQJ
FDOOVFUHHQ

(1')81&7,21

SAP AG BC670 6-61

También podría gustarte