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

Background job processing

Former Member
0 Likes
1,231

Hi,

I have two Executable programs. Program A, Program B.

(to execute Program A in background)

Program B has job_open, submit program A...and return, Job_close.

Job count etc everything is achieved properly.

But when checked in debugging, submit statement is not really executing Program A but directly going into SAPLS38E and the cursor is back in program B.

It means not fetching any data. No error too.

When Program A is executed separately I could get output.

Plz suggest what the problem could be.

thanks

1 ACCEPTED SOLUTION
Read only

rajasekhar_matukumalli3
Active Participant
0 Likes
1,198

Hi,

Can you please paste the piece of code (SUBMIT) that is actually calling the Program A?

Regards,

Raj

11 REPLIES 11
Read only

rajasekhar_matukumalli3
Active Participant
0 Likes
1,199

Hi,

Can you please paste the piece of code (SUBMIT) that is actually calling the Program A?

Regards,

Raj

Read only

0 Likes
1,198
START-OF-SELECTION

perform background.

END-OF-SELECTION.


Form background.

JOB_OPEN.......

SUBMIT ZPROGRAMA USER SYST-UNAME           
  VIA JOB JOBNAME
  NUMBER  JOBCOUNT
  AND RETURN.

JOB_CLOSE.

End form

Are my start of/end of selection statements troubling?

Read only

0 Likes
1,198

Maybe I'm not understanding, but try this I hope it helps


START-OF-SELECTION
break-point.
SUBMIT ZPROGRAMA USER SYST-UNAME           
  VIA JOB JOBNAME
  NUMBER  JOBCOUNT
  AND RETURN.
break-point.
END-OF-SELECTION.

Are you debugging step by step? if yes, try to stop at the first brea-point. then press f8 to go to the second break and see what happens

Read only

0 Likes
1,198

Hi,

When you use the JOB_OPEN.... it returns a variable JOBCOUNT. Please try passing that to the SUBMIT.

Your program should work.

Regards,

Raj

Read only

0 Likes
1,198

I did that.

after the submit part control is coming back. But during the submit it's not executing the PROGRAM A. But getting into the standard background program.

Read only

0 Likes
1,198

Have you tried putting a break in Zprograma and not debbuging the submit to see if it enters?

I've had problems using call transaction in the debbuger, maybe that's the problem

Edit: Almost forget, what is the sy-subrc value after the submit?

Edited by: Ramiro Escamilla on Mar 26, 2008 10:38 PM

Read only

0 Likes
1,198

Raja shekhar...if you see my code snippet....I have already passed my jobcount.

do I need to have initialization, start of selections statements in both the programs.....???

Or need to have those only in the program which submits the other one?

Plz clarify

thanks

Read only

0 Likes
1,198

Ramiro...it's the same. I tried to jump with F8 with those break points. no change.

the program that I am submitting has a selection screen.

It's never branching out for me to enter any data.

Based on the selection criteria data has to be retrieved in background. but it's never getting into that program.

sy-subrc is 0.

Edited by: Alchemi on Mar 26, 2008 4:41 PM

Read only

0 Likes
1,198

Hi Alchemi,

You need to fill the Selection Screen data of PROGRAMA before you call it through SUBMIT.

Please find the syntax:

SUBMIT ZPROGRAMA AND RETURN

USER SY-UNAME

VIA JOB JOBNAME NUMBER JOBCOUNT

WITH <Selection-Screen Variable1 of ZPROGRAMA> = Value1

WITH <Selection-Screen Variable2 of ZPROGRAMA> = Value2

If you Selection-Screen Variable is Select-Option, declare a variable of type RANGES and fill all the required values and then pass it intead of Value1/2

If you Selection-Screen Variable is a parameter then just pass the value.

Hope this solves your problem.

Regards,

Raj

Read only

0 Likes
1,198

thanks guys.

I just realized that i need to pass the selection screen parameters. Let me try and do that.

Read only

0 Likes
1,198

of course the cursor will come back to program B unless you say submit and wait. How are you trying to debug? Is the job visible in sm37? If the job has already finished, try to debug using jdbg command.