Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

parameters

Former Member
0 Likes
1,070

may i know what are spa/gpa parameters and in what scenario we use those???

7 REPLIES 7
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,023

These are used to fill the input fields of a called transaction with data from the calling program, or use the result of one transaction in a following transaction.

Look at [Filling an Initial Screen using SPA/GPA Parameters|http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9e0435c111d1829f0000e829fbfe/frameset.htm]

Regards

Read only

Former Member
0 Likes
1,023

SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another.

Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement.

The most frequent use of SPA/GPA parameters is to fill input fields on screens

The SAP memory, otherwise known as the global memory, is available to a user during the entire duration of a terminal session. Its contents are retained across transaction boundaries as well as external and internal sessions. The SET PARAMETER and GET PARAMETER statements allow you to write to, or read from, the SAP memory.

ABAP programs can access the parameters using the SET PARAMETER and GET

PARAMETER statements.

To read an SPA/GPA parameter, use:

GET PARAMETER ID <pid> FIELD <f>.

This statement fills the value stored under the ID <pid> into the variable <f>. If the system does

not find a value for <pid> in the SAP memory, it sets SY-SUBRC to 4, otherwise to 0. Finds out the value of a SPA/GPA parameter.

To fill one, use:

SET PARAMETER ID <pid> FIELD <f>.

Syntax

SET PARAMETER ID pid FIELD dobj.

Effect:

This statement sets the content of the SPA/GPA parameter specified in pid to the content of the data object dobj. For pid, a flat character-type field is expected that can contain a maximum of 20 characters, which cannot be exclusively blank characters. pid is case-sensitive. For dobj, a flat, (as of release 6.10 character-type) field is expected, whose binary content is transferred in an unconverted format.

If the SPA/GPA parameter specified for the current user in pid does not yet exist in the SAP memory, it is created. If the SPA/GPA parameter has already been created for the current user, its value is overwritten.

In a program, SPA/GPA parameters can only be created or assigned values if a name exists for them in the table TPARA. The extended program check reports an error if it can statically determine that a name specified in pid is not contained in the database table TPARA. ist.

Note:

For a SPA/GPA parameter specified in pid to match a name in the database table TPARA, it must be entered in upper case.

Example:

If the user selects a flight displayed in the basic list, when the event ATLINE-SELECTION takes place, the SPA/GPA parameters CAR and CON are set to the ID of the airline and the connection number. The names of both parameters are defined in the table TPARA for this purpose. In the initial screen of the transaction DEMO_TRANSACTION, two input fields are linked with SPA/GPA these parameters and are displayed with the selected values as start values.

DATA: carrier TYPE spfli-carrid,

connection TYPE spfli-connid.

START-OF-SELECTION.

SELECT carrid connid

FROM spfli

INTO (carrier, connection).

WRITE: / carrier HOTSPOT, connection HOTSPOT.

HIDE: carrier, connection.

ENDSELECT.

AT LINE-SELECTION.

SET PARAMETER ID: 'CAR' FIELD carrier,

'CON' FIELD connection.

CALL TRANSACTION 'DEMO_TRANSACTION'.

Read only

Clemenss
Active Contributor
0 Likes
1,023

Hi rajesh,

here is an extremely helpful link; you may even put your next question in the search field on top - answer quality is sometimes even better than here:

[what are spa/gpa parameters|http://www.google.com/search?hl=us&q=whatarespa%2Fgpa+parameters&btnG=Google-Search&meta=lr%3Dlang_en]

Regards,

Clemens

Read only

Former Member
Read only

Former Member
0 Likes
1,023

Hi,

here is the simple answer for your Q.

these set/get parameter id's are basically for retriving the earlier data in your screen. suppose u r created an initial screen 100 where u need to enter some value QMNUM (QMEL-QMNUM) by executing the transaction code etc. first time you need to enter the value qmnum. next time if you execute the same transaction code, by default it will show the previous value. if you want to find the parameter id of qmnum go to table qmel. then double click on field type 'QMNUM' there you can find the parameter id.

DATA: gv_fx_qmnum TYPE qmnum.

GET PARAMETER ID 'IQM' FIELD gv_fx_qmnum.

reward if helpful.

Regards

Venkat

Read only

Former Member
0 Likes
1,023

Hi

spa/gpa parameters are set/get parameter id.

through set parameter id dat can be stored in SAP memory.

by get parameter id we can retrieve the dat stored in SAP memory and can be used in other sessions.(programs)

Read only

Former Member
0 Likes
1,023

hi,

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

This statement fills the value stored under the ID <pid> into the variable <f>. If the system does not find a value for <pid> in the SAP memory, it sets SY-SUBRC to 4, otherwise to 0.