cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with a service redefined from /IWPGW/TASKPROCESSING

former_member204264
Participant
0 Kudos

Dear all,

I've created a new service OData using SEGW transaction and I've redefined /IWPGW/TASKPROCESSING for it. I've created a new Entity Set from a DDIC Structure with its corresponding Entity Type. A new association has been created between Task (principal Entity) and the new Entity (like dependent entity). Referential constraints is InstanceID.

When I call URI /sap/opu/odata/sap/ZDEMO_FUND_RESERVATION2_SRV_02/TaskCollection, no reference to new entity is displayed:

I've tried to add directly new properties in entity type Task, but there is the following error:

Property 'Belnr' of data object 'Task' has no Internal type assigned

Since, 'Task' entity doesn't have an associated structure because it's determinated  by runtime object generator, I've created an enhancement in  /IWPGW/IF_TGW_SRV_CONSTANT interface, where  ty_task type is declared, adding new field 'Belnr'. But the same error occurs.

Any idea for solve it?

Thanks a lot.

Regards. Luis.

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor
0 Kudos

Luis, You have missed creating a navigation property. Navigation property decides if a navigation using an Association is allowed.

Answers (1)

Answers (1)

AshwinDutt
Active Contributor
0 Kudos

Hello,

Since u have added a new property to ur existing model u need to clear ur model cache.

Clear model cache in /iwfnd/cache_cleanup and try.

This might help u.

To see the association between the entities u need to see the metadata of the service.

/sap/opu/odata/sap/ZDEMO_FUND_RESERVATION2_SRV_02/$metadata


Where have u added the new property ?

In MPC_EXT class ?

Regards,

Ashwin

former_member204264
Participant
0 Kudos

Hi Ashwin, thanks for your reply.

I've cleared model cache using /iwfnd/cache_cleanup transaction without successfully results. 

In service's metadata I can see new Entity Set when I call

/sap/opu/odata/sap/ZDEMO_FUND_RESERVATION2_SRV_02/$metadata


I added the new property directly in SEGW in corresponding Entity Type 'Task'. Too I've tried to added it in class MPC_EXT:



lo_entity_type = model->GET_ENTITY_TYPE( 'Task' ).

lo_property = lo_entity_type->create_property( iv_property_name = 'Belnr' iv_abap_fieldname = 'BELNR' ).

lo_property->set_label_from_text_element( iv_text_element_symbol = '003' iv_text_element_container = gc_incl_name ).

lo_property->set_type_edm_string( ).

lo_property->set_maxlength( iv_max_length = 10 ).

lo_property->set_conversion_exit( 'ALPHA' ).

lo_property->set_creatable( abap_false ).

lo_property->set_updatable( abap_false ).

lo_property->set_sortable( abap_false ).

lo_property->set_nullable( abap_false ).

lo_property->set_filterable( abap_false ).

Regards.

AshwinDutt
Active Contributor
0 Kudos

Hello Luis,

U said u have created a new Entity Set from a DDIC Structure with its corresponding Entity Type. So that Entity is 'Task' is it ?

Or entity 'Task' was already a part of /IWPGW/TASKPROCESSING and u just added a property 'Belnr' to the entity 'Task'?


Could be please just give little details on how did u redefined /IWPGW/TASKPROCESSING and the steps u did later to add the Belnr ?


The error  Property 'Belnr' of data object 'Task' has no Internal type assigned is thrown when u check for syntax in SEGW is it ?


Regards,

Ashwin

former_member204264
Participant
0 Kudos

Hello Ashwin and Krishna,

My first attempt was add a new Entity type once I had redefined /IWPGW/TASKPROCESSING. This Entity type has 'Belnr' like property. I created a new association between master entity 'Task' and my new Entity (related with 'InstanceID' property ). But the problem was the commented in first post,

So I tried to add new property 'Belnr' in 'Task' Entity Type, but the error: Property 'Belnr' of data object 'Task' has no Internal type assigned was thrown.

The problem was that I had missed creating a navigation property in 'Task' Entity type to allow new association created

Thanks all for support.

Regards.

Luis