Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

assign a field to symbol.

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

5 REPLIES 5

kiran_k8
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

wrong post..

Former Member
0 Kudos

hi,

please refer the link below:

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb38d5358411d1829f0000e829fbfe/content.htm.

hope it helps you.

thanks,

rahul

Former Member
0 Kudos

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.

Former Member
0 Kudos

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