Application Development and Automation 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: 
Read only

field symbol!!

Former Member
0 Likes
606

 ASSIGN COMPONENT 'ATPPLANTALT' OF STRUCTURE <fs_wa> TO <fs_field>.
        <fs_field>  = WA_OUTPUT-ATPPLANTALT.

In the above code..if i try moving 'NO Conversion' stored in wa_output-atpplant to field symbol, it throws the dump..sating unable to interpret the text mentioned as no..hav declared fs_field as type any...

Regards

Gunjan


 ASSIGN COMPONENT 'ATPPLANTALT' OF STRUCTURE <fs_wa> TO <fs_field>.
        <fs_field>  = WA_OUTPUT-ATPPLANTALT.

In the above code..if i try moving 'NO Conversion' stored in wa_output-atpplant to field symbol, it throws the dump..sating unable to interpret the text mentioned as no..hav declared fs_field as type any...

Regards

Gunjan

4 REPLIES 4
Read only

Former Member
0 Likes
577

Hi,

declare the field-symbol as type any as below:

field-symbol : <fs_field> type any.

ASSIGN COMPONENT W_INDEX OF STRUCTURE IT_FINAL TO <FS>.

W_VALUE = W_VALUE / 100000.

<FS_field> = W_VALUE.

P.S. mark all helpful answers for points

JLN

Read only

Former Member
0 Likes
577

HI,

syntax is :-

ASSIGN COMPONENT name OF STRUCTURE rec TO <fs>.

look at the sample program

PROGRAM P1MAIN.
  DATA: BEGIN OF REC,
          A VALUE 'a',
          B VALUE 'b',
          C VALUE 'c',
          D VALUE 'd',
        END OF REC,
        CN(5) VALUE 'D'.
  FIELD-SYMBOLS <FS>.

<b>  ASSIGN COMPONENT CN OF STRUCTURE REC TO <FS>.</b>

  WRITE <FS>.

in you case maybe, instead of <fs_wa> use a standard structure.

Regards

Sudheer

Read only

Former Member
0 Likes
577

shouldnt the one marked in bold be same??

ASSIGN COMPONENT 'ATPPLANTALT' OF STRUCTURE <b><fs_wa></b> TO <fs_field>.
        <fs_field>  = <b>WA_OUTPUT</b>-ATPPLANTALT.

correct one

ASSIGN COMPONENT 'ATPPLANTALT' OF STRUCTURE <b><fs_wa></b> TO <fs_field>.
        <fs_field>  = <b><fs_wa></b>-ATPPLANTALT.

Read only

0 Likes
577

hi

am passing the value to that that field symbol and it will be improper to move fs-fieldname to field symbol..

till now its working fine..except in the case of string variable...

gunjan