‎2008 Jul 07 10:07 AM
Hi,
Can you help me with specific scenarios/examples where we can use only
1) import and export parameters
2) and another where we can use set and get
regards
prasanth
‎2008 Jul 07 10:13 AM
Hi,
go through this....
we used get and set for SAP memory....
The SAP Memory is a user-specific memory area of the current application server, which is accessed by all main sessions of a user session at once. ABAP programs have access to SPA/GPA parameters stored in the SAP Memory (also called SET/GET parameters
when we make pur report to interactive one.....
FORM zf_sublist USING ucomm LIKE sy-ucomm
sobj TYPE slis_selfield. "#EC CALLED
DATA : lv_vbeln TYPE vbeln.
IF sobj-fieldname = 'VBELN'.
lv_vbeln = sobj-value.
IF lv_vbeln > 0.
SET PARAMETER ID 'VF' FIELD lv_vbeln.
CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDFORM.
‎2008 Jul 07 10:16 AM
Hi,
If u want to use EXPORT and SUBMIT in the first report, ur internal table data will be first moved to Mem ID and after SUBMIT, it will go to the 2nd report and execution happens in report 2. There if u use IMPORT, the internal table data will be used there and the control will be back to ur report1.
So, the output of Report 2 will be written at first as a result of ur import in report 2. Then the content of report 1 will be wrtten in output.
See this..
Report 1:
report zscr_navigate.
data: a type i value 10,
b type string,
c type string.
data: int_tab type standard table of zprod with header line.
select * from zprod into table int_tab.
export int_tab to memory id 'TEST'.
submit zscr_navigate1 and return.
write / 'back to main'.
Report 2
REPORT ZSCR_NAVIGATE1.
DATA : b TYPE string VALUE 'hello'.
DATA : int_tab TYPE STANDARD TABLE OF zprod,
fs TYPE zprod.
WRITE / b.
IMPORT int_tab FROM MEMORY ID 'TEST'.
CLEAR fs.
LOOP at int_tab INTO fs.
WRITE / fs.
clear fs.
ENDLOOP.
Hope it helps u..
Thanks
Ankur Sharma
‎2008 Jul 07 10:16 AM
Hi,
In EXPORT_PROGRAM1 porgarm p_num value is exported to memory id 'ABC'.
And the IMPORT_PROGRAM1 program is importing p_num from memory id 'ABC'.
REPORT EXPORT_PROGRAM1 .
parameters:
p_num(3) type c .
export p_num to memory id 'ABC'.
WRITE : / P_NUM.
SUBMIT IMPORT_PROGRAM1 AND RETURN.
WRITE : 'EXPORT _PROGRAM',P_NUM.REPORT IMPORT_PROGRAM1 .
data:
P_NUM(3) type c.
import P_NUM from memory ID 'ABC'.
WRITE : P_NUM.Example for SET and GET.
In SET_PROGRAM1 program 'XYZ' is the parameter id for p_num.
In the gET_PROGRAM1 program p_num value is retrieved from memory Id using GET .
REPORT SET_PROGRAM1 .
data:
p_num type sy-datum.
p_num = sy-datum.
set parameter id 'XYZ' field p_num.
submit get_program1 and return .
write : p_num .REPORT GET_PROGRAM1 .
data:
p_num1 type sy-uzeit.
get parameter id 'XYZ' field p_num1.
write : / p_num1.In both examples from one programs, In one program the value of p_num is exported to memory id and the second program is importing it from the memory.
IMPORT, EXPORT are used to retrieve or pass data within the ABAP memory. i.e within internal sessions.
Using SET , GET are used to retrieve or pass data within SAP Memory.I.e Within the external sessions.
Regards,
Rajitha.
‎2008 Jul 07 10:17 AM
Hii!
Check out this link
http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
Regards
Abhijeet Kulshreshtha
‎2008 Jul 07 10:18 AM
HI
Import and Export
IN short we use these statements to pass the data from one report to another by using ABAP memory and SAP memory
to know more about his check this link
http://help.sap.com/saphelp_46c/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm
Under this goto RUNING ABBAP PROGRAMS--->CALLING PROGRAMS AND here you can fine the full details about the import and export and even SET and GET statements usage with a good examples
Regards
Pavan
‎2008 Jul 07 10:18 AM
Hi Friend,
Check this following link for set/get parameters with examples:
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e0435c111d1829f0000e829fbfe/content.htm
Hope this helps you.
Regards,
Chandra Sekhar
‎2008 Jul 07 10:19 AM
Hi
Please refer the following :
SAP Memory
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
ABAP/4 Memory
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.
SAP memory
The SAP memory, otherwise known as the global 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.
ABAP/4 memory
The contents of the ABAP/4 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.
reward points if use ful.
Thanks,
usha
‎2008 Jul 07 10:20 AM
hi,
We can use SET and GET parameters to put the values in the SAP memory. SAP memeory is a User specific memory, a user can access this memory as long as he logs on to the system.
IMPORT and EXPORT parameter are used to put the ABAP Memory values.
ABAP Memory is a session specific memeory and avaliable to only that period during which a session is active.
Hope this will Help.
Reward if helpful.
Sumit Agarwal
‎2008 Jul 07 10:22 AM
hiiii
we use SET GET parameter id to set values & to read values from particular parameter id..
refer following link
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e0435c111d1829f0000e829fbfe/content.htm
you can use in the program like
GET CURSOR FIELD fs_kna1-vbeln
VALUE w_vbeln.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_vbeln
IMPORTING
output = w_vbeln.
SELECT SINGLE vbeln
FROM vbak
INTO w_vbak
WHERE vbeln = w_vbeln.
IF sy-subrc <> 0.
MESSAGE e015(zmsg9).
ENDIF.
SET PARAMETER ID 'AUN' FIELD w_vbeln.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.for import & export statement refer to following link with example in it
http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
regards
twinkal
‎2008 Jul 07 10:24 AM
Hi,
Suppose you want to Pass value in Between two Internal Session The you should use ABAP Memory that is shared by the internal session of same External Session.
In That case you should use EXPORT AND IMPORT options.
But when you want to pass values between two program that are opened in Internal Session Of Two Different External Session.
Then you use SAP Memory Shared By Different External Session.
In That case go for SET And GET PARAMETERS.
Follow this link.
http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9e0435c111d1829f0000e829fbfe/content.htm
http://www.sapbrainsonline.com/ARTICLES/TECHNICAL/ABAP/MEMORY/SAP_INTERNAL_MEMORY.html
http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9df735c111d1829f0000e829fbfe/content.htm
Hope it will help you.
Revert back if any Confusion.
Regards,
Sujit