2007 Sep 24 6:28 AM
Hi can any one explain what does this statement mean?
wa_des ?= cl_abap_typedescr=>describe_by_data( <fs_wa> )
2007 Sep 24 7: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.
2007 Sep 24 6:31 AM
Field Symbols:
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
http://www.sapgenie.com/abap/code/chap2401.txt
http://www.sapgenie.com/abap/code/chap2402.txt
http://www.sapgenie.com/abap/code/chap2403.txt
FIELD-GROUPS,EXTRACT,FIELD-SYMBOL and ASSIGN statments.
http://sap.niraj.tripod.com/id26.html
Rewards if useful..............
Minal
2007 Sep 24 6: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.
2007 Sep 24 7: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
2007 Sep 24 7: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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |