Show TOC

Background documentationfield-set Macro Locate this document in the navigation structure

 

You use the field-set macro to assign values to ITS variables in the active context. This allows you to set the values of a single variable (especially if that variable contains a large amount of data) or build up an array of values from one column of a table.

Typically, you set these values in the PBO module of a transaction when you are preparing data for display. You can even make multiple field-set calls in separate PBO modules.

Syntax Syntax

  1. field-set
    contextfield-name     (in, CHAR)
    contextfield-index    (in, NUM)
    contextfield-value    (in, CHAR)
End of the code.
Parameters

Parameter

Description

contextfield-name

Context field name.

contextfield-index

Context field index.

contextfield-value

Context field value.

Example

Suppose you are processing an internal table, which has the following structure and contents:

Syntax Syntax

  1. MATNO   QTY   DESC
    1234     1    10 mm drill bit
    5678     1    Drill bit case
End of the code.

You can define the contents of this table to the ITS with the following ABAP code:

Syntax Syntax

  1. data counter type i.
       counter = 1.
    
       loop at matinfo.
          field-set ‘matinfo-matno’ counter matinfo-matno.
          field-set ‘matinfo-qty’   counter matinfo-qty.
          field-set ‘matinfo-desc’  counter matinfo-desc.
          add 1 to counter.
       endloop.
    
End of the code.

The variable name you use as the first parameter can be any name you like. This is the name used by the ITS to identify the variable

For performance reasons, field-set calls are first buffered on the application server. To transfer all data accumulated by field-set calls to the ITS, you use the field-transport macro.

Note Note

  • One column of an ABAP table corresponds to one ITS array. The ITS can only store one-dimensional arrays, not the multi-dimensional structure of an ABAP table. For this reason, the name you choose for the parameter should reflect both the ABAP table name and the column name.

  • ITS array indexes start at 1, not 0.

  • You can have two ITS arrays derived from the same ABAP table (for example, books-isbn and books-title) that have unequal numbers of elements.

End of the note.