Skip to Content
0

Extend standard oData service for entity without ABAP structure

Jul 13, 2017 at 06:13 AM

376

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Abraham Bukit Jul 14, 2017 at 12:24 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jul 14, 2017 at 11:23 AM
0

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

0
Former Member

HI Abraham ,

Have you created new entity set for your use ?

0
avatar image
Former Member Aug 14, 2017 at 09:53 AM
0

how did you do it?

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Aug 16, 2017 at 11:31 AM
0

Can you create custom entity set and then populate it ?

Share
10 |10000 characters needed characters left characters exceeded