‎2006 Sep 15 12:23 PM
HI FRIENDS,
what is SET PARAMETER ID & GET PARAMETER ID.
REGARDS,
SIRI
‎2006 Sep 15 12:26 PM
To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETER statements.
To fill one, use:
SET PARAMETER ID <pid> FIELD <f>.
This statement saves the contents of field <f> under the ID <pid> in the SAP memory. The code <pid> can be up to 20 characters long. If there was already a value stored under <pid>, this statement overwrites it. If the ID <pid> does not exist, double-click <pid> in the ABAP Editor to create a new parameter object.
To read an SPA/GPA parameter, use:
GET PARAMETER ID <pid> FIELD <f>.
‎2006 Sep 15 12:26 PM
SET PARAMETER ID pid FIELD f.
Writes the contents of the field f to the global user-specific SAP memory and the local transaction-specific SAP memory under the ID pid. Any existing values under the same ID are overwritten.
Parameter IDs can be up to 20 characters long. They cannot consist entirely of spaces
GET PARAMETER ID pid FIELD f.
First, the value stored under the key pid is transferred from the local SAP memory into the field f. If this key is not available in the local SAP memory, the value stored under the same key pid is transferred from the global user-related SAP memory to the field f.
‎2006 Sep 15 12:27 PM
Refer this help:
http://help.sap.com/saphelp_nw2004s/helpdata/en/d7/e21344408e11d1896b0000e8322d00/frameset.htm
and:
SET PARAMETER
Basic form 5
SET PARAMETER ID pid FIELD f.
In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See ABAP Unicode - Other Changes
Effect
Writes the contents of the field f to the global user-specific SAP memory and the local transaction-specific SAP memory under the ID pid. Any existing values under the same ID are overwritten.
Parameter IDs can be up to 20 characters long. They cannot consist entirely of spaces. The SAP system description contains an overview of parameter IDs. You can also produce a list using the ABAP Workbench.
Notes
The global, user-specific SAP memory is available to a user for the duration of a single terminal session. Values written to it are retained even when the user exits a program.
Do not use SAP memory as a temporary storage area, since parallel sessions belonging to the same user all use the same memory area.
Only store data of the types C, N, D, and T, as well as structures that consist of these types, in the SAP Memory.
You can create new parameter IDs using the ABAP Workbench.
Parameter IDs may have a namespace prefix.
Example
DATA REPID like sy-repid VALUE 'RSPFPAR'.
SET PARAMETER ID 'RID' FIELD REPID.
Sets the program name so it can be passed to other programs.
Exceptions
Non-Catchable Exceptions
Cause: Key consists entirely of spaces
Runtime Error: SET_PARAMETER_ID_SPACE
Cause: Key longer than 20 characters
Runtime Error: SET_PARAMETER_ID_TOO_LONG
Cause: Value exceeds 250 characters
Runtime Error: SET_PARAMETER_VALUE_TOO_LONG
GET PARAMETER
Basic form 3
GET PARAMETER ID pid FIELD f.
In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See ABAP Unicode - Other Changes
Effect
First, the value stored under the key pid is transferred from the local SAP memory into the field f. If this key is not available in the local SAP memory, the value stored under the same key pid is transferred from the global user-related SAP memory to the field f.
A parameter ID can have up to 20 characters. You can find an overview of the keys (parameters) used in the SAP system description or the appropriate function in the ABAP Workbench.
The Return Code is set as follows:
SY-SUBRC = 0: A value was read from SAP memory. SY-SUBRC = 4: No value was found in SAP memory under the specified key.
Notes
The global user-related SAP memory is available to each user for the entire duration of a terminal session. For this reason, set values are retained when you leave a program.
You should not use SAP memory for temporary storage because a user's parallel sessions use the same global memory.
Example
Read the program name from SAP memory:
DATA : REPID LIKE SY-REPID.
GET PARAMETER ID 'RID' FIELD REPID.
Related
SET PARAMETER
Fill Initial Screens with SPA/GPA Parameters
the above is an excerpt from sap documentation.
Regards,
ravi
‎2006 Sep 15 12:27 PM
Hi,
Using set and Get parameter ids you can set and get the values across the Sessions. They correspond to SAP memory.
Hope this helps.