‎2007 Sep 08 11:44 PM
Hello,
My requirement is to call a program B within a program A asyncronously so that the calling program A continues to run parallely with program B.
Thanks in advance,
Sanjota
‎2007 Sep 09 7:12 AM
You could also look at passing off the work via asynch RFC calls... see:
http://help.sap.com/saphelp_nw2004s/helpdata/en/22/0425c6488911d189490000e829fbbd/content.htm
for example.
Jonathan
‎2007 Sep 09 12:44 AM
Hi,
Use SUBMIT statement
submit b.
Please check this
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/submit.htm
aRs
‎2007 Sep 12 6:32 PM
Hi aRs,
Thanks for the reply.
If I use submit program I cannot return back to my program until I give "SUBMIT....AND RETURN" and this statement will wait till the second program executes and then send the control back to the first program.
My requirement is to start the second program in the middle of the first program and still continue with the first program.
‎2007 Sep 09 7:12 AM
You could also look at passing off the work via asynch RFC calls... see:
http://help.sap.com/saphelp_nw2004s/helpdata/en/22/0425c6488911d189490000e829fbbd/content.htm
for example.
Jonathan
‎2007 Sep 12 6:40 PM
Hi Jonathan,
Unfortunately my requirement is to have a custom program B because this program can also be exceuted independantly out of program A logic.
I will check how this can work and get back.Thanks for your reply.
Regards,
Sanjota
‎2007 Sep 13 2:13 AM
What is the second program "B" doing?... it may be possible to encapsulate its work in a function module so you can share the processing logic. If you are really interested in getting multiple parallel asynch processes working, have a read through the code for RUTBTPA0 (from around line 780+ ) as it describes how you might achieve this.
Jonathan
‎2007 Sep 13 8:36 PM
Hi Jonathan,
This a interface report to transfer data from UNIX server into R3 and then into BW.
Program A: This program will read the file,validate the data ,post the data into FI .
Program B : reads the file data,transforms the file to BW and sends it to BW.
My requirement is when program A successfully validates the file data ,program B should be started from program A to load the file to BW .I had to have two programs because of the time taken by individual process blocks(i.e one is R3 processing and other is BW processing) due to large volume of file data(I can have couple of millions of records in the file).Again program B can be run independantly from program as a part of a requirement.
I am looking at how I can schedule program B as a batch job from program A asynchronously.This will help me to have a log on program B in the spool.
I will go through the program suggested by you and get back .
Thanks for all your help.
Sanjota
‎2007 Sep 13 10:26 PM
Hi Sanjota,
One way to address the requirement would be to Start the program B from program A by creating a Job. This is very simple.
You can define Job using this FM 'JOB_OPEN'
http://help.sap.com/saphelp_nw70/helpdata/en/fa/096d67543b11d1898e0000e8322d00/frameset.htm
Then you can call the job with your requirements say Program B is report
http://help.sap.com/saphelp_nw70/helpdata/en/fa/096d67543b11d1898e0000e8322d00/frameset.htm
You can start the job with FM 'JOB_CLOSE'
http://help.sap.com/saphelp_nw70/helpdata/en/fa/096d67543b11d1898e0000e8322d00/frameset.htm
Its easy to do keep a log of program B as it is defined as a Job. You can display Job log using the FM 'BP_JOBLOG_SHOW'
http://help.sap.com/saphelp_nw70/helpdata/en/fa/096d67543b11d1898e0000e8322d00/frameset.htm
Hope this helps.
‎2007 Sep 13 11:37 PM
Hi Karthik,
Can I still continue with my program A after calling program B as a batch job ? I
‎2007 Sep 14 5:50 AM
Yes, the batch job will run quite separately - you will just have to make up some smarts to get the results of it back into calling program "A".
Jonathan
‎2007 Sep 14 10:46 PM
Hi Jonathan,
I don't want the results to be back in program A. I only want the program B to run separately and I guess this will resolve my problem.
I will implement this code and see how it goes and let you know.
Thanks for all your help.
Regards,
Sanjota
‎2007 Sep 17 3:11 AM
Batch job concept worked.
Thanks Karthik and Jonathan.
Sanjota