cancel
Showing results for 
Search instead for 
Did you mean: 

Gateway define common method at service level

former_member604066
Discoverer
0 Kudos

Hi,

I am new to Gateway & have a question.

For a service, I wanted to define a common method which should trigger everytime service called irrespective of method or entityset. will use this method for common logic at service level (Ex. Retrieving RFC destination, Authority checks etc..). Could you please help me on how to do that.

Thanks in advance.

- Eswar

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184739
Contributor
0 Kudos

Hi,

Could you use the constructor available in the DPC_EXT class which gets invoked for every method that gets triggered.Thanks

Praba

former_member604066
Discoverer
0 Kudos

Thank you Prabharan

maheshpalavalli
Active Contributor
0 Kudos

Hi Bhanu Pentakota,

You can redifine the below method in dpc_ext class.. Don't forget to call the super class method inside 🙂

/IWBEP/IF_MGW_CORE_SRV_RUNTIME~INIT

BTW the authorization check for odata service is handled by framework itself.. I couldn't find the help link..

BR,

Mahesh

former_member604066
Discoverer
0 Kudos

Thank you Mahesh "Don't forget to call the super class method ... " solved the issue. 🙂

But stuck with another issue.

below logic works fine in /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_DEEP_ENTITY method and default GET_ENTITY methods. but not working in /IWBEP/IF_MGW_CORE_SRV_RUNTIME~INIT method.

MR_REQUEST attribute value is initial in the get_destination_finder() method. any idea?

DATA:
o_dest TYPE REF TO /iwbep/if_destin_finder,
o_facade TYPE REF TO /iwbep/if_mgw_dp_int_facade.

o_facade ?= /iwbep/if_mgw_conv_srv_runtime~get_dp_facade( ).
o_dest = o_facade->get_destination_finder( ).
w_destination = o_dest->get_rfc_destination_via_rout( ).

(w_destnation is defined global, is fine)