Application Development 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: 

The type of a RETURNING parameter must be fully specified.

Former Member

Hello guys

I'm new to abap and I'm facing a problem that I believe to be simple to solve:

I have a method and I want to return a table (the method itself will fill the table with another method inside it). Here goes the declaration:

get_application_item IMPORTING iv_appldoc_id TYPE /accgo/e_appldoc
 RETURNING VALUE(rt_application_items) TYPE /ACCGO/CAS_TT_CAI_BL.

Here is the implementation:METHOD get_application_item.


   DATA(lo_appldoc_manager) = /accgo/cl_cas_appdoc_mgr=>get_instance( ).
   DATA is_appldoc TYPE lty_appldoc.
   is_appldoc-appldoc = iv_appldoc_id.
   TRY.
     DATA(lo_application_document) = lo_appldoc_manager->get_appdoc( 
                im_s_appdoc_hdr_key = CORRESPONDING #( is_appldoc ) ).
     lo_application_document->get_data(
                 IMPORTING ex_t_appdoc_item = rt_application_items ).
   CATCH /accgo/cx_cas_appl_error.
     MESSAGE 'Error' TYPE 'I'.
   ENDTRY.
 ENDMETHOD.

The idea is to call get_data and fill my returning table rt_application_items with data. But I'm getting this error, so I don't know how to deal with it, since rt_application_items has the same type as ex_t_appdoc_item (images from the table type and structure below).

Does anyone have an idea?

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

The issue in only with the line:

RETURNING VALUE(rt_application_items) TYPE /ACCGO/CAS_TT_CAI_BL.

It's not accepted to use a generic type with RETURNING.

You simply need to define a complete type compatible with /ACCGO/CAS_TT_CAI_BL, and declare the returning parameter with that new type (it's an example, as you didn't provide the full definition of /ACCGO/CAS_TT_CAI_BL) :

TYPES ty_cas_tt_cai_bl TYPE STANDARD TABLE OF /ACCGO/CAS_S_CAI_BL WITH EMPTY KEY.
1 REPLY 1

Sandra_Rossi
Active Contributor

The issue in only with the line:

RETURNING VALUE(rt_application_items) TYPE /ACCGO/CAS_TT_CAI_BL.

It's not accepted to use a generic type with RETURNING.

You simply need to define a complete type compatible with /ACCGO/CAS_TT_CAI_BL, and declare the returning parameter with that new type (it's an example, as you didn't provide the full definition of /ACCGO/CAS_TT_CAI_BL) :

TYPES ty_cas_tt_cai_bl TYPE STANDARD TABLE OF /ACCGO/CAS_S_CAI_BL WITH EMPTY KEY.