Skip to Content
author's profile photo Former Member
Former Member

Field-symbols

Hi all,

I am a novice in using field-symbols. I haeve a very small assignment. Would require our inputs on this.

I have a dictionary table TFACS.

From this table i want to access one of the fields MON01 through MON12.

This field name I have in a variable var1 i.e. var1 = 'TFACS-MON08'.

Now using field sybols how do i read the value of this TFACS-MON08.

I used the following statement.

Assign var1 to <fs1>.

write: <fs1>.

This gives the result as TFACS-MON08. 😊

Awaiting your inputs.

Thanks in advance.

Regards,

Gayathri.

Add comment
10|10000 characters needed characters exceeded

4 Answers

  • Posted on Aug 02, 2006 at 05:59 AM

    Hello,

    take field name only in your var1 i.e. var1 = 'MON08'.

    Now

    ASSIGN COMPONENT var1 OF STRUCTURE TFACS TO <Fs1>.

    Regards,

    Naimesh

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 06:02 AM

    Hi Gayatri,

    The statement "write: <fs1>" will display the value of variable assigned to <fs1>.

    Here you are assigning var1. so it will display value of var1 i.e. 'TFACS-MON08'.

    So you have to assign TFACS-MON08 TO <f1> so as to print the value of TFACS-MON08.

    See the code below:

    Tables : TFACS.

    *declare the required field symbols

    FIELD-SYMBOLS: <f1> LIKE TFACS-MON08,

    <f2> LIKE TFACS-MON12.

    • then assign

    ASSIGN TFACS-MON08 TO <f1>.

    WRITE: / <f1>.

    This will display the value of TFACS-MON08.

    Hope this helps,

    Pragya

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 02, 2006 at 06:03 AM

    OR YOU CAN DO IT LIKE THIS:

    Assign (var1) to <fs1>.

    NOTE THE BRACKETS! That means take the contents of the field to holda name of a field.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 06:17 AM

    Hello Gayathri,

    you can proceed like this.

    DATA : Var1(20) value 'TFACS-MON08'.

    Field-symbols : <FS> type any.

    Assgin (VAR1) to <FS>.

    IF <FS> is Assigned.

    write : / <FS>.

    Unassign <FS>.

    Endif.

    Reward some points.

    If helps.

    Thanks,

    Krishnakumar

    Add comment
    10|10000 characters needed characters exceeded