cancel
Showing results for 
Search instead for 
Did you mean: 

Structure in Complex Type with Function Import and Cardinality 0..n

ParagJain
Participant
0 Kudos

We are trying to use a complex type as the return type for a function import with cardinality 0..n. If the complex type is referenced to an ABAP structure, we dont get back any values. If i remove the ABAP structure reference, we get the correct output with multiple rows.

Is this a known bug or we are doing something wrong?

While debugging the framework code, came across a section which checks for "conversions" and if this is true, treats the complex type as a structure, ignoring the cardinality.

IF lo_complex_type->get_no_conversion( ) = abap_false.

          ASSIGN cr_data->* TO <ls_source_structure>.

          lo_struct_descr ?= lo_complex_type->create_data_descriptor( ).

          CREATE DATA lr_target_struct TYPE HANDLE lo_struct_descr.

          ASSIGN lr_target_struct->* TO <ls_target_structure>.

          /iwbep/cl_mgw_data_helper=>convert_complex_property_outb(

            EXPORTING

              io_complex_type     = lo_complex_type

              is_source_structure = <ls_source_structure>

            CHANGING

              cs_target_structure = <ls_target_structure>

          ).

          cr_data = lr_target_struct.

This code isnt executed if its a complex type without ABAP structure.

Gateway: IW_BEP SP8

Regards,

Parag.

Accepted Solutions (1)

Accepted Solutions (1)

ParagJain
Participant
0 Kudos

Got this from SAP development:



If the model has complex type as return type for function import with cardinality 0…N, this combination is not supported.

So, you can go with any of the below two options

  1. Select 0..1 or 1 as a Return Cardinality if return type is complex type OR
  2. Select entity type as a Return type if cardinality is 0..N

Answers (1)

Answers (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Parag,

Can you please share the GW Model details of the entity which is having this complex structure ? and also the function import details ?

Regards,

Ashwin