Skip to Content
1

The type of a RETURNING parameter must be fully specified.

Nov 14, 2016 at 03:31 PM

870

avatar image
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?

image-1.png (6.3 kB)
image-2.png (25.4 kB)
image-3.png (82.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Sandra Rossi Nov 14, 2016 at 05:33 PM
2

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.
Share
10 |10000 characters needed characters left characters exceeded