2014 Nov 18 2:56 AM
DATA g_ref TYPE REF TO char10.
CREATE DATA g_ref.
Now we can write like:
g_ref->* = 'xyz'.
But how we can do with 'g_ref'?
Is there anythin like p++ in C?
DATA g_ref TYPE REF TO char10.
CREATE DATA g_ref.
Now we can write like:
g_ref->* = 'xyz'.
But how we can do with 'g_ref'?
Is there anythin like p++ in C?
2014 Nov 18 3:05 AM
For example, if I want to loop internal table
how can I use type ref to to replace LOOP it_tab ASSIGNING <fs>?
2014 Nov 18 6:25 AM
2014 Nov 18 6:29 AM
Hi, thank you for the reply.
REF type is a little bit diff from pointer.
I only know dereference it by g_ref->*, but how can I use g_ref itself?
2014 Nov 18 6:40 AM
Hi Ming,
As far as I know,
Reference variables are initial when you declare them. They do not point to an object. You cannot dereference an initial reference variable. A data reference variable can point to a data object if you
· Use it to create a data object dynamically.
· Use it to get a reference to a data object.
· Assign an existing data reference to it from another data reference variable.
For more details pls check.
http://help.sap.com/saphelp_nw70/helpdata/en/9a/871ad40c6c11d3b9350000e8353423/content.htm
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |