Tuesday, March 25, 2008
SAP SPA/GPA Parameters
SAP SPA/GPA Parameters
The SPA SET PARAMETERS and GPA GET parameters is a useful way in passing values to SAP memory. Using these Parameters you can pass values to SAP programs and even get values generated from SAP Programs.
SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. It is important to note that the values are stored in GLOBAL and User-Specific Memory.
A Parameter ID can be 20 Characters long.
You can pass values to the SAP memory using SET PARAMETER ID <pid> field <f> and get the values from the SAP Memory using GET PARAMETER ID <pid> field<f>.
On a selection screen, you link fields to parameters using the MEMORY ID addition in the PARAMETERS or SELECT-OPTIONS statement. If you specify an SPA/GPA parameter ID when you declare a parameter or selection option, the corresponding input field is linked to that input field.
Now we will see an example as to how SET PARAMETER and GET PARAMETER can be used in a real life Scenario.
Suppose you want to call a Transaction and Skip the Initial Screen. For example in transaction VA01 if the parameters on the initial screen are fixed and you want to preset to the user screen no 2. then it can be done as follows.
data: d_order_type_field like vbak-auart value 'OR'.
SET PARAMETER ID 'AAT' FIELD d_order_type_field.
CALL TRANSACTION 'VA01' AND SKIP FIRST SCREEN.
Please not that the PARAMETER ID AAT can be obtained by pressing F1 on the filed. See the figure shown below.
You can also get the latest Order number from SAP using GET PARAMETER ID as follows.
data: d_order_no like vbak-vbeln.
Code for BDC.
GET PARAMETER ID 'AUN' FIELD d_order_no.
Form more details check the following
Creating a Sales Order using RFC.
The SPA SET PARAMETERS and GPA GET parameters is a useful way in passing values to SAP memory. Using these Parameters you can pass values to SAP programs and even get values generated from SAP Programs.
SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. It is important to note that the values are stored in GLOBAL and User-Specific Memory.
A Parameter ID can be 20 Characters long.
You can pass values to the SAP memory using SET PARAMETER ID <pid> field <f> and get the values from the SAP Memory using GET PARAMETER ID <pid> field<f>.
On a selection screen, you link fields to parameters using the MEMORY ID addition in the PARAMETERS or SELECT-OPTIONS statement. If you specify an SPA/GPA parameter ID when you declare a parameter or selection option, the corresponding input field is linked to that input field.
Now we will see an example as to how SET PARAMETER and GET PARAMETER can be used in a real life Scenario.
Suppose you want to call a Transaction and Skip the Initial Screen. For example in transaction VA01 if the parameters on the initial screen are fixed and you want to preset to the user screen no 2. then it can be done as follows.
data: d_order_type_field like vbak-auart value 'OR'.
SET PARAMETER ID 'AAT' FIELD d_order_type_field.
CALL TRANSACTION 'VA01' AND SKIP FIRST SCREEN.
Please not that the PARAMETER ID AAT can be obtained by pressing F1 on the filed. See the figure shown below.
You can also get the latest Order number from SAP using GET PARAMETER ID as follows.
data: d_order_no like vbak-vbeln.
Code for BDC.
GET PARAMETER ID 'AUN' FIELD d_order_no.
Form more details check the following
Creating a Sales Order using RFC.
Labels:
GET PARAMETER,
SAPPARAMETERID,
SET PARAMETER
Subscribe to:
Post Comments (Atom)
ABAP TIPS
|
Always use Pretty Printer and Extended Program Check before releasing the code. Do not leave unused code in the program. Comment the code thoroughly. Align the comments and the Code. Follow the SAP Standards and SAP Best Practices guidelines. It’s a good practice to take a dump of the code on your local drive. |
No comments:
Post a Comment