cancel
Showing results for 
Search instead for 
Did you mean: 

Function import needs to return 0...n values for complex type

marioaerts
Explorer
0 Kudos

Hi,

we implemented a function import which retrieves a set of sales orders and related fields. The return type is a complextype based on a ABAP DDIC structure. In SEGW we modelled a function import with Return Type Kind as 'Complex Type' and Cardinatlity '0...n'. At runtime we retrieve the correct values in the EXECUTE_ACTION method and put the table of records of our complextype into the returning parameter ER_DATA of our _DPC_EXT class.

While debugging I see that SAP is not able to move my data into a table (see <ls_source_structure> and <ls_target_structure>, hence the return is empty. (/IWBEP/CL_MGW_ABS_DATA->EXEC_SERVICE_OPERATION. We receive no error whatsoever... I guess this is a bug of SAP or are we doing something wrong?

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor
0 Kudos

Mario,

What is your SP level of the Gateway?

Feed on Complex Type is available as of SAP NetWeaver Gateway Release 2.0 Support Package 03.

Reference: OData in SAP NetWeaver Gateway - Feature Overview - SAP NetWeaver Gateway - SAP Library (Search for <Function Import with Return Type Collection of Complex Types>)

regards

Krishna

kammaje_cis
Active Contributor
0 Kudos

There is some conflicting information as well.


Note that a function import can either return an entity type or a complex type. In SAP NetWeaver Gateway it is only possible to have single complex types as return types. Collections are not allowed and therefore multiplicity had best use /IWBEP/CL_MGW_ABS_MODEL=>CARDINALITY_ENTITY for return complex types.

Reference: /IWBEP/IF_MGW_ODATA_ACTION - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library

So if you are above Gateway SP3, I would suggest to raise a message to SAP.

regards

Krishna

Answers (1)

Answers (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Mario,

Everything looks fine.

But data not displaying in the response is might be because of different filed names between the target structure and the source structure.

Since your are using move-corresponding statement, the filed names should be same in both the target and source structure.

Please check the field names used inside the source and target structures of Execute_Action method of your DPC_EXT class.

Regards,

Ashwin