Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Andre_Fischer
Product and Topic Expert
Product and Topic Expert


When building SAP Fiori-like custom applications customers may have the concern that confidential data may be cached by the browser and may thus potentially remain on the device.

To avoid this behavior the response of our SAP NetWeaver Gateway OData service has to contain the following values in the HTTP header:

cache-control no-cache, no-store

pragma no-cache

There is fortunately the option for the SAP NetWeaver Gateway developer to instruct the User Agent not to cache specific data if needed.

We will enhance the simple sample service showing product data that I have descirbed in the following whitepaper

How to Develop a Gateway Service using Code based Implementation

The only thing we have to do is to add the following coding into the GET_ENTITYSET method I have taken from the SAP Online Help.

data: ls_header type ihttpnvp.

ls_header-name = 'Cache-Control'.

ls_header-value = 'no-cache, no-store'.

set_header( ls_header ).


ls_header-name = 'Pragma'.

ls_header-value = 'no-cache'.

set_header( ls_header ).

When running the following URI /sap/opu/odata/sap/ZPRODUCT_SRV/ProductSet in the SAP NetWeaver Gateway Client you will notice that the appropriate header values have been set.

7 Comments