Show TOC

Converting the Data Containers TOTAL and EXTRACTLocate this document in the navigation structure

Use

Like all view maintenance global parameters, the data containers TOTAL and EXTRACT are available in functional enhancements (events and user modules in the maintenance screens).

The data container structure is retained. Otherwise, non-Unicode systems would also have had to be converted. You can also use the internal tables viewname_TOTAL and viewname_EXTRACT as before. The access to the data must be changed.

Before Unicode

These two global internal tables are not typed in the generic coding. At runtime, they have the same structure. It depends on the maintenance object and the environment:

The two data containers are only structured like the maintenance object for a maintenance view (maintenance object of type V) at runtime, if the dialog is called via transaction SM30 or the function modules VIEW_MAINTENANCE or VIEW_MAINTENANCE_CALL:

DATA:      BEGIN OF TOTAL,
INCLUDE STRUCTURE viewname,
INCLUDE STRUCTURE vimflagtab,
END OF TOTAL.
            

VIMFLAGTAB comprises two flags, MARK and ACTION which show the processing status of the entry.

If the maintenance dialog for a maintenance view is called from a view cluster, the data container is a long field of type C:

DATA:      BEGIN OF TOTAL,
LINE TYPE c,*(Länge abh. von Viewlänge)
END OF TOTAL.
            

The data is then arranged as follows:

TOTAL/EXTRACT
View    |ACTION|MARK
            

For a table with or without text table (maintenance object of typ S), the data container is also a long field of type C

DATA:      BEGIN OF TOTAL,
LINE TYPE c, *(Länge abh. von Tabellenlänge)
END OF TOTAL.
            

With the following data sequence for a table:

TOTAL/EXTRACT
Tabelle |ACTION|MARK
Und für eine Tabelle mit Texttabelle:
TOTAL/EXTRACT
Tabelle | Texttabelle |ACTION|MARK |ACTION_TEXT
            

Example: Access to individual fields from the headers of TOTAL and EXTRACT

Before UNICODE

Previously individual or sets of fields in the data containers were often accessed by MOVE or ASSIGN with position and length values from the internal table X_NAMTAB. The offsets were got from the Dictionary.

DATA: fieldname TYPE fieldname.
FIELD-SYMBOLS: <fs> TYPE ANY.
...
READ TABLE x_namtab WITH KEY viewfield = fieldname.
ASSIGN total+x_namtab-position(x_namtab-flength) TO <fs> TYPE x_namtab-inttype.
...
            

After conversion to Unicode

The length and position values are no longer needed when you use the new field symbols <VIM_TOTAL_STRUC> and <VIM_EXTRACT_STRUC> which are structured according to the table/view:

DATA: fieldname TYPE fieldname.
FIELD-SYMBOLS: <fs> TYPE ANY.
...
ASSIGN COMPONENT fieldname OF STRUCTURE <vim_total_struc> TO <fs>.
...
            

The field symbols <VIM_TOT_TXT_STRUC> and <VIM_EXT_TXT_STRUC> are analogous for text tables in a customizing object of type S:

Example: Field assignments to the structure

Before UNICODE

MOVE viewname TO TOTAL.
MOVE TOTAL TO viewname.
            

No longer works under Unicode as soon as TOTAL is of type C and viewname contains non-character fields.

After conversion to Unicode

The standard uses only the new field symbols <VIM_TOTAL_STRUC> and <VIM_EXTRACT_STRUC> for field assignments (see 6.1.2.2).

Example:

MOVE <VIM_EXTRACT_STRUC> TO <TABLE1>.

Example: Standard database access routines

Before UNICODE

Depending on whether a table or a view is maintained, the database access is by generic or generated routines. They were centrally processed or regenerated, but in some cases users have copied them and put them in functional enhancements (view maintenance events AA - AH) so that they must be converted manually.

For example

SELECT * FROM (Tabelle) INTO TABLE TOTAL WHERE ...
            

is no longer possible in a Unicode system. The routines also contain a lot of field assignments which are forbidden under Unicode.

The problems are solved by regeneration or changes to the generic coding. Users must also take action in the use of the view maintenance events AA - AH.

After conversion to Unicode

Proceed as follows:

DATA: primtab TYPE TABLE OF (Tabelle).
...
SELECT * FROM (Tabelle) INTO TABLE primtab
WHERE ...
...
LOOP AT primtab INTO <vim_total_struc>.
APPEND total.
ENDLOOP.
            

Example: Read a row

Before UNICODE

READ TABLE TOTAL WITH KEY <xyz> BINARY SEARCH.
            

<xyz> is a field symbol of type C <VIM_TOTAL_KEY>, <VIM_EXTRACT_KEY>, or <F1>. This is particularly critical if the key contains non-character fields.

After conversion to Unicode

The above field symbols are no longer used in the standard. The key should comprise hexadecimal fields (e:g. <VIM_XTOTAL_KEY>, <VIM_XEXTRACT_KEY>, or <F1_X>).

Example

READ TABLE TOTAL WITH KEY <vim_xextract_key> BINARY SEARCH.