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

Parameter-id

Former Member
0 Likes
671

what is the need of set parameter-id in reports ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
556

Parameter ID to put a value in SAP memory.

The global SAP memory remains available to the user during the entire terminal session. This means that set values are retained when you leave a program

3 REPLIES 3
Read only

Former Member
0 Likes
557

Parameter ID to put a value in SAP memory.

The global SAP memory remains available to the user during the entire terminal session. This means that set values are retained when you leave a program

Read only

Former Member
0 Likes
556

To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.

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.

The relevant fields must each be linked to an SPA/GPA parameter.

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.

Read only

Former Member
0 Likes
556

Hi Tangirala,

By using set perameter-id only it save the value in sapmemory.

If u have doubt plz check this program.

REPORT YINTERACTIVEREPORTING .

TABLES : KNA1,VBAK,VBAP,MARA.

SELECT-OPTIONS : S_KUNNR FOR KNA1-KUNNR.

DATA : BEGIN OF ITAB OCCURS 0,

KUNNR LIKE KNA1-KUNNR,

NAME1 LIKE KNA1-NAME1,

END OF ITAB.

DATA : BEGIN OF JTAB OCCURS 0,

VBELN LIKE VBAK-VBELN ,

NETWR LIKE VBAK-NETWR,

END OF JTAB.

DATA: BEGIN OF KTAB OCCURS 0,

POSNR LIKE VBAP-POSNR,

MATNR LIKE VBAP-MATNR,

END OF KTAB.

DATA: FNAME(10) , FVAL(10) TYPE N.

START-OF-SELECTION.

SELECT KUNNR NAME1 FROM KNA1 INTO TABLE ITAB WHERE KUNNR IN S_KUNNR.

LOOP AT ITAB.

WRITE 😕 ITAB-KUNNR HOTSPOT , ITAB-NAME1.

HIDE ITAB-KUNNR.

ENDLOOP.

AT LINE-SELECTION.

CASE SY-LSIND.

WHEN 1.

SELECT VBELN NETWR FROM VBAK INTO TABLE JTAB WHERE KUNNR = ITAB-KUNNR

.

LOOP AT JTAB.

WRITE 😕 JTAB-VBELN HOTSPOT , JTAB-NETWR.

HIDE JTAB-VBELN.

ENDLOOP.

WHEN 2.

SELECT POSNR MATNR FROM VBAP INTO TABLE KTAB WHERE VBELN = JTAB-VBELN.

LOOP AT KTAB.

WRITE : / KTAB-POSNR, KTAB-MATNR HOTSPOT.

ENDLOOP.

WHEN 3.

GET CURSOR FIELD FNAME VALUE FVAL.

SET PARAMETER ID 'MAT' FIELD FVAL.

CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.

ENDCASE.

TOP-OF-PAGE.

WRITE 😕 ' CUSTOMER DETAILS'.

TOP-OF-PAGE DURING LINE-SELECTION.

CASE SY-LSIND.

WHEN 1.

WRITE : / 'SALES DETAILS'.

WHEN 2.

WRITE : / 'ITEM DETAILS'.

WHEN 3.

WRITE 😕 ' MATEREAL DETAILS'.

ENDCASE.

Rewards some points.

Rgds,

P.Nag