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

Background job data display

Former Member
0 Likes
2,371

Hello all,

I created a small program to give me a total record count for my huge table and ran it in the background. It ran for hours and finally did finish but i dont know where to retrieve the information of how many records were counted in total. So i created another program to read a very small table of 2000 records and scheduled it in the background. This one ran almost instantly but i couldnt get any record count from this one either. What do I need to do to actually see my record count.

Heres my program: Please tell me what am I missing , should i store it somewhere and can someone please actually give me the code if mine needs to be adjusted or added.

DATA: count LIKE sy-tabix.

SELECT COUNT(*) FROM table INTO count.

WRITE: /001 'Number of records in table:', count.

Best regards,

Krrish

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,958

The write statement puts the data on the screen, which you will not see in background. Just add the count to the joblog itself by doing the following instead of the write:

message i000(oo) with 'Number of records in table:' count space space.

You'll find the count in the joblog after the job finished.

Hope that solves your problem.

Michael

The write statement puts the data on the screen, which you will not see in background. Just add the count to the joblog itself by doing the following instead of the write:

message i000(oo) with 'Number of records in table:' count space space.

You'll find the count in the joblog after the job finished.

Hope that solves your problem.

Michael

5 REPLIES 5
Read only

Former Member
0 Likes
1,959

The write statement puts the data on the screen, which you will not see in background. Just add the count to the joblog itself by doing the following instead of the write:

message i000(oo) with 'Number of records in table:' count space space.

You'll find the count in the joblog after the job finished.

Hope that solves your problem.

Michael

Read only

0 Likes
1,958

this is how I have written the code:

DATA: count LIKE sy-tabix.

SELECT COUNT(*) FROM table INTO count.

*WRITE: /001 'Number of records in table:', count.

message i000(oo) with 'Number of records in table:' count space space.

Inso what you are saying is I will a 'number of records in table' next to Date Time Message text Message class Message no. & Message type.

Anyways if it works, i will update you for sure, most likely on the weekend.

Thanks,

Krrish

Edited by: Krrish Kumar on Dec 5, 2008 5:25 PM

Read only

0 Likes
1,958

Yes, that's what I meant. You do not need to be around when the job ends, the message will be recorded in the job log.

- SM37

- Put in the job name or the user who scheduled the job (which would be you)

- put in the correct timeframe

- execute selection

- on the next screen you'll see a job list (or just one depending on your selection)

- mark the job and click on the Job Log button in the application toolbar

- the screen should look something like this

11/26/2008 01:10:20 Job started

11/26/2008 01:10:20 Step 001 started (program 'report name', variant , user ID 'your user id')

11/26/2008 01:10:32 Number of records in table: xxxxx

11/26/2008 01:10:32 Job finished

Regards,

Michael

Read only

0 Likes
1,958

Michael, that worked.... you are the best.

Read only

Former Member
0 Likes
1,958

Go to your default printer and check the output tray.

Rob