Skip to Content
author's profile photo Former Member
Former Member

Optimization of DDF logical database

Hi,

I'm working on a program that uses DDF logical database to list accounting documents. In order to do this, we use three get sentences to loop into KNB1, BSID and BKPF tables.

It's something like that:

GET bkpf.

  • gjahr is a range with several values

CHECK bkpf-gjahr IN gjahr.

  • checta is a range with several values

CHECK bkpf-blart IN checta. "1

GET bseg.

CHECK bseg-bschl EQ '01' OR bseg-bschl EQ '11' OR "2

bseg-bschl EQ '12' OR bseg-bschl EQ '02'.

GET gseg.

PERFORM list_document.

But my problem with this code is that it takes too much time to generate the report. Doing some performance analysis on execution, I've determined that the problem is with the access to tables of logical database (the "get" sentences).

So I need to improve report performance, but I don't know how can I do this, maybe if the get returns only the fields I need for execution instead of all table fields runtime would be better, but I'm not very sure if this is possible.

Another option could be changing GET sentences for SELECT, but looking into LDB code I see that as well as hard to change probably it will be useless.

So any information about LDB optimization, or how to improve this kind of reports would be very appreciated.

Thanks in advance

Best regards

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Sep 07, 2007 at 11:14 AM

    When i read your report, i think that you should give the selection to the LDB and not use check after the GET, your program GET all records (with other selections) and reject some records.

    Try to use LDB selections on BKPF, and not specific selections :

    e.g. : Use DD_BLART to select document from BSID table and not check BLART after GET BKPF. Use DD_BSCHL also and not check after BSEG.

    To find suitable fields, go to SE36 and then click on selection to get the selections of the LDB program (or search "FROM table" in whole program SAPDBDDF)

    Yes, use only fields needed in GET instruction.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

    • I don't think you can get much more optimization, in the LDB (except if you write a news ZDDF optimized logical database program...)

      No try to use performance and trace tools to fin the "heaviest consumption" of resources (SE30 and/or ST05)

      If LFA1 or BSID are CPU/Time consumers maybe creating an index adapted to your request will have some effects.

      Regards

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 02:07 PM

    I wouldn't use logical databases at all. And I wouldn't look at the LDB code to try to figure out what it is doing. Rather, take your requirements and write the program using SELECT statements.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.