cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance oData service

Former Member
0 Kudos

Hello. I extended oData service /IWPGW/TASKPROCESSING v.2 and added new property "Ext" to entity Task. Service generated whithout errors. But when I try to run the service in gateway client, then I get error "Property 'Ext' of data object 'Task' has no Internal type assigned". In my model class this field is exist and has data type "string". What did I do wrong? If I delete new property, then service run correctly

Accepted Solutions (1)

Accepted Solutions (1)

former_member184867
Active Contributor
0 Kudos

Hi Pavel,

May be you can try to assign internal type to the new property using the following code in DEFINE method if MPC_EXT.


data: lr_tntity_type type REF TO /iwbep/if_mgw_odata_entity_typ,

      .r_property TYPE REF TO /iwbep/if_mgw_odata_property.

  super->define( ).

  lr_tntity_type = model->get_entity_type( 'ENTITYNAME' ).

  lr_property = lr_tntity_type->get_property( 'PROPERTYNAME' ).

  lr_property->SET_INTERNAL_TYPE( cl_abap_typedescr=>TYPEKIND_STRING ).

Regards,

Atanu

Former Member
0 Kudos

Thanks all! I Redefined DEFINE method and added internal property type like Atanu in his replay. Issue solved

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Atanu,

On redefining gateway service, the date field type in child service changed to Packed (21,7) /Packed (15,0).

I want to change the date type from Packed (21,7) /Packed (15,0) to Internal Type Date(D).

Please suggest a way to change the same.

Regards,

Priyanka.

AshwinDutt
Active Contributor
0 Kudos

Hello Pavel,

This may be because you have added a new property to the GW Model but missed adding the same to the structure which is bound.

At the runtime internally there would be a check which maps properties to the structure which is bound to it.

In the MPC class you will see a structure which is bound as below.

lo_entity_type->bind_structure( '<Your Structure Name>' ).


You need to add the field in this structure as well.

Check this structure and add that particular field.


Regards,

Ashwin

kammaje_cis
Active Contributor
0 Kudos

I remember having this error earlier and did not find anything wrong. I somehow did not need that enhancement later.

I would suggest raising it to SAP.