‎2007 May 12 10:08 AM
Hi experts,
can any one of you help me in the parameter ID setting because i am facing problem regarding teh PARAMTER ID setting.
<b>Scenario:</b>
i took an existing iD from TPARA table and created my own dataelment ZS_LOCK
by placing the parameter ID in further characterics tab and activated.
but in progam i declared a field ls_lock type zs_lock.
first i set it as ( set parameterid ' AUN' field 'ls_lock)
and later getting as
( get parameterid ' AUN' field 'ls_lock)
My Problem
<b></b>
for User X first i set as 100 and even abel to get the same, but for user Y i am unbale to get the value what i set in USER X login.( Sure that i didn't clear the value and checked in debugging )
So ,please help how can i set global SAP memory value to all users.
‎2007 May 12 10:26 AM
Hi
See this doc , will be helpful
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
ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data
to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.
http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
ABAP Memmory & SAP Memmory
http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
Reward points if useful
Regards
Anji
‎2007 May 12 11:03 AM
hi,
u told u created a data element knoiw,u change it to the same data element of the field u have used here..
The data is not retieved from the memory properly
‎2007 May 12 11:18 AM
Please tell me how can i allow two different users in diiferernt logins to get the same global value that one has set .
but am unable to get the value i set in user x login f
or user Y login.
‎2007 May 12 11:49 AM
Hi
Using the SAP memory i.e SPA/GPA parameters (also known as SET/GET parameters) only we get this functionality
I don't know why it is not working for you.
but it should work.
see the doc.
SET PARAMETER
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'.
*******************************************************************************************************
GET PARAMETER
Syntax
GET PARAMETER ID pid FIELD dobj.
Effect
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.
System fields
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.
Notes
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.
Example
In this example, the current value of the SPA/GPA parameter RID is read from the SAP Memory to the data object prog. In
the screens of the ABAP Workbench, this parameter is linked with the input fields for a program name. When an ABAP
Workbench tool, in which an ABAP program is processed, is first called, the parameter is created at the event PAI and
assigned the name of the program specified there. If in the same user session, no screen is processed that set the
parameter RID and no corresponding SET PARAMETER statement was executed beforehand, RID is not found in the SAP Memory.
DATA: para TYPE tpara-paramid VALUE 'RID',
prog TYPE sy-repid.
GET PARAMETER ID para FIELD prog.
IF sy-subrc <> 0.
MESSAGE 'Parameter not found' TYPE 'I'.
ENDIF.
Reward points if useful
Regards
Anji
‎2007 May 13 4:32 AM
Hi experts,
i found they are only for a specific user .i am getting every thing for teh same users but not to idfferent user.
so ,pls give me the solution for different users to access same value in SAP global memory.