REPORT Y9020026 LINE-SIZE 130. "Release 3.1G, 4.5A ************************************************************************ * Copyright (c) 1999 by CT-Team, 33415 Verl, http://www.ct-software.com * * You can use or modify this report for your own work as long * as you don't try to sell or republish it. * In no event will the author be liable for indirect, special, * Incidental, or consequental damages (if any) arising out of * the use of this report. * ************************************************************************ BREAK-POINT. *//////////////////////////////////////////////////////////////////////* MOVE: 'TESTREPORT for "ASSIGN IFeld+o(l) TO " ' TO SY-TITLE. *//////////////////////////////////////////////////////////////////////* *************** Declaration of variables ********************** FIELD-SYMBOLS . *....................................................................... SKIP. DATA: IFELD4(4) TYPE I VALUE '1022333'. "we let the 4 stay here *DATA: ZFELD1(2) TYPE N. "would all be mixed up because * "slack bytes (fill bytes) will * "be used, but no error is displayed * "Try it for yourself ! DATA: IFELDX(4) TYPE I VALUE '7777777'. DATA: IFELD6(4) TYPE I VALUE '7333213'. DATA: NFELDX(400) TYPE N. * DATA: OFFX TYPE I VALUE 412. DATA: LENX TYPE I VALUE 4. *//////////////////////////////////////////////////////////////////////* ************* - Main Section ******************* *//////////////////////////////////////////////////////////////////////* * BREAK-POINT. WRITE: /5 'Example 1 **** inadmissible ASSIGN ***' COLOR 6. WRITE: /10 'Inadmissible ASSIGN: ''ASSIGN IFELD4+1(3) TO '' '. * ASSIGN IFELD4+1(3) TO . *i This command will let to a runtime error, because an I field can *i only be accessed completely (with 4 bytes) ULINE. SKIP 2. ************************************************************************ * ASSIGN IFELD4+4(4) TO . *i What will be here assigned ? ************************************************************************ * BREAK-POINT. WRITE: / 'ASSIGN command with IFELD4, but instead IFELDX is assigned' COLOR 3. WRITE: /5 'Example 2'. PERFORM DISPLAY-IFELD USING IFELD4 'IFELD4'. WRITE: /10 'Content of IFELDX :', IFELDX. ULINE. SKIP 2. *----------------------------------------------------------------------- ASSIGN IFELD4+8(4) TO . ******************************* * here IFELD6 comes into play .. ******************************* ************************************************************************ * BREAK-POINT. WRITE: / 'ASSIGN mit IFELD4, but instead IFELD6 is assigned' COLOR 3. WRITE: /5 'Example 3'. WRITE: /10 'Content of IFELD6 :', IFELD6. PERFORM DISPLAY-IFELD USING IFELD4 'IFELD4'. WRITE: /10 'Content of IFELD6 :', IFELD6. ULINE. SKIP 2. *----------------------------------------------------------------------- ************************************************************************ * BREAK-POINT. SKIP. DO 1 TIMES. ASSIGN IFELD4+OFFX(LENX) TO . "<-- Zuordnung auf OFFX zu WRITE: / 'ASSIGN command with IFELD4, but OFFX will be assigned' COLOR 3. WRITE: /5 'Example 4'. PERFORM DISPLAY-IFELD USING IFELD4 'IFELD4'. ULINE. SKIP 2. ADD 4 TO OFFX. ENDDO. *----------------------------------------------------------------------- *----------------------------------------------------------------------- * *//////////////////////////////////////////////////////////////////////* ************* Subroutines ******************* *//////////////////////////////////////////////////////////////////////* * ************************************************************************ * Display of data fields and field symbols * ************************************************************************ FORM DISPLAY-IFELD USING IFELD FNAME. * WRITE: /10 'Content of', FNAME, ':', IFELD. PERFORM FELDEIGENSCHAFTEN USING IFELD. * WRITE: /10 'Content of :', . PERFORM FELDEIGENSCHAFTEN USING . *----------------------------------------------------------------------- ADD 111 TO . "<-- The fieldsymbol will be used *----------------------------------------------------------------------- WRITE: /10 'ADD 111 TO '. ULINE. *....................................................................... WRITE: /10 'Content of', FNAME, 35 ':', IFELD. WRITE: /10 'Content of ', 35 ':', . *....................................................................... ENDFORM. ************************************************************************ * Determination of field properties (only for information) * ************************************************************************ FORM FELDEIGENSCHAFTEN USING ALLG. * DATA: FLAENGE(2) TYPE N. DATA: FTYP(1) TYPE C. DATA: FOUT(2) TYPE N. DATA: FDEZ(2) TYPE N. *....................................................................... ULINE. DESCRIBE FIELD ALLG LENGTH FLAENGE. WRITE: /10 'Field length :', FLAENGE. * DESCRIBE FIELD ALLG TYPE FTYP. WRITE: /10 'Field type :', FTYP. * DESCRIBE FIELD ALLG OUTPUT-LENGTH FOUT. WRITE: /10 'Output length :', FOUT. * DESCRIBE FIELD ALLG DECIMALS FDEZ. WRITE: /10 'Decimals :', FDEZ. SKIP 1. *....................................................................... ENDFORM. ************************************************************************ ************************************************************************ ******************* END OF PROGRAM *************************************