cancel
Showing results for 
Search instead for 
Did you mean: 

Loading the metadata for service failed - Data object not found

Former Member
0 Kudos

Hello SAP Gateway Expert,

I'm using the Gateway for some times now and I encountered a strange error.

I created a service with Entities based on ABAP RFM and it was working fine. I added an association to manage a DEEP_ENTITY creation and now I have an error when I try to use the service.

From /n/iwfnd/maint_service, when I select my service and click the button "Load metadata", I get an error "Loading the metadata for service 'Z_PDE_CREATE_SRV' failed. Check the error log. "

And the error log is telling "Data object 'HeaderPDESet' not found" which strange because the object is existing !

I deleted and recreated the Entity and the EntitySet, I regenerated the project, I cleaned the caches /IWFND/CACHE_CLEANUP and /IWBEP/CACHE_CLEANUP.

For no effect... Any clue is appreciated !

Thanks,

Luc

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Ashwin,

Sorry for the delay answering I was really not available...

Thanks this was the major part of the problem !

The second part is that I put the EntitySet name inseatd of the Entity Name !

How can I reward you ?

Regards,

Luc

ACE-SAP
Active Contributor
0 Kudos

Hi Luc,

For rewarding, just mark the question as answered... and 10 points will be granted to Ashwin.

You can also set his 1st answer as useful, so he will get 5 other points.

Best regards

Former Member
0 Kudos

Hello Yves,

I have no button or any thing to close the message or put answer as useful...

If any moderator can help ?

Thanks,

Luc

Former Member
0 Kudos

Hello Ashwin,

Here it is

THe full Data Model first

The Associations

The AssociationSets

AshwinDutt
Active Contributor
0 Kudos

Hello Luc,

Model looks fine.

Have you written any code in MPC_EXT class inside Define method ?

Regards,

Ashwin

Former Member
0 Kudos

Hello Ashwin,

Yes I did.

Here it is :

method DEFINE.

DATA:

lo_annotation TYPE REF TO /iwbep/if_mgw_odata_annotation,

lo_entity_type TYPE REF TO /iwbep/if_mgw_odata_entity_typ,

lo_complex_type TYPE REF TO /iwbep/if_mgw_odata_cmplx_type,

lo_property TYPE REF TO /iwbep/if_mgw_odata_property,

lo_entity_set TYPE REF TO /iwbep/if_mgw_odata_entity_set.

***************************************************************************************************************

* ENTITY - Deep Entity

***************************************************************************************************************

lo_entity_type = model->get_entity_type( iv_entity_name = 'HeaderPDESet' ).

lo_entity_type->bind_structure( iv_structure_name = 'ZCL_Z_PDE_CREATE_MPC_EXT=>TS_DEEP_ENTITY' ).

endmethod.

And I created also the TS_DEEP_ENTITY

class ZCL_Z_PDE_CREATE_MPC_EXT definition

public

inheriting from ZCL_Z_PDE_CREATE_MPC

create public .

public section.

types:

begin of TS_DEEP_ENTITY,

include type TS_HEADERPDE,

headeritem type STANDARD TABLE OF TS_ITEMLIST with DEFAULT KEY,

headerpartner type STANDARD TABLE OF TS_PARTNERLIST WITH DEFAULT KEY,

END OF TS_DEEP_ENTITY .

methods DEFINE

redefinition .


Regards,

Luc

AshwinDutt
Active Contributor
0 Kudos

Inside DEFINE method first please call the super class as below and then your custom code.

method DEFINE.

DATA:lo_entity_type TYPE REF TO /iwbep/if_mgw_odata_entity_typ.

super->define( ).

***************************************************************************************************************

* ENTITY - Deep Entity

***************************************************************************************************************

lo_entity_type = model->get_entity_type( iv_entity_name = 'HeaderPDESet' ).

lo_entity_type->bind_structure( iv_structure_name = 'ZCL_Z_PDE_CREATE_MPC_EXT=>TS_DEEP_ENTITY' ).

endmethod.

AshwinDutt
Active Contributor
0 Kudos

Hello Luc,

Can you please share the screen shots of the association and navigation created between the entities here ?

Regards,

Ashwin