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

Two Programs, One Job?

Former Member
0 Likes
2,355

Hi Guru's,

I have the following situation :

1 file on the application server

Step 1 : a program reads this file, edits it and writes it back to the application server

Step 2 : an LSMW picks up the newly edited file and does account posting

Both steps should be scheduled to run daily. If the first step fails, second should not run.

Problem is, they only want one job scheduled for both programs.

Is it possible to have a 2 step job?

Is it possible to call the LSMW from the program (I did post this question, one person said yes, one said no)?

Any other solutions?

Thanks.

4 REPLIES 4
Read only

Former Member
0 Likes
1,258

Hi,

Anyway you are having the transaction codes for the upload program and the LSMW. So create a new program which calls the programs sequently as follows.

Report znew.

parameters : chk as checkbox.

start-of-selection.

call transaction <t-code of first program> or

submit program.

if return_code = 0.

call transaction <t-code of lsmw>

endif.

Then schedule this program. Hence one job for one program.

Note:

Upload and download will not work in background mode. So

Use open dataset.. read... close dataset.. Just ensure it.

regards,

Sankar.

Edited by: sankar on Mar 26, 2008 8:02 AM

Read only

0 Likes
1,258

Hi Sankar,

Do I need to assign a new tcode to the LSMW or can I just call tcode LSMW with the correct Project, Subproject and Object names?

Thanks

Lindy

Read only

Former Member
0 Likes
1,258

You can define a job with more than 1 step with SM36, but in this way, I think you that the 2nd programm will start in any case, and you can't stop it if the first fails.

To launch a LSMW session, they are more than 1 program to run. Every step of lsmw has his own abap report associated, so you must schedule a stap for each stap of lsmw.

I suggest you to make a simple program that create a job, using f.m. JOB_OPEN, JOB_SUBMIT, JOB_CLOSE, so you can even control if one of the first program fails and then you must not run the reports for LSMW.

Bye

Andrea

Read only

ThomasZloch
Active Contributor
0 Likes
1,258

To combine and enhance the previous answers:

you can schedule a job with several steps, if one step fails with error message, the subsequent ones will not be executed!

In the first step of the LSMW you can define your object as "periodic". Once you did this, a new menu item will be added at the end of the LSMW menu, "Frame Program for Periodic Data Transfer". You can schedule this in the background and don't have to schedule each single step of the LSMW.

Cheers

Thomas