‎2008 May 05 10:17 AM
Hi Experts,
Pl. tell me the difference between the parameter SET and GET
Regards,
Uday
‎2008 May 05 10:30 AM
Hi Uday,
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.
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.
Reward if useful
Regards,
Jayaram
‎2008 May 05 10:21 AM
hi,
You can save values in SAP memory using a parameter ID. These are user and terminal-session
specific, but available to all internal sessions.
SET PARAMETER copies the corresponding field contents into SAP memory in the PAI processing
block.
GET PARAMETER copies the corresponding field contents from SAP memory at the end of the PBO
processing block (after data has been transferred from the program), if the screen field still has its initial
value.
You can link an input/output field to an area of SAP memory in the ABAP Dictionary.
When you use an input/output field that is defined in the ABAP Dictionary, its parameter ID is displayed
in the Dictionary attribute Parameter ID in the Screen Painter.
The SPA and GPA attributes allow you to enable the set and get parameter functions separately.
You can define parameter IDs in table TPARA.
Hope this helps.
Edited by: Runal Singh on May 5, 2008 2:52 PM
‎2008 May 05 10:24 AM
Hi,
You can use SAP set, SAP get, or SAP call elements in performance tests to add items such as a field selection, a keyboard entry, a get element for reference use, or any advanced interaction with the SAP client GUI.
SAP set elements represent user interactions with the SAP GUI, such as entering a value into a field. SAP set elements are contained in SAP screen elements. SAP screen elements can be windows, dialog boxes or transaction screens that are part of a recorded transaction.
SAP get elements enable you to retrieve information from the SAP GUI, such as field values. SAP get elements are contained in SAP screen elements. The primary use of an SAP get element is to create a reference field or a verification point in the test. An SAP verification point is actually an SAP get element with a verification point enabled.
SAP call elements represent all the various user interactions that are neither an SAP set or an SAP get element. For example, selecting an object, scrolling, or pressing the Enter key generates an SAP call.
You can use either the test editor or the SAP Protocol Data view to create or edit SAP set, get, or call elements. When using the SAP Protocol Data view, you can select SAP screen objects from the screen capture and copy the information directly to the new SAP set, get, or call element. Using the SAP Protocol Data view to create or edit an SAP event is much easier than adding an event manually from the test editor.
The SAP Protocol Data view contains two pages that are synchronized with each other and with the test editor:
Screen Capture displays a graphical screen capture of the SAP GUI. You can select all GUI objects, such as windows, buttons, fields or areas.
Object Data provides information about the selected GUI object: identifier, type, name, text, tooltip, and subtype.
To add an SAP set, get, or call element, perform the following steps:
Open the test in the test editor and the SAP Protocol Data view. If the SAP Protocol Data view is not open, click Window > Show View > Other > Test > SAP Protocol Data
In the Test Contents area of the test editor, expand a transaction and an SAP screen. The SAP Protocol Data view displays a screen capture of the selected transaction.
Inside the transaction, select the item for which you want to enter a new value. The Screen Capture page of the SAP Protocol Data view displays the screen capture of the SAP GUI with the corresponding GUI object highlighted.
In the SAP Protocol Data view, right-click the GUI object for which you want to create the SAP set, get, or call element, and then click Create Element. This opens the window, which already contains the Identifier from the recorded session.
In the Create Element window, specify the type of SAP element that you want to create. Enter the value that you want to add, and then do one of the following procedures, depending on your testing objectives:
To create a simple SAP set element, select Set text, and then type the text value that you want to input into the SAP GUI.
To create an SAP get or an SAP call element, select Advanced, and then select SAP Set, or SAP Call in the Element type list. Use a SAP set to input a value into the SAP GUI client. Use a SAP call to call a method for advanced interaction with the SAP GUI. Specify the property to get or the method of the call. Refer to SAP documentation for information about SAP call methods and properties. SAP call elements are created with default values that you can change in the test editor. You can use SAP call methods to define a verification point or for data correlation.
To create a non-text SAP set element, select Advanced, and then select SAP Set in the Element type list. Specify the property to set and enter a value if that property requires one.
Click Finish.
After creating elements, you can use the test editor to change values. You can also replace values with a datapool variable or a reference.
Reward If Helpful
Jagadish
‎2008 May 05 10:26 AM
Hi,
Set and display default in an element.
If you choose Set Parameter, the system stores the value entered by the user in the relevant Parameter ID parameter.
If you choose Get Parameter, the system displays the value in Parameter ID in the element instead of the initial value.
Regards,
Suganya.
‎2008 May 05 10:27 AM
Check out the below link
SET
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/set.htm
GET
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/get.htm
Regards,
Santosh
‎2008 May 05 10:30 AM
Hi Uday,
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.
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.
Reward if useful
Regards,
Jayaram
‎2008 May 05 10:42 AM
Hi,
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.
Cheers,
vasavi.v