cancel
Showing results for 
Search instead for 
Did you mean: 

Extend standard oData service for entity without ABAP structure

Former Member
0 Kudos

Hi,

I understand that there are many blog or tutorial out there on how to extend SAP standard oData using SEGW to add new field in the standard entity but all of them are using append structure approach to add new field into the standard structure of the entity.

My issue here is I need to extend SAP standard oData service that does not using ABAP structure in the entity definition. All fields are defined manually in the entity definition. Because of this approach, I cannot populate the value of the custom field in getEntity and getEntitySet method since the ET_ENTITYSET structure will be derived from the parent and cannot be changed. (Message Parameters/exceptions of inherited methods or events cannot be changed shown when I accessing method parameter of getEntitySet).

Is there anyone that know how to overcome this issue without the need to change SAP standard delivered oData service definition?

Thank you,

Abraham

nivetha_d2021
Explorer
0 Kudos

Hi Abraham,

I also have the same requirement. Can you please tell me how did you resolve this issue?

Accepted Solutions (0)

Answers (4)

Answers (4)

shilpa_manthan
Explorer
0 Kudos

Can you create custom entity set and then populate it ?

0 Kudos

how did you do it?

shilpa_manthan
Explorer
0 Kudos

In extended service DPC_EXT class redefine method of get_entityset .

There put the code of new entityset added .

Dont forget to put OTHER condition in CASE , this will get called for originals Entity sets .

Then for custom entity make the new method in DPC_ext class and call it from redefined entityset method.

Former Member
0 Kudos

Hi Shilpa,

Please bear with me while I'm trying to understand your advise here.

Let say I have entity named EntityA.

If I redefined the service, I will have Z_dpc_ext->EntityA_get_entityset with et_entityset parameter typed the same as the standard oData service entity. In this case, we cannot populate information if we add custom field in the redefined Z entity because the method parameter is not changed.

Your advise is to call new method from redefined entitityset method but isn't that the parameter et_entityset itself in the end will still be the same type as et_entityset of the standard entity?

Am I missing something here?

Thank you.

Regards,

Abraham

shilpa_manthan
Explorer
0 Kudos

HI Abraham ,

Have you created new entity set for your use ?

Former Member
0 Kudos

Hi,

It seems like nobody knows the answer including SAP employee themselves.

In that case, I have no choice but to change SAP standard oData service definition directly.

Thank you.

Regards,

Abraham