Show TOC

Archiving Lists with SAP ArchiveLinkLocate this document in the navigation structure


This section describes the archiving of ABAP lists using SAP ArchiveLink . Storing lists is not connected to a certain application and therefore possible for any list created using an executable program (exception: if the executable program internally forbids archiving).

The system creates lists automatically from the print spool. Thus, you can only archive print lists. You can however convert screen lists to print lists retrospectively.

For more information on archiving lists, refer to the SAP ArchiveLink documentation in the chapter Storing Print Lists .

Screen Lists

If you run a report by choosing Execute , not Execute and Print , the list is displayed on screen (unless the report itself includes an explicit command to output a print list).

In general, screen lists are formatted specifically for screen display -that is, they are endless lists (with an internal limit of 60000 lines) without either page breaks or a page width specified for a specific print format.

Screen lists can also be interactive. For example, if the application is so programmed, you can double-click a line and then create a detail list.

By choosing Print you can send the screen list to the spool system. In the Print list dialog box that appears, you can store the list in an external archiving system. The system then converts the screen list to a print list retrospectively.

Information may be lost during this conversion, since the screen list is adjusted to the print format retrospectively (for example, the list may be cut off on the right hand side, or page breaks may occur at unsuitable points in the list). In the worst case scenario, the system may be unable to print the screen list at all.

Screen lists cannot contain index lines, which means that you cannot perform indexed searches (searches by attribute) on archived screen lists.

Print Lists

Print lists are lists archived in the spool system by ABAP. Lists are stored temporarily in the spool system and then sent to the physical printer or archived.

You can create a print list by:

  • Creating a Print List while the Program is Being Executed

  • Creating a Print List After the Program has been Executed

Creating a Print List while the Program is Being Executed

To create a print list while the program is being executed, you have three options:

  • Directly in the ABAP program, with little or no input from the user

  • By choosing Execute and print from the selection screen

  • By including a report in a background job

In these cases, the list does not appear on the screen. In the Print list output dialog box that appears, you can choose to archive the list (unless the program includes a statement that explicitly turns this option off). The list is formatted appropriately for the printer while it is being created. It is thus very unlikely that information will be lost. An internal mechanism ensures that there are no parameter conflicts in such lists.

Print lists created while the program is running can contain index lines, which means that you can use indexed searches (searches by attributes) in an archived list.

Creating a Print List After the Program has been Executed

In this case, the system sends a complete screen list to the spool system. The screen list is formatted appropriately for the printer afterwards, which means that information may be lost or that the system may be unable to print the list.

You can archive print lists saved to the spool system. The print list is archived in SAP ArchiveLink in the format applied to it in the spool system

Archiving: Technical Implementation

The technical implementation of archiving of ABAP lists consists of:

  • Creating the print list

  • Specifying print and archiving parameters internally

  • Creating index lines for archiving

Archiving ABAP lists is cross-application. Apart from the settings described in the SAP ArchiveLink documentation in the chapter Basic Customizing , you do not have to carry out any other steps. If however, you want to archive an ABAP list specifically for one application, you must follow the instructions in the relevant sections of BC - SAP ArchiveLink -Application Scenarios .

Exactly how you use the archiving facility depends on the specific report you are using. In general, you choose the Print function at a certain point. In the Print list output dialog box, you can then choose to archive the list as well. Depending on the report itself, the fields in this dialog box may be read-only, ready for input or filled with a default value. In principle, lists are formatted as print lists in the spool system and then sent to the archive.

Example of Archiving an ABAP List

Example Program

The following example program serves as a starting point:


REPORT demo_list_print_control_2.
DATA: index TYPE i, square TYPE i, numb TYPE i, num(4) TYPE c,
dkey(100) TYPE c, dain(100) TYPE c.
dkey ='dkeyIndex'.
dkey+44 = '0'.
dkey+47 = '3'.
CLEAR dkey.
dkey ='dkeyNumber'.
dkey+44 = '3'.
dkey+47 = '4'.
index = 0.
DO number TIMES.
index = index + 1.
IF index = 100.
numb = sy-index / 100.
CONCATENATE 'dain' 'IDX' num INTO dain.
index = 0.
square = sy-index ** 2.
WRITE: / sy-index, square.



The example report does not access the database. It displays a list of square numbers using a DO loop. The user can specify the number of loop passes in the input field NUMBER on the selection screen.

The PRINT-CONTROL statement creates a index line for archiving ( dain line) once every hundred lines. The structure of the dain lines is defined in two dkey lines at the start of the list.

You use the PRINT-CONTROL statement to insert the index lines for archiving in a list.


This statement writes the contents of field f into an index line after finishing the current print line. The system stores this index line in the spool file. The index line is not printed.

During optical archiving, the spool system divides the list into a data file and a description file. Data files contain the actual data information (print lists). Description files contain the index information.

The ArchiveLink Viewer provides the function Attribute Search to search for index lines in archived lists. This additional search can be important for performance when searching in very long lists. To enable the function Start of the navigation path Edit Next navigation step Attribute Search End of the navigation path in the ArchiveLink Viewer, you must insert specific index lines f that follow a special naming convention (for more information, see Indexing Print Lists ).

If the user chooses Execute and Print on the selection screen and stores the print request in the spool system, the user can then view the request using Start of the navigation path System Next navigation step Services Next navigation step Print Control End of the navigation path.

The first two lines are dkey index lines. They define the structure of the following dain index lines.

A dain index line is inserted every hundred lines. The first dain index has the name 'Index'. It starts at position 0, has a length of 3, and contains the value 'IDX'. The second dain index has the name 'Number'. It starts at position 3, has a length of 4 and contains the value 1 in front of line 100 (it contains the value 2 in front of line 200, and so on).

The index lines are only taken into account if the list is sent to the spool system while the report is running ( Execute and print on the selection screen). If the list is archived after the report has been executed (that is, if you choose Print on the screen list), the index lines are not taken into account.

Storing the Output List

To store the output list, you must send it to the spool system. This means the list must be printed. Note, however, that you must enter specific values in the spool administration fields in the Print list output dialog box:

In particular, you must enter a printer when archiving. The print list, and hence the archived list, is formatted specifically for this printer.

Using the possible entries help for the input field Archiving mode , you can have the list:

  • Printed only

  • Archived only

  • Printed and archived

After choosing Archive or Print and archive , followed by Continue , you can start the archiving process by choosing Print from the Print list output dialog box. The Archive Parameters dialog box appears. Make the necessary entries as follows:

  1. Using the possible entries help if necessary, choose an object type and document type.

  2. Use the possible entries help for the Document Type field to choose a suitable document type for the object type.

  3. In the Information field, enter a three-digit information key.

  4. You can enter any text you like in the text field.

To start the archiving process, choose Archive.

The output list is now archived.

Displaying the Archived List

To display the archived list, proceed as follows:

  1. In the SAP System initial screen, choose Start of the navigation path Office Next navigation step Business documents Next navigation step Lists End of the navigation path.

  2. Enter the appropriate search information on the selection screen (in our example, the name of the report).

  3. Choose Execute . The system displays all the of archived lists that meet your selection criteria.

  4. Select a list and choose, for example, Display from archive system. The system displays the archived list.

  5. If the list contains index lines, you can search for them using Start of the navigation path Edit Next navigation step Search by attribute End of the navigation path. In this example, the list contains an index line every 100 lines, with the following entries:






    Sequence number of index lines

    You can use the search by attribute function to navigate to line 100, 200, 300, and so on. The index lines themselves are not displayed. You can only use Search by attribute if the list was sent to the spool system while the program was running. Search by attribute is not available if the list was displayed first, then archived afterwards.