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

data capturing in background job scheduling

Former Member
0 Likes
777

HI,

I hava a specific requirement in background job scheduling.

in my layout i have to show <b>pagenumber / total number of page numbers.</b>

for that iam useing a variable with value '$$$' and iam replacing this variable with total number of pages..

when we run in foreground it is working fine. but in background the variable is not being replaced..

how can i modify the data in spool..

HI,

I hava a specific requirement in background job scheduling.

in my layout i have to show <b>pagenumber / total number of page numbers.</b>

for that iam useing a variable with value '$$$' and iam replacing this variable with total number of pages..

when we run in foreground it is working fine. but in background the variable is not being replaced..

how can i modify the data in spool..

6 REPLIES 6
Read only

Former Member
0 Likes
717

Can you please cut-paste your code

Read only

0 Likes
717

REPORT ztest no STANDARD PAGE HEADING

MESSAGE-ID zfi

LINE-COUNT 65(1)

LINE-SIZE 165.

DATA: v_sum(3) TYPE c VALUE'$$$'.

CONSTANTS: c_slash TYPE c VALUE '/'. "Stores /

parameters : p_1 type c.

START-OF-SELECTION.

WRITE : 'Hi'.

SKIP 80.

WRITE : 'Helloo'.

END-OF-SELECTION.

*To print the total no. of pages in report heading.

PERFORM f_replace_totpage.

************************************************************************

  • TOP-OF-PAGE

************************************************************************

TOP-OF-PAGE.

  • Display Standard Report Header

PERFORM f_report_header.

&----


*& Form f_replace_totpage

&----


  • To print the total no. of pages in report heading.

----


FORM f_replace_totpage .

DATA: l_tot_page(3) TYPE c,

l_pgcnt TYPE i,

l_licnt TYPE i VALUE '3'.

  • Assign value of total number of pages into l_tot_page.

l_tot_page = sy-pagno.

  • To replace the value of v_sum ($$$) by total number of pages after

  • reading the content of fourth line of each page.

WHILE l_pgcnt LE l_tot_page.

l_pgcnt = l_pgcnt + 1.

READ LINE l_licnt OF PAGE l_pgcnt.

REPLACE v_sum WITH l_tot_page INTO sy-lisel.

MODIFY LINE l_licnt OF PAGE l_pgcnt.

ENDWHILE.

CLEAR: l_tot_page,

l_pgcnt,

l_licnt.

ENDFORM. " f_replace_totpage

&----


*& Form f_report_header

&----


  • Report Header display

----


FORM f_report_header.

FORMAT COLOR 1 INTENSIFIED ON.

  • Text-246 - Page:

WRITE:/1 text-247, 45 text-241, 110 text-242, 150 space.

WRITE:/1 text-243, sy-repid, 110 text-244, sy-datum, c_slash, sy-uzeit,

150 space.

WRITE:/1 text-245, sy-uname, 110 text-246, sy-pagno,c_slash,v_sum,

150 space.

FORMAT COLOR OFF.

ULINE.

ENDFORM. " f_report_header

Read only

0 Likes
717

HI Anurag,

thank you for your reply..

When we run this program in foreground it is good but in background only the problem is araising...

plz execute this report and gimme suggestion..

thank you..

Rupa..

Read only

0 Likes
717

Hi,

Do three changes in your code , it will work.

1.comment end-of-selection code.

*END-OF-SELECTION.

*To print the total no. of pages in report heading.

*PERFORM f_replace_totpage.

2.change top-of-page

TOP-OF-PAGE.

*To print the total no. of pages in report heading.

PERFORM f_replace_totpage.

  • Display Standard Report Header

PERFORM f_report_header.

3.change code in 'f_replace_totpage' like:

*REPLACE v_sum WITH l_tot_page INTO sy-lisel.

REPLACE v_sum WITH l_tot_page INTO v_sum.

Regards

Appana

*Reward points for helpful answers

Read only

0 Likes
717

Hi Appana,

Thank you for spending time for me.

I have done the changes, and it is showing the page numbers in different format like 1/1 2/2 3/3...but my requirement is 1/3 2/3 3/3...

plz help me out how to achieve this.

Read only

naimesh_patel
Active Contributor
0 Likes
717

Hello,

It is not possible to change the list (sy-lisel) in the background. So, we are not able to change it..

I have tried to give the messages like :

DO SY-PAGNO TIMES.

  • Reading first line of the page > pagenumber comes on this line

READ LINE 1 OF PAGE SY-INDEX FIELD VALUE V_TOT INTO L_TOT.

REPLACE V_TOT WITH XPAGE INTO L_TOT.

MESSAGE S398(00) WITH SY-INDEX SY-SUBRC.

MODIFY CURRENT LINE FIELD VALUE V_TOT FROM L_TOT.

MESSAGE S398(00) WITH SY-LISEL+50(50).

ENDDO.

In the job log it is saying like : page 5 of 5 for every page.

So, I think there isn't any solution for this.

regards,

Naimesh