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

ABAP PROGRAM

Former Member
0 Likes
657

Hi,

I need to get back some values from a program to use in other program.

could anyone give me the guidance to do it.

thanks in advance.

6 REPLIES 6
Read only

Former Member
0 Likes
608

Hi,

You can do it by

1. Exporting the values to memory and importing the

values in other program.You can export the values to

memory if it is with in the ABAP session or else you

need to use export to database INDX addition.

2. Submit the other program and pass the values directly.

This way you call other report from your program and

pass values.For more information and additions for

submit you can check the sap documentation by

pressing F1 help for Submit.

Hope this helps.

Read only

Former Member
0 Likes
608

if you want one program variable values to be appear in other programs at runtime,

first you need to do,

export the first program variable values to MEMORY

then in the second program

IMPORT the values from that memory location.

Regards

Srikanth

Read only

Former Member
0 Likes
608

Hi,

To export the value from your prg use

<b>export field to memory id 'MEMO'.</b>

To import the exported value

<b>import field from memory id 'MEMO'.</b>

Regards

Read only

Former Member
0 Likes
608

u can used

export field to memory id .

import field from memory id .

Read only

Former Member
0 Likes
608

hi,

Its simple.

Use submit program and in this case you can pass the values directly.

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.

Addition

... AND RETURN

Effect

The AND RETURN addition determines the object accessed by the runtime environment after program access is completed:

Without the AND RETURN addition, the internal session of the program accessed replaces the internal session of the calling program in the same position in the call sequence. Once program access is completed, the system returns to before the position from which the calling program was started.

As of Release 6.10, the content of the system field sy-calld at SUBMIT is copied by the calling program without AND RETURN. Before 6.10, the system entered the value "X", which was incorrect when the program was accessed from the first program in a call sequence.

The addition AND RETURN starts the executable program in a new internal session. The session for the calling program is retained. Once program access is completed, program execution for the calling program continues after the SUBMIT statement.

Note

When the SUBMIT statement is executed, the system runs an authorization check for the authorization group specified in the program attributes.

... [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 are then transferred to the table of the addition WITH SELECTION-TABLE. 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.

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.

<b>Or</b>

first you need to exporting the values to memory from program 1 and then import the values in program 2.

Regards,

Richa

Read only

0 Likes
608

You can use the export to memory id and import from memory id commands to transfer values between two programs.