‎2007 Sep 05 10:54 AM
Hello,
Can you pls. suggest how I can pass a variable from one program to the other while in the background mode.
The Export and Import parameters do not work while in the background.
Thanks.
Amit
‎2007 Sep 05 12:33 PM
Hi Amit,
EXPORT/IMPORT works in Background mode provided the export & import both are done in background.
Refer this program: it has export/import in background
/people/prashant.patil12/blog/2007/02/20/displaying-alv-grid-in-background-job
<b>*----
Before the export, fill the data fields before CLUSTR
*----
</b>
wa_index-aedat = sy-datum.
wa_index-usera = sy-uname.
EXPORT s_matnr
TO DATABASE indx(st) FROM wa_index ID wa_index_key.
<b>*----
Before the import, fill the data fields before CLUSTR.
*----
</b>
wa_index1-aedat = sy-datum.
wa_index1-usera = sy-uname.
*----
To Import the selection screen data from Calling Program
*----
IMPORT i_mara
FROM DATABASE indx(st) ID wa_index_key1 TO wa_index1.
FREE MEMORY ID wa_index_key1.
Message was edited by:
Prashant Patil
‎2007 Sep 05 10:56 AM
‎2007 Sep 05 11:00 AM
in first program use Set PARAMETER ID 'PER' FIELD 'variable'.
and in second
GET PARAMETER ID 'PER' FIELD 'variable'.
‎2007 Sep 05 11:10 AM
Hi
Create a Background Job with 2 Steps for 2 Report programs.
Now you can use EXPORT and IMPORT to pass the Data between these programs.
In the Calling program..
EXPORT XTAB FROM ITAB1 TO MEMORY ID 'ABC'.
In the Called program
IMPORT XTAB TO ITAB2 FROM MEMORY ID 'ABC'.
Note: SET / GET parameters can pass the Data to Screen fields only....
<b>reward if Helpful.</b>
‎2007 Sep 05 11:33 AM
Neither the EXPORT/IMPORT nor the SET/GET parameters work while in the background mode..
While the program is running in the background, i did debugging using SM50 (Process Overview). And thats I find out that the variable is not imported into the called program.
‎2007 Sep 05 12:33 PM
Hi Amit,
EXPORT/IMPORT works in Background mode provided the export & import both are done in background.
Refer this program: it has export/import in background
/people/prashant.patil12/blog/2007/02/20/displaying-alv-grid-in-background-job
<b>*----
Before the export, fill the data fields before CLUSTR
*----
</b>
wa_index-aedat = sy-datum.
wa_index-usera = sy-uname.
EXPORT s_matnr
TO DATABASE indx(st) FROM wa_index ID wa_index_key.
<b>*----
Before the import, fill the data fields before CLUSTR.
*----
</b>
wa_index1-aedat = sy-datum.
wa_index1-usera = sy-uname.
*----
To Import the selection screen data from Calling Program
*----
IMPORT i_mara
FROM DATABASE indx(st) ID wa_index_key1 TO wa_index1.
FREE MEMORY ID wa_index_key1.
Message was edited by:
Prashant Patil
‎2007 Sep 05 12:47 PM
SET /GET parameter IDs or IMPORT/EXPORT will not work in background mode.
better u create a Function group, inside it create Two separate Function modules.
There two FMs can talk to each other ( thru the common top include of the Function group).
U call the FM1 in the first prog -
CALL FUNCTION Z_FM_1 exporting L_value.
and from the seond prog where u need the data call the second FM
CALL FUNCTION Z_FM_1 importing L_value.
this will definitely solve ur problem.
Cheers
SKC.
‎2007 Sep 06 3:11 PM