Skip to Content

"SRA004_SRV" OData service for My Travel Request cannot be redefined properlywith SEGW

Jun 06, 2017 at 06:43 PM


avatar image

Hi, I am experiencing a problem with redefining SRA004_SRV with SEGW.

The problem is, that redefined service's "Travel" entity is missing it's reference to dictionary type.

Here is original Service:

As you can see Travel is SRA004_S_TRAVEL dictionary structure.

But redefined service ZSRA004 (created in new empty project with DataModel/Redefine/OData Service (GW):

has Travel entity with no reference to dictionary structure:

There is also another problem: even if I create new entities ("Sub" for example, as shown on the screenshot) there is no new methods generated for that entities. (Pressing the "Generate Runtime Objects" finishes successfully to no purpose.)

I have got this behavior in two different systems (IDES on HANA with SAP_BASIS 740 and SP0009; and another one, really up to date system).

Have you experienced that?

How to enhance (redefine) SRA004_SRV properly?

How to create new entities in redefined SRA004?

What is going on?

Best regards, Ilia.

sra004.png (80.1 kB)
zsra004.png (69.5 kB)
003-zsra004.png (9.5 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Andre Fischer
Jun 09, 2017 at 10:08 AM

Hi Ilia,

SEGW does not create new methods when you have created a service via Redefinition.

Therefore you have to redefine the dispatcher methods for GET_ENTITYSET, GET_ENTITY, ... such as /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITYSET and add code that will be called if your entityset is called.

Best Regards,


DATA lv_entityset_name TYPE string. 
DATA lr_entity TYPE REF TO data.

lv_entityset_name = io_tech_request_context->get_entity_set_name( ). 
CASE lv_entityset_name. 
   WHEN ‘<NewEntitySet>'. 

   er_entityset = er_entityset 
   es_response_context = es_response_context).
Show 1 Share
10 |10000 characters needed characters left characters exceeded

I was assured, that I had not problem doing that with redefined OData-service, but it seems like I just copied a project, and could add new entities as with normal non-redefined OData-service.