Structure Definition 

Definition

The Interface Toolbox generates a corresponding field string in the second include for each defined structure. This then generates the conversion program for the file layout. You can call each field assigned to a structure, using <structure name>-<field name>.

Use

You have defined the STRUCTURE 01 structure. If you have assigned the NAME (constant length: 24) and GENDER (Constant length: 6) fields to the structure, the system generates the following coding:

 

     DATA: BEGIN OF STRUCTURE_01,

             NAME(000024) TYPE C,

             GENDER(000006) TYPE C,

     END OF STRUCTURE_01.

 

You can use the generated structure information for the User Exit After structure function in the user-defined form routine. If the field content is redefined and the value 1 is returned, the Interface Toolbox will write the structure to the interface block buffer without updating &VAR-VALUE (&VAR-VALUE contains the content of the current structure).

 

REPORT ZUSER_EXITS.

INCLUDE ZPCIFT01.

FORM EXAMPLE_STRUCTURE USING PAR_01

                             PAR_02

                             PAR_03

                             PAR_04

                             PAR_05

                             PAR_06

                             PAR_07

                             PAR_08

                             PAR_09

                             PAR_10

                             PAR_11

                             PAR_12

                             PAR_13

                             PAR_14

                             PAR_15     "Input parameters 1 - 15

                             RETURN_VALUE.    "Return parameter

   RETURN_VALUE = `1`.

READ TABLE P0002 INDEX 1.

CONCATENATE P0002-NACHN

               P0002-VORNA

               INTO STRUCTURE_01-NAME

      SEPARATED BY `,`.

   IF P0002-GESCH = `1`.

      STRUCTURE_01-GENDER = `MALE`.

   ELSE.

      STRUCTURE_01-GENDER = `FEMALE`.

   ENDIF.

ENDFORM.

 

Legend

If James is the value for P0002-VORNA, Bond is the value for P0002-NACHN and 1 is the value for P0002-GESCH, then the following entry is made in the BLOCKS_OUTPUT interface format block buffer:

SNAME

LENTH

VALUE

STRUCTURE_01

30

Bond, James MALE