REPORT Y9020020 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 CFeld+o(l) TO " ' TO SY-TITLE. *//////////////////////////////////////////////////////////////////////* *************** Deklaration of variables ********************** FIELD-SYMBOLS . *....................................................................... DATA: CFELD7(7) TYPE C VALUE 'AUGUST'. DATA: CFELD25(25) TYPE C VALUE 'EGON, Hugo, heinrich'. DATA: CFELD50(50) TYPE C VALUE 'This is a small test string 123 ABCDE'. * DATA: OFFX TYPE I VALUE 4. DATA: LENX TYPE I VALUE 5. * *//////////////////////////////////////////////////////////////////////* ************* Main Section ******************* *//////////////////////////////////////////////////////////////////////* * SKIP. ASSIGN CFELD7+2(5) TO . "=ok * Only a part of CFELD7 (CFIELD7) is assigned to field symbol . * *############ you can uncomment the following command ############ * ASSIGN CFELD7+32(5) TO . * *i In this suggestion the field symbol points already to *i another variable (CFELD50) und this is in the most cases not wanted *i *############ you can uncomment the following command ############ * ASSIGN CFELD7+2 TO . * *i Here the field CFELD7 with a length of 7 Bytes would be assigned to *i the field symbol . The result can be a change of a foreign *i memory area !! *####################################################################### *....................................................................... BREAK-POINT 'Example-1'. WRITE: / 'ASSIGN command with CFELD7' COLOR 6. PERFORM DISPLAY-CFELD USING CFELD7 'CFeld7'. ULINE. SKIP 2. *----------------------------------------------------------------------- ASSIGN CFELD25+2(5) TO . "<-- A part of CFELD is assigned *....................................................................... BREAK-POINT 'Example-2'. WRITE: / 'ASSIGN command with CFELD25' COLOR 6. PERFORM DISPLAY-CFELD USING CFELD25 'CFeld25'. ULINE. SKIP 2. *----------------------------------------------------------------------- ASSIGN CFELD50+2(5) TO . "<-- A part of CFELD is assigned *....................................................................... BREAK-POINT 'Example-3'. WRITE: / 'ASSIGN command with CFELD50' COLOR 6. PERFORM DISPLAY-CFELD USING CFELD50 'CFeld50'. ULINE. SKIP 2. *----------------------------------------------------------------------- *...................... a little complicated ........................... BREAK-POINT 'Example-4'. WRITE: / 'ASSIGN command (offset and length as fields) with CFELD50' COLOR 6. SKIP. DO 6 TIMES. WRITE: /5 'DO loop number :' COLOR 4, SY-INDEX. ADD 7 TO OFFX. * ADD 1 TO LENX. ASSIGN CFELD50+OFFX(LENX) TO . PERFORM DISPLAY-CFELD USING CFELD50 'CFeld50'. SKIP 4. ENDDO. *....................................................................... * *//////////////////////////////////////////////////////////////////////* ************* subroutines ******************* *//////////////////////////////////////////////////////////////////////* * ************************************************************************ * Display of C fields and field symbols * ************************************************************************ FORM DISPLAY-CFELD USING CFELD FNAME. * WRITE: /10 'Content of ', FNAME, ':', CFELD. PERFORM FELDEIGENSCHAFTEN USING CFELD. * WRITE: /10 'Content of is a result of partial assign :', . PERFORM FELDEIGENSCHAFTEN USING . *----------------------------------------------------------------------- MOVE 'HENRY' TO . "<-- The field symbol is used *----------------------------------------------------------------------- WRITE: /10 'MOVE ''HENRY'' TO '. ULINE. *....................................................................... WRITE: /10 'Content of', FNAME, 35 ':', CFELD. 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 *************************************