Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Method qustion

Former Member
0 Likes
395

Hi,

i watch code that use method and i dont understand it.

gx_table ?= cl_abap_typedescr=>describe_by_data( itab )

1. describe_by_data is a method so why i don't use it like fm

with call Method with import and export .

2. what is this ?= sign .

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
375

> i watch code that use method and i dont understand it.

>

> gx_table ?= cl_abap_typedescr=>describe_by_data( itab )

>

> 1. describe_by_data is a method so why i don't use it like fm

> with call Method with import and export .

>

that is another way of calling methods.

the same method can be called like this also..

CALL METHOD cl_abap_typedescr=>describe_by_data
  EXPORTING
    p_data      = itab
  RECEIVING
    p_descr_ref = gx_table.

> 2. what is this ?= sign .

>

? is used of casting.

2 REPLIES 2
Read only

Former Member
0 Likes
375

HI

gx_table ?= cl_abap_typedescr=>describe_by_data( itab )

here when you are dealing with classes and objects as you asked

describe_by_data is method of the class cl_abap_typedecr and

you are casting the result to the gx_table.

[Check This Link|]

Regards

Gangadhar

Read only

Former Member
0 Likes
376

> i watch code that use method and i dont understand it.

>

> gx_table ?= cl_abap_typedescr=>describe_by_data( itab )

>

> 1. describe_by_data is a method so why i don't use it like fm

> with call Method with import and export .

>

that is another way of calling methods.

the same method can be called like this also..

CALL METHOD cl_abap_typedescr=>describe_by_data
  EXPORTING
    p_data      = itab
  RECEIVING
    p_descr_ref = gx_table.

> 2. what is this ?= sign .

>

? is used of casting.