2007 Oct 12 12:51 PM
Hi sap guys,
Consider there are two programs. That is Program A and Program B.
Now i want to use one variable in program A from program B.
How to do this?
Please Help Me on This
Thanks
Basu
Hi sap guys,
Consider there are two programs. That is Program A and Program B.
Now i want to use one variable in program A from program B.
How to do this?
Please Help Me on This
Thanks
Basu
2007 Oct 12 12:53 PM
Hi,
using set/get parameter id You can Pass the Value from one program to another program.
PARAMETER:INPUT(30).
SET PARAMETER ID 'EXAMPLE' FIELD input.
submit ZEXAMPL1 VIA SELECTION-SCREEN AND RETURN.
report zexample1.
DATA:VAR TYPE SY-UCOMM.
GET PARAMETER ID 'EXAMPLE' FIELD VAR.
write:/ var.
Thanks,
Reward If Helpful.
2007 Oct 12 12:55 PM
using Submit .
means submit one program B inside the Program A .
Example :
REPORT demo_program_submit_rep1.
DATA number TYPE i.
PARAMETERS paramet(14) TYPE c.
SELECT-OPTIONS selecto FOR number.
The program DEMOdemo_program_submit_rep1 is called by the following program using various parameters:
REPORT demo_program_submit_sel_screen NO STANDARD PAGE HEADING.
DATA: int TYPE i,
rspar TYPE TABLE OF rsparams,
wa_rspar LIKE LINE OF rspar.
RANGES seltab FOR int.
WRITE: 'Select a Selection!',
/ '--------------------'.
SKIP.
FORMAT HOTSPOT COLOR 5 INVERSE ON.
WRITE: 'Selection 1',
/ 'Selection 2'.
AT LINE-SELECTION.
CASE sy-lilli.
WHEN 4.
seltab-sign = 'I'. seltab-option = 'BT'.
seltab-low = 1. seltab-high = 5.
APPEND seltab.
SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN
WITH paramet eq 'Selection 1'
WITH selecto IN seltab
WITH selecto ne 3
AND RETURN.
WHEN 5.
wa_rspar-selname = 'SELECTO'. wa_rspar-kind = 'S'.
wa_rspar-sign = 'E'. wa_rspar-option = 'BT'.
wa_rspar-low = 14. wa_rspar-high = 17.
APPEND wa_rspar TO rspar.
wa_rspar-selname = 'PARAMET'. wa_rspar-kind = 'P'.
wa_rspar-low = 'Selection 2'.
APPEND wa_rspar TO rspar.
wa_rspar-selname = 'SELECTO'. wa_rspar-kind = 'S'.
wa_rspar-sign = 'I'. wa_rspar-option = 'GT'.
wa_rspar-low = 10.
APPEND wa_rspar TO rspar.
SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN
WITH SELECTION-TABLE rspar
AND RETURN.
ENDCASE.
Reward points if it is usefull ...
Girish
2007 Oct 12 12:55 PM
Hi,
using set/get parameter id You can Pass the Value from one program to another program.
reward if helpful..
Regards,
nagaraj
2007 Oct 12 12:55 PM
Use EXPORT/IMPORT statement.
Export the value of the variable from program B to a memory id and then import the value of memory id in program A.
This will work only if program A is called internally from Program B.
But if these two programs needs to be run independent of each other then use SET/GET parameter id.
Reward if useful.
2007 Oct 12 12:56 PM
Hi,
It can be done with the use of <b>get/set</b> parameters,
I think it can also done with <b>include</b> program, keep A as include to B.
Regards
2007 Oct 12 9:34 PM
Hi,
You can also use the method of 'Common Part' to share the variables in two different programs.
http://help.sap.com/saphelp_46c/helpdata/en/9f/db97c435c111d1829f0000e829fbfe/frameset.htm
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |