cancel
Showing results for 
Search instead for 
Did you mean: 

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

miyanaleem
Participant
0 Kudos

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,

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member185414
Active Contributor
0 Kudos

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.

miyanaleem
Participant
0 Kudos

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,

former_member185414
Active Contributor
0 Kudos

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

miyanaleem
Participant
0 Kudos

Thanks Ankit,

Yes It is the Primary Key.

former_member185414
Active Contributor
0 Kudos

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

miyanaleem
Participant
0 Kudos

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

former_member185414
Active Contributor
0 Kudos

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/2ec97095dcbd420794670912e3...

miyanaleem
Participant
0 Kudos

Thank you Ankit,

l'll go through that link 🙂

iftah_peretz
Active Contributor
0 Kudos

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).

miyanaleem
Participant
0 Kudos

Thanks for helping Iftah,