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: 

Background & Foreground Processing

Former Member
0 Kudos

Hi All,

Can anyone tell me how to switch a program to foreground mode when it is running in background mode & vice-versa.

Regards,

Santosh

1 ACCEPTED SOLUTION

ThomasZloch
Active Contributor
0 Kudos

Never heard that this is possible. Some programs would trip over a changing SY-BATCH value, I assume.

Thomas

10 REPLIES 10

ThomasZloch
Active Contributor
0 Kudos

Never heard that this is possible. Some programs would trip over a changing SY-BATCH value, I assume.

Thomas

Former Member
0 Kudos

Hi,

Its Possible in BDC Programming:

OKCODE = '/BDA' --->Changes from background to foreground.

OKCODE = '/BDE' --->Changes from foreground to background .

Regards,

Gurpreet

0 Kudos

Sorry, but this is wrong, both "A" and "E" modes run in a dialog process, not a background process. Also, once you're in "E" mode, how do you want to switch back to "A" unless an error occurs?

Thomas

0 Kudos

In BDC its Possible,

Say you are using three Transactions:ME51,ME21,ME22.

Create a session.

Sequence:

ME51

ME21

ME22

Use OKCODE = '/BDA' (in codes)at the start of ME22.

Start the Session through SM35 in Back ground

As you come to ME22-->Processing will come to foreground mode.

Or-->

Create a session.

Sequence:

ME51

ME21--> '/BDE'(in codes)

ME22

Use OKCODE = '/BDA' (in codes)at the start of ME22.

Start the Session through SM35 in Foreground ground

As it comes to ME21 processing will be done in Backgrond(Unless error occurs or '/BDA')

As you come to ME22-->Processing will come to foreground mode.

Try it this works.

Regards,

Gurpreet

0 Kudos

Sounds interesting, I'll have a look on Monday when I'm in front of the frontend

Question remains if the work process actually changes between DIA and BTC? And what does the OP actually want...?

Thomas

0 Kudos

Hi Santhosh,

Yes it is possible If you program is still running in background.

Setup ur batch job and go to transaction SM66. Here u can see all running programs(Both foreground and back ground).

Place cursor on ur program and click on debugging button. Control goes back to ur program and stops where at was running at the point u clicked on debugging button.

Note: Once u click on Debugging it may take few seconds to switch from background to foreground.

If ur program already finished then u can debug it from SM37. Place break point in ur code. Select ur job in Sm37 and enter JDBG in command prompt and click enter, F8. Control stops at ur break point.

Hope this helps u.

Thanks,

Vinod.

0 Kudos

hi,

how to setup the batch job?

regards,

rajeev

0 Kudos

Hi,

Two ways.

1. Go to selection screen of ur report. Enter all required values and click F9. In the popup that comes next enter LOCL as printer name and click enter. In the next popup click immediate button and enter.

Now go to SM37. U will see the batch job running.

2. Create a selection screen variant. (Enter all values and click SAVE button).

Now go to SM36, give ur report name and variant name and save,

For beginners first method is easy.

Thanks,

Vinod.

0 Kudos

hi..

thanks for ur reply..

when the control returns from backgrnd mode to debug mode...

will it it give the output in foreground mode??

can u please elaborate the 2nd method..regardin how to create variant???

thanks

rajeev

Former Member
0 Kudos

olkjk