cancel
Showing results for 
Search instead for 
Did you mean: 

Return a RAP business object structure in a method

felixw
Explorer
0 Kudos
186

Hi,

I defined a RAP business object structure with

my_bo TYPE STRUCTURE FOR READ RESULT z_c_my_bo_m

So far so good. Now I want to exchange this structure between objects.  When e.g. having ADT generated a getter for the variable "my_bo" it generates the following line:

  METHODS: get_my_bo RETURNING value(r_result) TYPE structure for READ result z_c_my_bo_m.

To me this looks good. However, ADT is displaying an error with this line.

How can I fix this?

Thank you

junwu
Active Contributor
0 Kudos
why not show your error?
holm
Participant

Moin,

you have to add a type definition first, this kind of type cannot be written directly.

TYPES ts_my_bo TYPE STRUCTURE FOR READ RESULT z_c_my_bo_m.

Then you can define your method like that:

METHODS get_my_bo RETURNING VALUE(r_result) TYPE ts_my_bo.

Accepted Solutions (0)

Answers (1)

Answers (1)

felixw
Explorer
0 Kudos

Thank you very much. This solved my problem