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

Field Symbol Issue ...

Dear Experts,

What is meaning of

Assign <fld_name> ->* <fieldsymbol_name> ?

What is the mean of ->* symbol mean in field symbol ?

I got this line from one existing program code while developing my object.

Regards,

Ajit

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 30, 2013 at 01:18 PM

    In which scenarios we generally use this symbol (->*) in FS ?

    What is benefit by using this symbol ?

    Regards,

    Ajit

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      ->* can be used to refer entire object. Check below simple examples to understand it.

      (<fs2> declaration is different in each example)

      Example1: I want to assign entire MARA structure from <FS1> to <FS2>.

      field-symbols: <fs1> type ref to mara.
      field-symbols: <fs2> type mara.
      assign <fs1>->* to <fs2>.

      Example2 & 3: I want to assign only MATNR from MARA structure to <FS2>.

      field-symbols: <fs1> type ref to mara.
      field-symbols: <fs2> type matnr.
      assign <fs1>->matnr to <fs2>.

      field-symbols: <fs1> type ref to mara.
      field-symbols: <fs2> type matnr.
      assign <fs1>->*-matnr to <fs2>.

      Regards,

      Naveen Inuganti

  • author's profile photo Former Member
    Former Member
    Posted on Dec 30, 2013 at 01:32 PM

    To access the contents of the data object to which a data reference is pointing, you must dereference it.

    ASSIGN dref->* TO <fs> [CASTING ...].

    This statement assigns the data object to the field symbol <fs> which the data reference in the reference variable <dref> points to. If the assignment is successful, sy-subrc is set to zero.

    If the field symbol is fully generic, it adopts the data type of the data object. If the field symbol is partially or fully typed, the system checks the data types for compatibility. Casting is also possible for the assigned data object.

    If the data reference in <dref> is initial or invalid, you cannot dereference it. The field symbol remains unchanged, and sy-subrc is set to 4.

    If you create a data object dynamically, the only way to access its contents is to use dereferencing.

    regards ,

    sivaganesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 30, 2013 at 01:38 PM

    consider you are coding dynamically to access the structure of different object. each time the structure of the object changes in dynamic logic.

    So we can use the field symbol to process. In order to pass the structure to the field symbol we will use the above statment ASSIGN obj ->* <fs> .

    so this statement assigns the obj characteristics to the field symbol and work with field symbol.

    ->* - dereference operator.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 30, 2013 at 01:46 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 30, 2013 at 02:01 PM

    Perform some search on "dereference pointer" (google or other tool) in Abap "Data references" are similar to pointers and "Field-symbols" are similar to deferenced pointer (used in statement as a variable)

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.