REPORT Y9020021 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 "ASSIGN NFeld+o(l) TO " ' TO SY-TITLE. *//////////////////////////////////////////////////////////////////////* *************** Declaration of variables ********************** FIELD-SYMBOLS . *....................................................................... DATA: NFELD7(7) TYPE N VALUE '345678'. DATA: NFELD15(15) TYPE N VALUE '777777700002222'. DATA: NFELD25(25) TYPE N VALUE ' 33333 111111 44444 77'. * DATA: OFFX TYPE I VALUE 0. DATA: LENX TYPE I VALUE 5. * *//////////////////////////////////////////////////////////////////////* ************* - Main Section ******************* *//////////////////////////////////////////////////////////////////////* * SKIP. ASSIGN NFELD7+2(5) TO . "ok *i A part of NFELD7 will be assign to field symbol . *....................................................................... BREAK-POINT 'Example-1'. WRITE: / 'ASSIGN command with NFELD7' COLOR 4. PERFORM DISPLAY-NFELD USING NFELD7 'NFeld7'. ULINE. SKIP 2. *----------------------------------------------------------------------- ASSIGN NFELD15+2(5) TO . "<-- A part of NFELD will be assigned *....................................................................... BREAK-POINT 'Example-2'. WRITE: / 'ASSIGN command with NFELD15' COLOR 5. PERFORM DISPLAY-NFELD USING NFELD15 'NFeld15'. ULINE. SKIP 2. *----------------------------------------------------------------------- ASSIGN NFELD25+2(5) TO . "<-- A part of NFELD will be assigned *....................................................................... BREAK-POINT 'Example-3'. WRITE: / 'ASSIGN command with NFELD25' COLOR 6. PERFORM DISPLAY-NFELD USING NFELD25 'NFeld25'. ULINE. SKIP 2. *----------------------------------------------------------------------- *...................... a little complicated ........................... BREAK-POINT 'Example-4'. SKIP. WRITE: / 'ASSIGN command (Offset and length as fields) with NFELD25'. NFELD25 = '1111122222333334444455555'. DO 5 TIMES. WRITE: /5 'DO loop number:' COLOR 5, SY-INDEX. ASSIGN NFELD25+OFFX(LENX) TO . PERFORM DISPLAY-NFELD USING NFELD25 'NFeld25'. SKIP 4. ADD 5 TO OFFX. * ADD 1 TO LENX. ENDDO. *....................................................................... * In this loop the NFELD25 will be assigned bit by bit to the * field symbol , after that the field symbol will be changed * in another subroutine. You see that NFELD25 will be also changed. * *//////////////////////////////////////////////////////////////////////* ************* Subroutines ******************* *//////////////////////////////////////////////////////////////////////* * ************************************************************************ * Display of C fields and field symbols * ************************************************************************ FORM DISPLAY-NFELD USING NFELD FNAME. * WRITE: /10 'Content of', FNAME, ':', NFELD. PERFORM FELDEIGENSCHAFTEN USING NFELD. * WRITE: /10 'Content of aufgrund der Teilzuordnung :', . PERFORM FELDEIGENSCHAFTEN USING . *----------------------------------------------------------------------- MOVE 88880 TO . "<-- Das Feldsybmol wird verwendet *----------------------------------------------------------------------- WRITE: /10 'MOVE 88880 TO '. ULINE. *....................................................................... WRITE: /10 'Content of', FNAME, 35 ':', NFELD. 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 3. *....................................................................... ENDFORM. ************************************************************************ ************************************************************************ ******************* END OF PROGRAM *************************************