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

SET/GET PARAMETERS

Former Member
0 Likes
1,615

Hi all,

Does SET/GET PARAMETERS work in BACKGROUND??

please help.

Thanks

Regards

Nitin

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,238

hii

yes it works

regards

vivekanand

7 REPLIES 7
Read only

Former Member
0 Likes
1,239

hii

yes it works

regards

vivekanand

Read only

Former Member
0 Likes
1,238

Yes why not, these are similar to other abap statements.

these only belongs to LDB .

reward if useful.

Amit Singla

Read only

paruchuri_nagesh
Active Contributor
0 Likes
1,238

hi

set/get parametrs works in back ground

go through this

SPA/GPA parameters

The SAP Memory is a user-specific memory area of the current application server, which is accessed by all main sessions of a user session at once. ABAP programs have access to SPA/GPA parameters stored in the SAP Memory (also called SET/GET parameters).

Each SPA/GPA parameter is identified by an ID of up to 20 characters. SPA/GPA parameters can either be created explicitly using the statement SET PARAMETER, or implicitly in a PAI event. They are then available to any programs and any sessions throughout the whole duration of a user session. SPA/GPA parameters are evaluated by the ABAP runtime environment. In ABAP programs, the parameters can be read using the statement GET PARAMETER.

One example of a program that uses SPA/GPA parameters is user maintenance (transaction SU01). In this transaction, on the Parameters tab page, you can enter user-specific parameters, which are then set when the user logs on to the ABAP-based SAP system, and are evaluated by other programs.

Administrating SPA/GPA parameters

The names of SPA/GPA parameters are administrated in the database table TPARA. In the Object Navigator of the ABAP Workbench, the names of SPA/GPA parameters are created in the database table TPARA in upper case, and are linked to packages. The database table TPARA acts as a reservation table for SPA/GPA parameters. If you use SPA/GPA parameters in a program, you should ensure that the name of the parameter is contained in the PARAMID column of the database table TPARA. The SPA/GPA parameters of other applications should not be unintentionally overwritten.

Note

If a name exists in the database table TPARA, this does not automatically mean that the corresponding parameter also exists in the SAP Memory. SPA/GPA parameters are exclusively created during execution of an ABAP program.

SPA/GPA parameters and screen errors

When defining input fields, you can link screen fields to SPA/GPA parameters by entering the name of an SPA/GPA parameter from the database table TPARA as an attribute PARAMETER ID. If the corresponding parameter GET PARAMETER is set and no other value is assigned to the input field, the input field is filled with the value of the SPA/GPA parameter when the screen is sent. If the corresponding attribute SET PARAMETER is set, the content of the input field is assigned to the SPA/GPA parameter at the PAI event. If the parameter does not yet exist in the SAP Memory, it is implicitly created at the PAI event. In selection screens, you can create this link by using the MEMORY ID addition to the statements PARAMETERS and SELECT-OPTIONS.

Notes

A data transport between a screen field and an SPA/GPA parameter in the SAP Memory only takes place if a global data object with the same name as the screen field is declared in the corresponding ABAP program.

If the PAI event is triggered using a function of type "E", no values are assigned to the SPA/GPA parameters that are linked with the screen, and no parameters are created in the SAP Memory.

reward point if u find use ful

regards

Nagesh.Paruchuri

Read only

Former Member
0 Likes
1,238

yes it works in background too. may i know the scenario where u want to use it.

Read only

0 Likes
1,238

well. i have 2 smartforms with 2 different output types and only 1 print program.

When i am executing the first output type, i need some values which i need to use for the second output type, i.e for the second layout. This processing is woring fine on foreground by using a particular transaction.

But now, when they are using transaction VL02N in backgroung mode, the values which need to be filled in my second layout are now empty.

That's why i'm asking if SET/GET work in background.

is there any other issues that might be causing this error??

thanks a lot for your help

Regards

Nitin

Read only

0 Likes
1,238

the scenario is intresting but it has nothing to do with your get/set parameters. there may be some other problem which u need to work out and find out. let me work on the matter and get back to you

Read only

Former Member
0 Likes
1,238

Yes they will work in the BACKGROUND also

<b>SET PARAMETER</b>

SET PARAMETER ID pid FIELD dobj.

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.

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

<b>GET PARAMETER</b>

GET PARAMETER ID pid FIELD dobj.

This statement sets the content of the data object dobj to the content of the SPA/GPA parameter specified in pid. pid must be a flat character-type field that contains no more than 20 characters and does not consist solely of blanks; it is also case-sensitive. dobj must be a flat and (as of Release 6.10) character-type field into which the binary content of the SPA/GPA parameter is transferred unconverted.

If the SPA/GPA parameter specified in pid was not yet created in the SAP Memory for the current user, the data object dobj is initialized and sy-subrc is set to 4.

In a program, only those SPA/GPA parameters can be read for which there is a name in the table TPARA. The extended program check reports an error, if it can be statically determined that an ID specified in pid is not in the table TPARA.

<b>System fields</b>

sy-subrc Meaning

0 The SPA/GPA parameter specified in pid exists for the current user in the SAP Memory and its value was transferred to the target field.

4 The SPA/GPA parameter specified in pid does not exist for the current user in the SAP Memory.

<b>Notes</b>

An SPA/GPA parameter that is readable with GET PARAMETER can previously have been created in the SAP Memory using the SET PARAMETER statement or automatically during the event PAI of a screen or selection screen.

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

Reward if usefull