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

Report Execution - Background Process

karthik_rajaspic
Participant
0 Likes
1,096

Hi Friends,

I have developed a report program.

I have also created a transaction code for executing it.

Now the user needs to execute this program as a background job.

I have tried with SM36 and SM37 transactions. Here, you need to set the variants and time for execution.

But the user has lots of selection criteria and setting the variants for this requirement is highly impossible.

Kindly let me know whether I can add any additional statements in the program so that the program executes as a background process when initiated th' the selection screen / transaction code.

Kindly provide your suggestions.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
892

hi karthik

PARAMETER : p_cmode LIKE ctu_params-dismode DEFAULT 'N'.

CALL TRANSACTION tcode USING bdcdata

MODE p_cmode

UPDATE 'L'

MESSAGES INTO messtab.

use this 1

its help u .

kk.

Edited by: kuamr kk on Dec 26, 2007 10:57 AM

7 REPLIES 7
Read only

karthik_rajaspic
Participant
0 Likes
892

Hi Friends,

Please help me with your suggestions. I need to satisfy this requirement as it is of high priority.

Thanks in advance.

Edited by: karthik raja spic on Dec 26, 2007 3:07 PM

Edited by: karthik raja spic on Dec 26, 2007 3:08 PM

Read only

0 Likes
892

Hi

Please check FMs RSVARIANT they can be used to create variants dynamically. - RS_CREATE_VARIANT, RS_VARIANT_CONTENTS etc

Check FMs JOB_OPEN, JOB_SUBMIT, JOB_CLOSE

Hope these will help you arrive at a solution

Regards,

Arun

Read only

Former Member
0 Likes
893

hi karthik

PARAMETER : p_cmode LIKE ctu_params-dismode DEFAULT 'N'.

CALL TRANSACTION tcode USING bdcdata

MODE p_cmode

UPDATE 'L'

MESSAGES INTO messtab.

use this 1

its help u .

kk.

Edited by: kuamr kk on Dec 26, 2007 10:57 AM

Read only

Former Member
0 Likes
892

try to set SYST-BINPT ='X' which will force program to be run in background only.

anya

Read only

Former Member
0 Likes
892

Try the FMs BP_JOB_CREATE.

Read the other FMs like BP_JOB_*.

Regards,

Ravi

Read only

Former Member
0 Likes
892

Hi Karthik,

Looks like a wrapper ABAP program is required to meet your requirement. This program can be called in the background and in turn can submit the report program that you have created to achieve the actual functionality.

In this wrapper program, you need to create a dynamic variant using FMs (search RSVARIANT in SE37). Here you can populate the fields of the selection screen based on any complex criteria as you mentioned using ABAP statements. The dynamic variant is similar to the variants created on the selection screen.

Once you have the variant (dynamic) ready you can create a background job and submit it within this wrapper program, for which you again have to use the FMs (search createjob*, and go to the function group).

You have to release the submitted job and you can get the status of the job while it is running using the standard FMs provided for this.

Finally, you can create a spool list for the wrapper program that can detail the status of the submitted job.

It is a good idea to delete the dynamic variant once it ahs been used because if required again, it can be created again. If the dynamic variant is created daily or several times a day, it is definitely good to delete it after the use. The right place to do deletion is at the end of the wrapper program after confirming that the job submitted has completed. Or as an alternate strategy, all variants prior to a week can be deleted when the wrapper program runs today (we are using this strategy).

I have used this successfully.

Hope this helps.

Thanks

Sanjeev

Read only

karthik_rajaspic
Participant
0 Likes
892

Hi Friends,

Thanks for all your ideas. All your ideas worked well.

Also, there is one more way for solving this problem.

Give the input for selection screen.

Press F9.

Press Immediate tab.

Mark Immediate execution check box.

Press Check and Save buttons.

Again you will come to the selection screen.

Press F8 now.

The process executes in background and there is no need to set up a periodic job.

But all your answers were very helpful

Thank you all once again.