Application Development 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: 

Sequence of logic - background job call

Former Member
0 Kudos

Hi ,

iam working on an requirement , user enters the data in selection screen , output will display with records , i added custom pushbutton on application toolbar , now the user enters the button a background job should be created and remaining logic should be executed ( doing rate change for customer).

idid logic for displaying report using ALV GRID and also added the push button then my logic is as below.

SET PF-STATUS 'EXECUTE'.

CASE SY-UCOM.

WHEN 'EXECUTE'.

PERFORM RATE CHANGE,.

_____________________

FORM RATE CHANGE.

..............

ENDFORM.

i know FM open-job, submit ,close_job should be called for automatic background.

my question when i need to call these FM's, because after user pressing the button , using the final itab the remaining logic should execute ,

do i need to create another report and keep my additional logic and call that from first report. or can i do everything in same report.

please help with order of the logic i should call.

thanks

NK

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

Of course you could do everything in one program but my opinion is that it's much better to separate the tasks this way:

  • program 1 for display stuff
  • program 2 for background stuff
  • database or file system (or any other means) for communicating data between program 1 and program 2
  • global class for doing common tasks
3 REPLIES 3

Sandra_Rossi
Active Contributor

Of course you could do everything in one program but my opinion is that it's much better to separate the tasks this way:

  • program 1 for display stuff
  • program 2 for background stuff
  • database or file system (or any other means) for communicating data between program 1 and program 2
  • global class for doing common tasks

Former Member
0 Kudos

Thanks for reply, I separated my logic to program1 and program 2. and using EXport for Itab transfer,

but when I debug from Progarm1 , not entering into program 2 ( even aftet setting a breakpoint on program2).

can I debug in rutime?

thanks

NK

Please don't post a question as an "answer". There's a "convert into comment" button if I remember well.

You can't debug a background job the way you say. Search "debug job" in SCN for solutions (SM37 and "jdbg" for instance, eventually "job interception" if you need to make the job wait for you so that you can start it, or in the worst scenario add an endless loop + SM50/SM66 to debug the workprocess).