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

Functional Method - Returning parameter typing

Former Member
0 Likes
1,306

Hello experts, i´ve got a question about typing of retruning parameters.

For example, this is my class:


class ZCL_TEST definition
  public

*"* public components of class ZCL_CLASS
*"* do not include other source files here!!!
public section.
  types:
    BEGIN OF ty_letyps
                  letyp type lvs_letyp 
           END OF ty_letyp.
 types:  ty_t_letyps type standard table of ty_letyps.
 class-methods GET_LETYPS
    importing
      !I_MATNR type MATNR
      !I_LGNUM type LGNUM
    returning
      value(RT_LETYPS) type TY_T_LETYPS.

if i want to activae the class i get a syntax error:

The type of a RETURNING parameter must be fully specified

I knew that returning parameters musst be fully specified - that says to me i must not use type any or type any table or other gerneric datatypes for returning parameter. But my type ty_t_letyp is not generic and i can it also use outside the class via

DATA: it_table type ZCL_TEST definition=>ty_t_letyp.

So can someone explain why i must not use local defined types for returning parameters?

Regards

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
681

Try typing the table giving key fields


types:  ty_t_letyps type standard table of ty_letyps with key field1 field2....

This might be the problem.

Regards

Marcin

4 REPLIES 4
Read only

MarcinPciak
Active Contributor
0 Likes
682

Try typing the table giving key fields


types:  ty_t_letyps type standard table of ty_letyps with key field1 field2....

This might be the problem.

Regards

Marcin

Read only

0 Likes
681

Great it works, thank you.

Read only

0 Likes
681

It this was helpful some appreciation is also welcome.

Cheers

Read only

0 Likes
681

done