09-12-2008 6:13 AM
Hi,
I am trying to assign a field to a symbol but not able to get the proper syntax.Please let me know the correct syntax.
Regards,
Manish
09-12-2008 6:44 AM
Hi Manish,
You can use the below syntax.
ASSIGN <f> [INCREMENT <n>] TO <FS>
[CASTING [TYPE <t>|LIKE <f>] [DECIMALS <d>]] [RANGE <r>].
Data object <f> is assigned to field symbol <FS>. <FS> now points to the data object. After the addition INCREMENT <n>, the storage area that is offset <n> times by a length of <f> starting with <f> is assigned to the field symbol. Pointed brackets are part of the syntax for field symbol names. The CASTING addition permits you to cast data objects when assigning field symbols. The RANGE addition defines the storage area in which either offset/length accesses or the INCREMENT addition are allowed. In Unicode programs, standard access is only allowed within the field limits of <f>, but this can be extended with RANGE. In non-Unicode programs, standard access is possible up to the boundary of the data segment and can be limited with RANGE.
Hope this will solve yuor problem.
regards,
Ashutosh
09-12-2008 6:15 AM
Manish,
data : title type lvc_title.
field-symbols <fs> type LVC_TITLE.
concatenate 'Pricing Report' ' ' into title separated by space.
assign title to <fs>.
K.Kiran.
09-12-2008 6:18 AM
09-12-2008 6:19 AM
hi,
please refer the link below:
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb38d5358411d1829f0000e829fbfe/content.htm.
hope it helps you.
thanks,
rahul
09-12-2008 6:19 AM
Hi,
plz check below program :
FIELD-SYMBOLS: <F1>, <F2> TYPE I.
DATA: TEXT(20) TYPE C VALUE 'Hello, how are you?',
NUM TYPE I VALUE 5,
BEGIN OF LINE1,
COL1 TYPE F VALUE '1.1e+10',
COL2 TYPE I VALUE '1234',
END OF LINE1,
LINE2 LIKE LINE1.
ASSIGN TEXT TO <F1>.
ASSIGN NUM TO <F2>.
DESCRIBE FIELD <F1> LENGTH <F2>.
WRITE: / <F1>, 'has length', NUM.
ASSIGN LINE1 TO <F1>.
ASSIGN LINE2-COL2 TO <F2>.
MOVE <F1> TO LINE2.
ASSIGN 'LINE2-COL2 =' TO <F1>.
WRITE: / <F1>, <F2>.
The output is:
Hello, how are you? has length 20
LINE-COL2 = 1,234
thanx.
09-12-2008 6:44 AM
Hi Manish,
You can use the below syntax.
ASSIGN <f> [INCREMENT <n>] TO <FS>
[CASTING [TYPE <t>|LIKE <f>] [DECIMALS <d>]] [RANGE <r>].
Data object <f> is assigned to field symbol <FS>. <FS> now points to the data object. After the addition INCREMENT <n>, the storage area that is offset <n> times by a length of <f> starting with <f> is assigned to the field symbol. Pointed brackets are part of the syntax for field symbol names. The CASTING addition permits you to cast data objects when assigning field symbols. The RANGE addition defines the storage area in which either offset/length accesses or the INCREMENT addition are allowed. In Unicode programs, standard access is only allowed within the field limits of <f>, but this can be extended with RANGE. In non-Unicode programs, standard access is possible up to the boundary of the data segment and can be limited with RANGE.
Hope this will solve yuor problem.
regards,
Ashutosh