One of the most useful of Field Symbols in ABAP is Dynamic assign statement, meaning if you don't know the name of field to assign to the field symbols during writing your program, you can use this :
ASSIGN (<f>) TO <FS>.
Sample:
Suppose we have three programs. The main program:
TABLES sbook.
sbook-fldate = sy-datum.
PERFORM form1 IN PROGRAM demo_form1.
The other two programs are:
REPORT demo_form1.
FORM form1.
PERFORM form2 IN PROGRAM demo_form2.
ENDFORM.
and
REPORT demo_form2.
FORM form2.
DATA name(20) TYPE c VALUE 'SBOOK-FLDATE'.
FIELD-SYMBOLS <fs> TYPE ANY.
ASSIGN (name) TO <fs>.
IF sy-subrc EQ 0.
WRITE / <fs>.
ENDIF.
ENDFORM.
The output looks something like this: 02.06.1998
More Detail? please visit :
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb38d5358411d1829f0000e829fbfe/content.htm
No comments:
Post a Comment