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

transfer values between background programs

Former Member
0 Likes
801

Hi expert,

       I start a abap program on background with statements as follows, this program will keep running if I don't stop it.

          SET PARAMETER ID 'Z_PA_EAR' FIELD TBTCM-JOBCOUNT.

          SET PARAMETER ID 'Z_PA_EAR1' FIELD TBTCM-JOBNAME.

          MESSAGE I001(00) WITH 'this is your information set: jobname ' TBTCM-JOBNAME  '   job count: ' TBTCM-JOBCOUNT.

    in its job log, I got follow message:

                     this is your informationset retrieved:jobnameBI_PROCESS_ABAP     job count:15422800

   then after a few hours, I launch another abap program on background with following statement , trying to receive values from parameter ID set by above abap

   program.

         

          GET PARAMETER ID 'Z_PA_EAR' FIELD ZJOBCOUNT.

          GET PARAMETER ID 'Z_PA_EAR1' FIELD ZJOBNAME..

          MESSAGE I001(00) WITH 'this is your informationset retrieved:jobname ' ZJOBNAME '     job count: ' ZJOBCOUNT.

  in its log, I got following message , with blank values for getting values.

          this is your informationset retrieved:jobname     job count:

can you please show me how to correctly transfer values between two background abap programs in this case?

Many Thanks,

Bo

1 ACCEPTED SOLUTION
Read only

ThangaPrakash
Active Contributor
0 Likes
768

Try using the below statements,

First program:

export iflatf to shared buffer indx(st) id '<memory id>'.


Second program:

import iflatf = iflatf from shared buffer indx(st) id '<memory id>'.

delete from shared buffer indx(st) id '<memory id>'.


Regards,

Thanga

5 REPLIES 5
Read only

Former Member
0 Likes
768


Dear Zhang,

SET parameter values exist only in the runtime between sessions. Once your runtime is ended up,  system resets the runtime stack. Hence SET / GET can be useful in a continous execution of programs..

In your case either you have to execute both the jobs as a sequential steps under a single job

or

You need to retrieve the information using tables, if not save the information in a custom table and use the same in the next job.

Thanks and Regards,

Chandra

Read only

0 Likes
768

Hi Chandra,

        for first option, I can't put those two abap program in sequent steps of job, because the first abap program keep running without end. the second abap program is used to kill first abap program. so they are not run in sequence.

       for second option, I don't want to create a table only for this purpose.

      can you please tell me if I can use import/export to database for my purpose, if could, how to use them?

Many Thanks,

Read only

0 Likes
768
can you please tell me if I can use import/export to database for my purpose,


just try it out.


if could, how to use them?


/nabapdocu


Read only

ThangaPrakash
Active Contributor
0 Likes
768

Hello,

Are you scheduling the job via SM36 or by using the option "Execute in background" in SE38.

Read only

ThangaPrakash
Active Contributor
0 Likes
769

Try using the below statements,

First program:

export iflatf to shared buffer indx(st) id '<memory id>'.


Second program:

import iflatf = iflatf from shared buffer indx(st) id '<memory id>'.

delete from shared buffer indx(st) id '<memory id>'.


Regards,

Thanga