Application Development 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: 

SET/ GET and EXPORT/ IMPORT

Former Member
0 Kudos

What is the difference between SET/ GET and EXPORT/ IMPORT?

Regards,

Subhasish

1 ACCEPTED SOLUTION

Former Member

SET/GET related to SAP memory.

SAP memory is session independent. U can access from different session.

EXPORT/ IMPORT related to ABAP memory.

ABAP memory is session dependent. U can't access from different session.

7 REPLIES 7

Former Member
0 Kudos

IMPORT and EXPORT are program specific (ABAP Memory) and it depends on what memory id the developer is giving.

Where SET / GET PARAMETER, there is a memory id associated with a field all the time.

You cannot use IMPORT / EXPORT when you want to pass something to Standard programs, like for example CALL TRANSACTION tcode AND SKIP FIRST SCREEN. Here you will have to use the SET/GET.

regards,

Mukesh kUmar

0 Kudos

Thank you for your reply. I got it. But I can not understand your second paragraph i.e. CALL TRANSACTION tcode AND SKIP FIRST SCREEN.....if you can explain this a bit more that will be great.

Regards,

Subhasish

0 Kudos

Hi Subhasish,

Example : you have created one button on your application bar in ALV program and you want to select a row in the ALV list and on pressing that button your data of that row should go to another transaction.In that case before using the call transaction method you have to use SET parameter

FORM user_command USING r_ucomm TYPE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN 'UDG'.

CLEAR wa_out.

READ TABLE i_out INTO wa_out INDEX rs_selfield-tabindex.

SET PARAMETER ID 'QLS' FIELD wa_out-prueflos.

CALL TRANSACTION 'QA13' AND SKIP FIRST SCREEN.

Former Member

SET/GET related to SAP memory.

SAP memory is session independent. U can access from different session.

EXPORT/ IMPORT related to ABAP memory.

ABAP memory is session dependent. U can't access from different session.

Former Member
0 Kudos

Hi Subhasish,

GET: Gets the table dbtab for processing while the logical database is running. You can address all the fields from dbtab in the subsequent processing. You can also refer to fields from tables in the logical database on the access path to the table dbtab.

SET: Sets different processing parameters

IMPORT: Imports data objects (fields or tables) from the ABAP/4 memory. Reads in all data without an ID that was exported to memory with "EXPORT ... TO MEMORY." . In contrast to the variant IMPORT FROM DATABASE , it does not check that the structure matches in EXPORT and IMPORT

EXPORT: Exports the objects obj1 ... objn (fields, structures or tables) as a data cluster to ABAP/4 memory . If you call a transaction, report or dialog module (with CALL TRANSACTION , SUBMIT or CALL DIALOG ), the contents of ABAP/4 memory are retained, even across several levels. The called transaction can then retrieve the data from there using IMPORT ... FROM MEMORY . Each new EXPORT ... TO MEMORY statement overwrites any old data, so no data is appended.If the processing leaves the deepest level of the call chain, the ABAP/4 memory is released.

Please reward points if you find this as a right solution

Regards,

Harini

former_member188685
Active Contributor
0 Kudos

Hi,

Check this SAP Help.

SAP and ABAP Memory

There is a difference between the cross-transaction SAP memory and the transaction-specific ABAP memory.

Global SAP memory

The global SAP memory is available to a user during the entire duration of a terminal session. Its contents are retained across transaction boundaries as well as external and internal sessions. The SET PARAMETER and GET PARAMETER statements allow you to write to, or read from, the SAP memory.

Input fields on screens can be linked with parameters in the SAP memory, which allows you to preassign values to the input fields on initial screens.

With general screens, the linking takes place during the definition of the screen using the Screen Painter tool. When setting the field attributes of an input field, you can specify the ID of an SPA/GPA parameter in the Parameter-ID attribute. In the checkboxes SET Parameter and GET Parameter you can specify whether the screen field is filled with the value of the SPA/GPA parameter at the time of PBO or whether the SPA/GPA parameter is filled with the user input on the screen at the time of PAI.

With selection screens, the linking is carried out using the MEMORY ID addition to the PARAMETERS or SELECT-OPTIONS statement. If you specify an SPA/GPA parameter ID, when declaring a parameter or selection criterion, the relevant input field is linked with the parameter.

Local SAP memory

The local SAP memory is available to the user throughout a transaction, within which you can also call other program units, for example using SUBMIT or CALL TRANSACTION. With SET PARAMETER you write to both the global and the local SAP memory. If the global SAP memory is changed by an external mode of the same user, the local SAP memory remains unchanged. This ensures that parameters set in the frame of a transaction remain unchanged until the end of this transaction. The local SAP memory is deleted after the transaction is ended.

ABAP memory

The contents of the ABAP memory are retained only during the lifetime of an external session (see also Organization of Modularization Units). You can retain or pass data across internal sessions. The EXPORT TO MEMORY and IMPORT FROM MEMORY statements allow you to write data to, or read data from, the ABAP memory.

Please consult Data Area and Modularization Unit Organization documentation as well.

and

Memory Structures of an ABAP Program

Regards

vijay

Former Member
0 Kudos

Hi,

Export/Import are corresponds to ABAP memory, SET/GET corresponds to SAP memory.

ABAP memory is available to all program sessions & subsequent sessions created with in the program for example if you are internally calling another program.You can use Export/Import parameter it is available to all such internal sessions.

SAP memory this is a session in which all external session that is every window you are opening in sap can access.You can use SAP memory to pass data with a session( as like export & import) or to pass data across session.

SET/GET parameters you can only use for field for which SAP has given you the option.See in Data element for set & get parameters.Your call transaction stmt is example for set/get parameters usage.

Regards,

Karthik.k