Entering content frameArchiving Lists Using SAP ArchiveLink Locate the document in its SAP Library structure

This section describes how to archive ABAP lists with SAP ArchiveLink. Archiving lists is not linked to a special application; it is available for any list created using a report, unless archiving is carried out internally by the report.

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 read the documentation about SAP ArchiveLink in Structure link Archiving 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 archive 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 in one of two ways:

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:

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:

Archiving ABAP lists is cross-application. No actions are needed apart from making the settings described in the SAP ArchiveLink documentation in Structure link Basic Customizing. If however, you want to archive an ABAP list specifically for one application, you must follow the instructions in the relevant sections of Structure link 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.

Archiving an ABAP List: Example Program

Example Program:

Start with the following example:

Example

REPORT demo_list_print_control_2.

PARAMETERS number TYPE i.

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'.
PRINT-CONTROL INDEX-LINE dkey.

CLEAR dkey.

dkey ='DKEYNumber'.
dkey+44 = '3'.
dkey+47 = '4'.
PRINT-CONTROL INDEX-LINE dkey.

index = 0.

DO number TIMES.

  index = index + 1.
  IF index = 100.
    numb = sy-index / 100.
    WRITE numb TO num LEFT-JUSTIFIED.
    CONCATENATE 'DAIN' 'IDX' num INTO dain.
    PRINT-CONTROL INDEX-LINE dain.
    index = 0.
  ENDIF.

  square = sy-index ** 2.
  WRITE: / sy-index, square.

ENDDO.

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.

PRINT-CONTROL INDEX-LINE <f>.

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 Edit ® Attribute Search in the ArchiveLink Viewer, you must insert specific index lines <f> that follow a special naming convention (for more information, see Structure link Indexing Print Lists).

If the user chooses Execute + print on the selection screen and stores the print request in the spool system, the user can then view the request using System ® Services ® Print requests.

This graphic is explained in the accompanying text

The first two lines are DKEY index lines. They define the structure of the following DAIN index lines.

For example, around line one hundred, the list looks like this:

This graphic is explained in the accompanying text

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.

Archiving the Output List

To archive the output list you must send it to the spool system. This means that the list must be "printed", where you have to fill in the fields for spool administration 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:

the list. 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. Using the possible entries help if necessary, choose a document type that suits 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

You can display the archived list as follows:

  1. In the SAP R/3 System initial screen, choose Office Business documents Lists.
  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 Edit Search by attribute. In this example, the list contains an index line every 100 lines, with the following entries:

Name

Value

Index

IDX

Number

Current 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.

Leaving content frame