‎2007 Nov 02 1:32 AM
Hi,
I have 2 ABAP program which was created in dialog screen not selection-scrren and list-processing. I using IMPORT & EXPORT with MEMORY ID 'mem_test' to pass value. I would like to know will there be any memory corruption and cause inconsistency when there is multi-concurrency of user using the ABAP program.
IF using IMPORT & EXPORT without Memory ID, will it cause any memory corruption and cause inconsistency when 2 person accessing the program at a time, or the memory will be smart enough to allocated another new memory space for the other user?
How do i avoid this? Is there any other better way like using submit? Please advise.
Regards,
Rayden
‎2007 Nov 02 2:54 AM
Hi,
The export and import memory will be in effect during the program execution. Even multiple users are using the same program as the same time. The memory will be differenct...Still the export and import memory works...
Thanks
Naren
‎2007 Nov 02 2:15 AM
Hi Rayden,
Yes I think the memory will overwrite as the same is given in sap help also. To avoid this what you can do is
TO MEMORY ID <key>.
here you can have <key> as sy-uname so that it will be only for that user.
Regards,
Atish
‎2007 Nov 02 2:25 AM
Hello Rayden,
If you want to use the data in the same session than you can use the EXPORT VAR TO memory ID 'ZXXX'. This will not cause any problem as this memory is only avaliable to only one user and for only one perticular session.
Regards,
Naimesh Patel.
‎2007 Nov 02 2:50 AM
SUBMIT
Syntax
SUBMIT {rep|(name)} [selscreen_options]
[list_options]
[job_options]
[AND RETURN].
Addition:
... AND RETURN
Effect
The SUBMIT statement accesses an executable program rep. The executable program is executed as described under Calling Executable Reports.
The program name rep can either be specified directly or as the content of a character-like data object name. The data object name must contain the name of the program to be accessed in block capitals. If the program specified in name is not found, an irretrievable exception is generated.
The selscreen_options additions can be used to determine the selection screen for the program accessed and to supply it with values.
The list_options additions allow you to influence the output medium and the page size in the basic list for the program accessed.
You can schedule the program for background processing by specifying job_options.
SUBMIT - selscreen_options
Syntax
... [USING SELECTION-SCREEN dynnr]
[VIA SELECTION-SCREEN]
[selscreen_parameters] ... .
Extras:
1. ... USING SELECTION-SCREEN dynnr
2. ... VIA SELECTION-SCREEN
Effect
The addition USING SELECTION-SCREEN specifies the selection screen, VIA SELECTION-SCREEN specifies whether it is displayed. The additions selscreen_parameters provide values for the parameters, selection criteria, and the free selection of the called selection screen.
The values are transferred to the selection screen between the events INITIALIZATION and AT SELECTION-SCREEN OUTPUT The following hierarchy applies for transferring values:
First, the variant of the addition USING SELECTION-SET is transferred, which sets all parameters and selection criteria to the values of the variant. The values previously set in the called program are overwritten.
The values of the table of the addition WITH SELECTION-TABLE are then transferred. All parameters and selection criteria specified there are overwritten accordingly.
Finally, the values of the additions WITH sel value are transferred. All parameters and selection criteria are overwritten accordingly. If the addition WITH sel value is used more than once for the same parameter, this is overwritten with the last specified value. If the addition WITH sel value is used more than once for the same selection criterion, a selection table with the corresponding number of lines is transferred.
Providing values for free selections is independent of this hierarchy.
Notes
The options for parameter transfer enable a selection screen to be viewed as a parameter interface of an executable program. This applies particularly for background selection screen processing and for parameters and selection criteria that are defined without screen elements using the addition NO-DISPLAY
When transferring data, note that any adjustments made to the screen format, such as abbreviations or the execution of conversion routines, are not executed for fields for which there are no screen elements on the selection screen. This applies for all parameters and selection criteria defined with NO DISPLAY. It also applies for all lines of a selection table with the exception of the first line.
The additions selscreen_parameters only work the first time the called program is executed. If a selection screen is displayed in the called program, the runtime environment calls the program again after it is finished, thereby replacing the values specified in selscreen_parameters with the previous input values.
Addition 1
... USING SELECTION-SCREEN dynnr
Effect
This addition specifies which selection screen is called. dynnr is a data object that must contain the screen number of a selection screen defined in the called program when the SUBMIT statement is called.
If the addition USING SELECTION-SCREEN is omitted or the screen number 1000 is entered, the standard selection screen is called. If no standard selection screen is defined in the called program, no selection screen is called.
If a screen number that is not 1000 is entered in the addition USING SELECTION-SCREEN, the corresponding independent selection screen is called. If no selection screen with this screen number is defined in the called program, this leads to an untreatable exception.
Addition 2
... VIA SELECTION-SCREEN
Effect
If this addition is specified, the selection screen is displayed on the screen. Otherwise, background selection screen processing takes place. In background selection screen processing, the selection screen events are triggered without the selection screen being displayed.
SUBMIT - list_options
Syntax
... [LINE-SIZE width]
[LINE-COUNT page_lines]
{ [EXPORTING LIST TO MEMORY]
| [TO SAP-SPOOL spool_options] } ... .
Extras:
1. ... LINE-SIZE width
2. ... LINE-COUNT page_lines
3. ... EXPORTING LIST TO MEMORY
4. ... TO SAP-SPOOL spool_options
Effect:
These additions affect the basic list in the program accessed. While LINE-SIZE and LINE-COUNT influence the formatting, the other two additions determine the output type of the list.
EXPORTING LIST TO MEMORY saves the list to the ABAP Memory and TO SAP-SPOOL sends it as a print list to the SAP spool system. If you do not specify these additions, the basic list is displayed as a screen list.
Note:
The additions only take effect the first time the program accessed is executed. If a selection screen is displayed in the program accessed, the runtime environment accesses the program again after completion, without taking account of the list_options additions. This is particularly important to the addition TO SAP-SPOOL, because the basic list is displayed as a screen list and not as a print list when the program is accessed again. For this reason, it is advisable not to use the addition VIA SELECTION-SCREEN when using list_options.
Addition 1
... LINE-SIZE width
Addition 2
... LINE-COUNT page_lines
Effect
These additions define the line width and page length of the basic list. They have the same effect as the additions of the same name in the program initiating statement for the program accessed. If the program accessed has the same additions in the program initiating statement, these overwrite the values specified for SUBMIT.
Addition 3
... EXPORTING LIST TO MEMORY
Effect
This addition stores the basic list for the program accessed in the ABAP Memory. It can only be used together with the addition AND RETURN.
The list is stored in the ABAP Memory as an internal table of the row type ABAPLIST, ABAPLIST being a structured data type in the ABAP Dictionary.
The calling program can access the list stored once program access is completed, using function modules belonging to the function group SLST.
The function module LIST_FROM_MEMORY loads the list from the ABAP Memory to an internal table of the row type ABAPLIST.
The function module WRITE_LIST inserts the content of an internal table of the row type ABAPLIST in the current list.
The function module DISPLAY_LIST displays the content of an internal table of the row type ABAPLIST in a separate list screen.
Note
The addition can only work provided the function key Enter is not linked to a function code in the GUI status last defined for the program accessed.
Example
Once the program report has been accessed, the list stored there in the ABAP Memory is read by means of function modules and inserted in the current list.
DATA list_tab TYPE TABLE OF abaplist.
SUBMIT report EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
CALL FUNCTION 'WRITE_LIST'
TABLES
listobject = list_tab.
ENDIF.
Addition 4
... TO SAP-SPOOL spool_options
Effect
This addition causes a new print list level to be opened in the internal session of the program called and assures that the first output statement for the basic list creates a new spool request. All list outputs of the program called are transferred as print lists, page by page, to the SAP spool system. Using the spool_options additions, the print parameters and archiving parameters of the spool request are specified.
Note
It is not possible to switch from the print list to a screen list in the program called. The statement NEW-PAGE PRINT OFF does not work on print list levels created using SUBMIT TO SAP-SPOOL.
Example
Accessing an executable program and creating a spool request.
DATA: print_parameters TYPE pri_params,
archi_parameters TYPE arc_params,
valid_flag(1) TYPE c.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
archive_mode = '3'
IMPORTING
out_parameters = print_parameters
out_archive_parameters = archi_parameters
valid = valid_flag
EXCEPTIONS
invalid_print_params = 2
OTHERS = 4.
IF valid_flag = 'X' AND sy-subrc = 0.
SUBMIT submitable TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
ARCHIVE PARAMETERS archi_parameters
WITHOUT SPOOL DYNPRO.
ENDIF.
‎2007 Nov 02 2:54 AM
Hi,
The export and import memory will be in effect during the program execution. Even multiple users are using the same program as the same time. The memory will be differenct...Still the export and import memory works...
Thanks
Naren