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: 

problem with running zreport in background

Former Member
0 Kudos

hi expert.

i create one zreport to display data as balance and every movement of each material in period of time, with process with mseg table, this report took a long time so we running in background.

my problem is, when running this report on working time. they never display correct result. qty and amount is more or less than actual. and never get a same result in each time. but when i create job to running in background on night time as 24:00 or 01:00 that no one working. result is correct.

it look like report's result will go wrong if anyone working related with any table that use in this report. so please suggest me what wrong with my report. this report process with marav , mseg , mard , mbew , mkpf , bkpf , bseg , ekpo , ekbe and eket table.

regards.

Kittisak.

8 REPLIES 8

babu_kilari4
Active Contributor
0 Kudos

Hi,

Whenver there is an interaction with the table, try to lock the table and once it is done use the statement COMMIT WORK and then unlock the table. This way you would get the correct data that you wanted.

Thanks,

Babu Kilari

madan_ullasa
Contributor
0 Kudos

hi,

you can never get data correct from the tables when everyone are working , since these data are being updated and added from various users in the production system.. remeber most of these are transactional data... e.g if it is a sales order, the table VBAK and VBAP are updates as users create sales order.

regads,

Madan..

0 Kudos

thank you for your answer .

so, may i have other way to run this report without lock table? This report took time vary from 10 minute to 2 hour depend on user's input parameter. I can't lock table for a long time like that. and my user won't happy with my answer for them to set background report job on night time since they want to see result in office time.

regards.

Kittisak.

0 Kudos

Sorry to say, As far as I know I dont have any other idea. But, you can get in touch with Basis guys to increase the work processes available or try to run the job in only one application server where the load is very less. This you can do it in SM36 while creating the job by mentioning it in the field Target Application Server.

If you do not lock the table, you would get the values even if some one else is working on the same table. I am not sure where it is going to end.

Hope this clue gives some input to you

Thanks.

Babu Kilari

0 Kudos

Hi,

As per your requirement, it will be difficult if you don't lock the underlying database tables to retrieve real time data and data in those tables gets constantly changed.

When you create a Lock Object, it gets created on the Primary keys of the Tables. Try to optimize your code as much as possible so that the duration of the locks on the primary table and the secondary table is as less as possible. Also you can ask the BASIS people who can help you to enhance the performance of your program.

Hope this helps.

Thanks,

Samantak.

Former Member
0 Kudos

another question.

is there any different effect to table between "get" and "select * from" ? reason is i have other zreport use familiar process with mine. precess with mbew mseg bseg etc... ,but it most use "get" syntax and no problem like mine, mine's report use "select * form" .

regards.

Kittisak.

0 Kudos

Are you trying to fetch all the fields from the table. If not, then try to fetch the fields which are useful.

Dont use select *. instead mention select followed by the list of fields you need and dont use the corresponding fields statement. Select the values in the order of the internal table fields. There are many other things that would improve performance of the program.

Thanks,

Babu Kilari

0 Kudos

Hi,

There is a difference between GET and SELECT Statement.

Use GET to handle two types of events after submitting executable programs: Get events and events at the end of a hierarchy level of a logical database. If during a GET event a list is written, previously an automatic line feed is created.

You can get a detailed information for the same here:

http://help.sap.com/abapdocu_70/en/index.htm

The Select Statement will return you the result of the select query on the database. This statement reads data from one or multiple database tables into data objects. If the result set is not assigned in one step, a loop is opened which is closed using ENDSELECT. This loop provides the results in the target fields.

You can get a detailed information for the same here:

http://help.sap.com/abapdocu_70/en/index.htm

Hope this helps.

Thanks,

Samantak.