Skip to Content
author's profile photo
Former Member

Field Symbol

Hi can any one explain what does this statement mean?

wa_des ?= cl_abap_typedescr=>describe_by_data( <fs_wa> )

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Sep 24, 2007 at 06:24 AM

    <b>wa_des ?= cl_abap_typedescr=>describe_by_data( <fs_wa> )</b>

    in the above statement, if your doubt is about the operator ?=, below is the explanation:

    generally the above operator can be used only with the reference variables.

    and it must be used if the source reference variable is more generic than destination refrence variable. then we cannot use = but should only use ?=.

    other wise we can use both ?= or = with the reference variables.

    note: we cannot use ?= with noraml variables.

    i hope u know what are refernce variables?

    two types object refrence variable and data reference variables.

    in the above statement <fs> would be data reference variable and wa_des would be object referece variable. if iam not wrong it may be declared like below

    <b>wa_des type ref to cl_abap_typedescr</b>.

    in the above statement both are reference variables so only ?= is allowed.

    u try keeping = in place of ?= above, it should work then also as the source reference is specific , not generic. it specifically pointing to the class.

    now coming to the class

    cl_abap_typedescr=>describe_by_data( <fs_wa> )

    in the above statement

    <b>cl_abap_typedescr is a class is for providing run time type services.</b>. the above method in the class provides the details about the type of the variable in brackets.

    i hope u understood now.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 24, 2007 at 05:31 AM
    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 24, 2007 at 05:33 AM

    cl_abap_typedescr is a global class.

    You are just calling the private method describe_by_data and the storing the data in the workarea wa_des. That's it.

    You can verify it by setting break-point before thie statement.

    Please reward if helpful.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 24, 2007 at 06:15 AM

    Hi,

    Go to SE24 and give cl_abap_typedescr. This actually a standard class. Within this class u can find the method DESCRIBE_BY_DATA, which holds a value in the field symbol <fs_wa>. U are copying this value to wa_des field.

    Reward points if helpful.

    Kuntal

    Add comment
    10|10000 characters needed characters exceeded