cancel
Showing results for 
Search instead for 
Did you mean: 

Method return value type conversion

Former Member
0 Kudos

Hi all,

I'm new to Web Dynpro for Abap development and just experimenting with the basics.

I have the follwing code in a view:


DATA lv_return TYPE i.
  lv_return =   wd_this->get_next_index( ).

The methode declaration, declared in the same view is like that:

Parameter = RETURN

Type = Returning

RefTo = checked

Opt = unchecked

Associated Type = i


method GET_NEXT_INDEX .
endmethod.

The code line

lv_return =   wd_this->get_next_index( ).

produces the error

The result type of the function method cannot be converted into the type of LV_RETURN. type of LV_RETURN

What have I missed here? Any hint is highly appreciated!

Regards and thanks,

Martin Muellenberg

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Martin,

Uncheck the "ref to". This is to be used only for references of class/interfaces. Since your parameter is only an integer, ref to is not required. Uncheck it and it should work.

Regards,

Nithya

Former Member
0 Kudos

Hi Nithya,

yes, it works as you said.

Thanks a lot!

Best regards,

Martin Muellenberg

Answers (0)