Entering content frame

Background documentation setPersistent Function Locate the document in its SAP Library structure

Purpose

Makes data persistent for an entire user session or removes the persistence.

The context is initialized at the beginning of each request, so the lifetime of context data lasts no longer than the duration of one request/response cycle. Since there can be several such cycles during a user session (which lasts from user logon to user logoff ), the data merged from the service files is, by default, the only data that is persistent for the duration of a user session.

This function allows you to make any data persistent for an entire user session in a session context rather than just for one request/response cycle.

To find out whether context data is persistent for an entire user session or not, you can use the getPersistent function.

Syntax

setPersistent (<cntxtvarname>, <value>)

Description

If no session context exists when you call the function, the ITS creates it.

The session context and the session container are deallocated at the end of each user session.

Example

Make data persistent for an entire user session:

`setPersistent (cntxtname, 1)`

Make data no longer persistent for an entire user session:

`setPersistent (cntxtname, 0)`

Leaving content frame