SAP NEWS-30-LIST



Get Example source ABAP code based on a different SAP table
  



List Processing in ABAP Release 3.0
ITOC

ABAP_MODIFICATION_NN WRITE and ULINE with Variable Position and Length Specifications

In WRITE and ULINE, the addition AT is not available which allows dynamic position and/or length specifications.



Example ABAP Coding

ABEXA 01146
ABAP_EXAMPLE_END

ABAP_MODIFICATION_NN Variable Format Specifications with FORMAT, WRITE, MODIFY LINE

In FORMAT, WRITE, and MODIFY LINE, it is not possible to use variables to give parameters to all format specifications (INPUT , INTENSIFIED, INVERSE, and COLOR). In any of these additions, a = is followed by the variable.



Example ABAP Coding
DATA: COL TYPE I,
INT TYPE I,
F(20) VALUE 'Test output'.

IF < condition>.
INT = 1.
COL = 5.
ENDIF.

WRITE F COLOR = COL INTENSIFIED = INT INPUT ON.
FORMAT COLOR = COL INTENSIFIED = INT.
ABAP_EXAMPLE_END


ABAP_MODIFICATION_NN Saving Lists

ABAP lists can now be saved as objects known as list objects.
To save the basic list or the details list of the current application, the function module 'SAVE_LIST' is used. This function module passes the required list as a list object to an internal table of the structure ABAPLIST. Alternatively, the basic list of a report can be passed to the user memory instead of the display by SUBMIT ... EXPORTING LIST TO MEMORY , and then, after returning from the report, be retrieved as a list object by the function module 'LIST_FROM_MEMORY'. The list object can be saved like any other internal table (in a database or file system, for example).
For further processing, use the function modules 'WRITE_LIST' (output a list object as a list), 'DISPLAY_LIST' (output a list object in a dialog box), and any existing or planned converters (' LIST_TO_ASCI', 'LIST_TO_RTF', and so on).
In SAPoffice, any displayed list can be saved in the private folders (SAPoffice) of the currently logged on user by choosing System -> List Save (SAPoffice). More functions are planned.

ABAP_MODIFICATION_NN Exit List and Return to the Selection Screen

When the list display of a report is exited, the selection screen of the report is displayed again. The entries made on the selection screen are preserved. As a prerequisite, the selection screen has not been suppressed by the request (SUBMIT...VIA SELECTION-SCREEN). The list can be exited by
F3 / going back to the basic list of the report
F15 / exiting any list of the report
the programmed function LEAVE SCREEN in the application program



Latest notes:

For reasons of compatibility, the function LEAVE does not offer this function. Instead, ABAP_RELEASE 3.0 includes a special variant LEAVE LIST-PROCESSING.
ABAP_HINT_END

ABAP_MODIFICATION_NN SET CURSOR and GET CURSOR with Addition LINE... (without FIELD)

The functions SET CURSOR LINE and GET CURSOR LINE enable the cursor to be positioned or the cursor position to be determined in lists at line level. This is useful in cases where the whole list line (and not the field within the line) is relevant. Previously, the syntax rules required the addition FIELD to be used.



Latest notes:

In general, the function GET CURSOR LINE l OFFSET o should be used when the absolute cursor position (column) within a list line is evaluated during an interactive list event. The system field SY-CUCOL does not refer to the list line, but to the displayed list section. After horizontal scrolling, the relative cursor position ( SY-CUCOL) and the absolute cursor position are different. Furthermore, the system field SY-CUCOL contains the value 2 if (for reasons of compatibility) the cursor is on the first visible list column, which makes the calculation of the absolute position difficult.
ABAP_HINT_END



Example ABAP Coding

The following example shows how the previous usage of SY-CUCOL can be replaced by the function GET CURSOR:
ABEXA 01147
ABAP_EXAMPLE_END

ABAP_MODIFICATION_NN Handling of EXIT in List Events

The function EXIT now has the same effect in all list events (AT LINE-SELECTION, AT USER-COMMAND , AT PF..., TOP-OF-PAGE ..., and END-OF-PAGE) as in MODULE, FORM, and FUNCTION. The event therefore ends immediately and the processing continues at the call location (for example, after EXIT from TOP-OF-PAGE, the triggering statement WRITE is executed; after EXIT from AT LINE-SELECTION, the list is displayed immediately). Previously, the list was displayed here in both cases (the triggering WRITE was ignored) and, if there was also indented list processing ( LEAVE TO LIST-PROCESSING from CALL SCREEN), the entire list processing was terminated.



