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

IW38

Former Member
0 Likes
790

Hi

Current Scenario : when I execute IW38 transaction with a specified variant, I get list of orders displayed in ALV ,after this I select all the orders and click on orders ->Print Orders this will trigger the print program and will print the orders(Smartforms).

I want to schedule the above mentioned process in the background how can I acheive it through a program ?

Reagrds

Bhanu

2 REPLIES 2
Read only

Former Member
0 Likes
476

u can do it by creating Z program to do so.

Regards

Prabhu

Read only

Former Member
0 Likes
476

Hi bhanu,

You can create a BDC for the above process.and then you can excecute in background.

You can fire it directly from the selection screen, choose Program -> Execute in Background.

You can also fire it by scheuling it in a background job via SM36.

Lastly, you can write a program that will create the background job. See Below.

report zrich_0004 .

data: sdate type sy-datum,

stime type sy-uzeit,

l_valid,

ls_params like pri_params,

l_jobcount like tbtcjob-jobcount,

l_jobname like tbtcjob-jobname.

start-of-selection.

  • Get Print Parameters

call function 'GET_PRINT_PARAMETERS'

exporting

no_dialog = 'X'

importing

valid = l_valid

out_parameters = ls_params.

  • Open Job

l_jobname = 'ZRICH_0005'.

call function 'JOB_OPEN'

exporting

jobname = l_jobname

importing

jobcount = l_jobcount.

  • Submit report to job

submit zrich_0005

via job l_jobname

number l_jobcount

to sap-spool without spool dynpro

spool parameters ls_params

and return.

  • Kick job off 30 seconds from now.

sdate = sy-datum.

stime = sy-uzeit + 30.

  • Schedule and close job.

call function 'JOB_CLOSE'

exporting

jobcount = l_jobcount

jobname = l_jobname

sdlstrtdt = sdate

sdlstrttm = stime

  • strtimmed = 'X'

.

regards

Antony Thomas