Skip to Content
-1

how to know how many times odata service has been called for all the rows.

Dec 29, 2017 at 11:09 AM

132

avatar image

Hello ,

I have a use case like example I have a table called Page , for that i have made odata service and in that table count field is their.

so when ever the services is called using the pageId in the Url the count field should get Increment so that we will get to know how many times the user has viewed the page.

how to know how many times odata service has been called for all the rows.

Thanks,

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

2 Answers

Ankit Maskara
Jan 07 at 05:35 PM
-1

In your Page Table have at least two columns - Page Id and Counter. whenever a get call is triggered, after successful retrieval increment the counter by 1 and persist the same. On next call , the counter will hold the number of times the Page has been retrieved earlier and use the same for current processing. Also after successful retrieval increment the counter again by 1 and persist. Repeat this process for all calls.

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

Thanks for replying Ankit,

Page_Id and Count both are their in my table.

to Increment the counter I have to get the page_id , so based on Page_id I'll update the Counter,

I'm not able to get Page_Id when the Get service is Triggered.

Thanks,

0

Isn't the Page_Id the key field of your entity?

0

Thanks Ankit,

Yes It is the Primary Key.

0

Then you should be getting via in GET_KEYS method of importing parameter IO_TECH_REQUEST_CONTEXT.

0

Thanks for the Help Ankit,

how and In which file I have to write those functions,

In xsjslib (SAP HANA ) I can write those (GET_KEYS,O_TECH_REQUEST_CONTEXT.) Methods.

Thanks and Regards,

Miyan Abdul Aleem

0

I thought you were using NetWeaver Gateway and made my recommendation. For HANA try as this

https://help.sap.com/viewer/4505d0bdaf4948449b7f7379d24d0f0d/2.0.02/en-US/2ec97095dcbd420794670912e3bc9cd6.html

0

Thank you Ankit,

l'll go through that link :)

0
Iftah Peretz
Dec 31, 2017 at 02:03 PM
0

Hi,

In the place where you issue your OData, you should have a mechanism that controls that - using some persist data structure, e.g. DB table (that could have other identifiers apart from the counter - like caller, current id, unique number etc.) for the case it is consumed from multiple resources.

In addition, there are many analytic tools to track user usage (like Google Analytics).

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

Thanks for helping Iftah,

0