Latest notes:

This change has the following consequence: In report processing ( with a logical database ), EXIT from TOP-OF-PAGE and END-OF-PAGE previously terminated processing of the logical database and branched directly to the list display. Now, only the event TOP-OF-PAGE or END-OF-PAGE is terminated. Any remaining logical database events ( START-OF-SELECTION, GET, and so on) are not affected by this change.
ABAP_HINT_END

ABAP_MODIFICATION_NN SET PF-STATUS SPACE Activates Standard List Status

If a standard list status (STLI, PICK, or INLI) is required in list processing, but a dialog with a separate user interface is needed first, this is made possible by using SET PF-STATUS SPACE (when creating the list).
Previously, this was only possible by copying the standard list status to a separate PF status.

ABAP_MODIFICATION_NN Fixed List Columns when Displaying a List (Leading Column)

SET SCROLL-BOUNDARY enables the area of a list page affected by horizontal scrolling to be restricted. NEW-LINE NO-SCROLLING can be used to flag individual list lines as unmovable.

ABAP_MODIFICATION_NN New Behavior of SKIP at End of Page

Previously, if SKIP occurred at the end of a page and there was a fixed number of lines per page (as defined by NEW-PAGE LINE-COUNT), a new page was started and the blank line was displayed as the first line of that new page (after TOP-OF-PAGE).
This produced unwanted line shifts on a new page, although the only purpose of SKIP was to separate different areas of the list. Therefore, SKIP is no longer executed on the next page unless explicitly requested by NEW-PAGE.

ABAP_MODIFICATION_NN New Additions with WRITE $[TO$] for Alignment

WRITE now has the additions LEFT-JUSTIFIED , CENTERED, and RIGHT-JUSTIFIED for left-aligned, centered, or right-aligned output. They can be used in output to lists and for string processing with WRITE ... TO. In the first case, the alignment refers to the output field in the list. In the latter case, it refers to the target field specified after TO .

ABAP_MODIFICATION_NN Field Help (F1) and Input Help (F4) Now Also in LIKE Fields

Previously, field help (F1) and input help (F4) were only available for fields which had a direct reference to a data element (usually table fields). Now this is supported for work fields that refer to a table field with DATA ... LIKE as well. This of course also applies to field symbols and parameters of subroutines.

ABAP_MODIFICATION_NN GET CURSOR on Field Symbols and Literals

The function GET CURSOR FIELD now always returns the name of a global symbol, in other words, a field that is still valid when the list is displayed. Names of field symbols and local variables are invalid in this context.
For field symbols and reference parameters of subroutines, the function returns the name of the global symbol that may have been assigned when the list was displayed. For literals, the return code is no longer set to 4 and the field name becomes SPACE and the return code 0. The content of the literal is returned as ... VALUE.

ABAP_MODIFICATION_NN System Tables %_LIST ... Protected Against Access

Previously it was possible to directly address the system tables of list processing (%_LIST, ) in all ABAP programs and in debugging. This is no longer possible. The most common reason for wanting to do this (determining the number of lines in a list with DESCRIBE TABLE %_LIST LINES lin) can now be achieved by using DESCRIBE LIST NUMBER OF LINES lin • SY-LSIND.

ABAP_MODIFICATION_NN Symbols in Lists

WRITE with the addition '...AS SYMBOL' is now used to display certain characters in a list as symbols.



Example ABAP Coding

ABEXA 01148
ABAP_EXAMPLE_END

ABAP_MODIFICATION_NN Hotspots in Lists

By using the addition '...HOTSPOT' with the statements FORMAT and WRITE, it is now possible to define particular areas in a list as hotspots.
Clicking once with the mouse in one of these areas triggers the same response as placing the cursor on the clicked position in the list and then pressing the function key F2 (in other words a double-click is achieved with a single click).



Example ABAP Coding

ABEXA 01149
ABAP_EXAMPLE_END

ABAP_MODIFICATION_NN Output of QUAN Fields (WRITE Addition UNIT)

WRITE now has the addition UNIT which enables quantity fields to be formatted by unit. Quantity fields are packed fields and usually have the type QUAN in ABAP Dictionary. Apart from their defined number of decimal places, they can be formatted by the unit specified in UNIT, for example, for item specifications without decimal places .