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: 

Dynamic Background - on a particular condition (number of pages in spool)

Former Member
0 Kudos

Hi All,

I have a report which is used to convert a particular spool to PDF format .I need it(the entire report) to be executed in foreground if number of pages is less than 99 and in background if the number of pages in spool is greater than 99.Hope you could help me .

Regards,

K.Sibi

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Ofcourse you need to find number of pages before generating spool to determine program execution mode. Come to conclusion that how many lines are displaying after spool generated, so that based on the internal table entries you can decide. Lets take per page if 64 lines are displaying, based on that you can calculate number of entries of the final internal table and then come to conclusion.

You can use the FM : 'RSPO_GET_PAGES_SPOOLJOB' to get the number of pages of the spool.

Regards,

~Satya

Edited by: Satya suresh Donepudi on Mar 11, 2009 3:06 AM

10 REPLIES 10

Former Member
0 Kudos

Ofcourse you need to find number of pages before generating spool to determine program execution mode. Come to conclusion that how many lines are displaying after spool generated, so that based on the internal table entries you can decide. Lets take per page if 64 lines are displaying, based on that you can calculate number of entries of the final internal table and then come to conclusion.

You can use the FM : 'RSPO_GET_PAGES_SPOOLJOB' to get the number of pages of the spool.

Regards,

~Satya

Edited by: Satya suresh Donepudi on Mar 11, 2009 3:06 AM

0 Kudos

The spool is already present .I think the problem is not with number of lines in pages .But the number of pages.

0 Kudos

Hello Sathya,

Thanks for the reply.

The spool is already present .I think the problem is not with number of lines in pages .But the number of pages.

Regards,

K.Sibi

0 Kudos

Thats what i told, i mean based on the lines of the page you can calculate for 99 pages how many lines will be there. Lets take 64 lines per page * 99 pages = 6336. Now if your internal table has more than 6336 records then you can decide.

Regards

0 Kudos

How to post it into background after the checking of pages?

Regards,

K.Sibi

0 Kudos

Hi,

Its very simple.

Just submit the program using SUBMIT statement.

CALL FUNCTION JOP_OPEN.

SUBMIT ur program.

CALL FUNCTION JOB_CLOSE.

Above code creates the batch job. Once u ran the report u can see the result in Sm37 spool.

Thanks,

Vinod.

vinod_vemuru2
Active Contributor
0 Kudos

HI,

First get the number of pages in the spool from TSP01 table. Field is RQAPPRULE.

If sy-batch is initial and TSP01-RQAPPRULE GT99.

SUBMIT JOB. (same report u can submit).

LEAVE PROGRAM.

ENDIF.

Here ur normal processing exists.

Thanks,

Vinod.

0 Kudos

Hello vinod,

Thanks for the reply.

The field TSP01-RQAPPRULE gives the TemSe: Number of add protection rule

Will this represent the exact number of pages?

Regards,

K.Sibi

0 Kudos

Hello vinod,

I have planned to use the fm RSPO_GET_PAGES_SPOOLJOB.It uses RQAPPRULE implicitely inside it .But now problem is , How will i make the rest of the job to go into BACKGROUND execution?

Regards,

K.Sibi

Former Member
0 Kudos

Doubt regarding sy-batch and its working and how to force the execution of the program into background execution

Regards,

K.Sibi

Edited by: sibi k kanagaraj on Mar 11, 2009 9:52 AM