cancel
Showing results for 
Search instead for 
Did you mean: 

How can I determine HTTP_METHOD in GET_ENTITY method?

0 Kudos

I would like to know how I can get the HTTP_METHOD in the GET_ENTITY method. When the HTTP_METHOD is a patch I can skip a lot of ABAP code in the implementation. This would benefit performance. When I debug, I can see the IO_TECH_REQUEST_CONTEXT having a attribute MR_REQUEST. This contains the HTTP_METHOD.

I have not been able to retrieve this data.

Can anyone help me?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

I got a hint from Arshad Ansary

I can redefine the PATCH_ENTITY method in the ..........DPC_EXT class.

Answers (2)

Answers (2)

Former Member
0 Kudos

from the context value.

0 Kudos

Can you give me a code example.

Former Member
0 Kudos

The scope of this attribute is private the visibility is restricted within the class i.e to methods in the class. so if we capture the value in a method and  read this private attribute and returns back then your problem is solved.

so you can go for a small enhancement like pre/post exit and capture the value.

Then using an added new optional parameter you can retrieve the value. Is it the best i don't know but this is technically feasible...

l can try on my system and give u code once i am back to office, but i trust if you try this it will work.

GET_ENTITY_SET  is OData Query op and HTTP GET op

GET_ENTITY         is OData  Read  op and HTTP verb is GET.

0 Kudos

Hello Prasenjit Singh,

I was not (yet) able to get it to work. If you could sent me a code-example I would be grateful.

Regards, Paul Lauwers.

AbhishekSharma
Active Contributor
0 Kudos

Hi Paul,

Please have look to below post:

Hope this will help.

Thanks-

Abhishek

0 Kudos

Thank yo for your answer. It took a while before I was able to look at it.

I added the following code to get the HTTP_METHOD:

data:

     l_http_method    type string,

     l_r_tech_request type ref to /iwbep/cl_mgw_request.

   l_r_tech_request ?= io_tech_request_context.

   l_http_method     = L_R_TECH_REQUEST->MR_REQUEST->HTTP_METHOD.

Problem is now that the MR_REQUEST is protected and can't be retrieved just like that. I could not find any method in the class to expose the data.

AbhishekSharma
Active Contributor
0 Kudos

Hi Paul,

No need to create a new z subclass, please have a look to the class '/IWBEP/CL_MGW_REQUEST_UNITTST' which is subclass of '/IWBEP/CL_MGW_REQUEST'.

reference link :

Integration With Unit Test Framework - SAP NetWeaver Gateway - SAP Library

Hope this will get values.

Thanks-

Abhishek