Application Development 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: 

How to create a SPA/GPA parameter ?

Former Member
0 Kudos

Dear Experts,

Please help me in creating a new SPA/GPA parameter. Please let me know the procedure to this creation.

Thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi S R,

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.

To fill the initial screen of a program using SPA/GPA parameters, you normally only need the SET PARAMETER statement.

Regards,

Tanveer.

Please mark helpful answers.

3 REPLIES 3

Former Member
0 Kudos

Hi,

Type the SET PARAMETER syntax and double click on the Parameter name and you can create from there.

Or you can create from SE80. Right click on the program and you will get options to create different kinds of objects and parameter should be one of them

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

Hi S R,

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.

To fill the initial screen of a program using SPA/GPA parameters, you normally only need the SET PARAMETER statement.

Regards,

Tanveer.

Please mark helpful answers.

manuel_bassani
Contributor
0 Kudos

Hi,

just insert a record in table TPARA with the ID name and a description (you can use transaction SM30)

Regards, Manuel

Please remember to reward points for useful answers