Field symbols
- Field symbols are pointers in C.
- They are used to store the address of variable.
- Used to increase the performance .
- Syntax :
Field symbols : <fs> [typing].
- Assigning is the keyword to assign the field symbol to variable.
Ex :
Steps :
- Go to transaction code SE38.
- Enter the program name Z or Y<program name>
- Select attribute type as Executable program.
- Click on Save.
Source Code
REPORT ZFIELDSYMBOL3.
DATA : IT_MAKT TYPE TABLE OF MAKT.
FIELD-SYMBOLS : <FS> TYPE MAKT.
SELECT-OPTIONS : S_MATNR FOR <FS>-MATNR.
SELECT * FROM MAKT INTO TABLE IT_MAKT WHERE MATNR IN S_MATNR.
LOOP AT IT_MAKT ASSIGNING <FS>.
WRITE : / <FS>-MATNR , <FS>-SPRAS , <FS>-MAKTX.
ENDLOOP.
DATA : IT_MAKT TYPE TABLE OF MAKT.
FIELD-SYMBOLS : <FS> TYPE MAKT.
SELECT-OPTIONS : S_MATNR FOR <FS>-MATNR.
SELECT * FROM MAKT INTO TABLE IT_MAKT WHERE MATNR IN S_MATNR.
LOOP AT IT_MAKT ASSIGNING <FS>.
WRITE : / <FS>-MATNR , <FS>-SPRAS , <FS>-MAKTX.
ENDLOOP.
Comments
Post a Comment