Skip to Content
avatar image
Former Member

Set and get parameter id

Hi,

I need to store one variable value and I need to retrieve the same variable value in same program. For this I have written set and get parameter ids in the same program. It is working fine but if I log off the system and if I logon the system it is not working I mean before log off the variable is showing some value if I log on again that variable is showing empty. But I want to capture the field values after log off and log on also. Is there any other option can I use table?

Please help me I will give points.

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 13, 2007 at 06:46 AM

    Hi

    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

    SAP global memory retains field value through out session.

    set parameter id 'MAT' field v_matnr.

    get parameter id 'MAT' field v_matnr.

    They are stored in table <b>TPARA</b>.

    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.

    ABAP memory is temporary and values are retained in same LUW.

    export itab to memory id 'TEST'.

    import itab from memory Id 'TEST'.

    Here itab should be declared of same type and length.

    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

    Regards

    Anji

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 13, 2007 at 06:46 AM

    Hi,

    What exactly is your requirement? Can you pleaes elaborate.

    If Set/Get is not working... try Export/Import to database.

    Regards,

    Aj

    Add comment
    10|10000 characters needed characters exceeded