Skip to Content

Cdpos table taking lot of time How could i reduce the time

Need Some suggestions.
I am developing one report, Changes in Purchase order As per client Requirement.

SELECT * FROM cdhdr INTO TABLE it_cdhdr WHERE udate IN s_date AND objectclas EQ 'EINKBELEG'.

Exactly below query taking much of time
IF NOT it_cdhdr IS INITIAL.
SELECT * FROM cdpos INTO TABLE it_cdpos FOR ALL ENTRIES IN it_cdhdr
WHERE objectclas EQ it_cdhdr-objectclas AND changenr EQ it_cdhdr-changenr.

ENDIF.

How could i Reduce the time.
Any suggestions Update me.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    Dec 09, 2016 at 06:47 AM

    First add the key criteria OBJECTID in the CDHDR itab and WHERE clause (Check order of primary keys of cluster table CDCLS)

    As CDPOS is some cluster table in database, for big volumn, I fear even a correct %hints like max_blocking_factors wont give better result. You could try in this case to parallelize the load (breaking it_cdhdr in subsets and execute the load with some "CALL FUNCTION z_loader STARTING NEW TASK task CALLING meth ON END OF TASK"?

    Regards,
    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 09, 2016 at 07:59 AM

    Try the good old Thomas Jung's eLearning series, starting with Basic ABAP OO eLearnings.

    Regards,
    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 09, 2016 at 09:46 PM

    You could take a look in the FM "CHANGEDOCUMENT_READ_RANGES" and see how it is built up.

    I've used this Function Module with good results, performance wise ...

    Kind regards

    Nic T.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 09, 2016 at 12:20 PM
    -1

    Hey NewB,

    So to your main question.

    1. First, check whether your OBJECTCLAS field has any data or not in it_cdhdr.

    2. If it has pass only it_cdhdr-objectclas. so your select statement should be like this:

    IF it_cdhdr[] IS NOT INITIAL.
       SELECT * FROM cdpos
       INTO TABLE it_cdpos
       FOR ALL ENTRIES IN it_cdhdr 
       WHERE objectclas EQ it_cdhdr-objectclas. 
    ENDIF.

    3. Fill the range table "t_range_changenr" with all the changenr 's in it_cdhdr.

    4. DELETE it_cdpos WHERE changenr NOT IN t_range_changenr.

    Try this out and let us know, whether its as expected or not?

    Thanks in advance.

    --

    With Regards,

    Anirudh Vishwamithra.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 09, 2016 at 06:56 AM

    Ok I tried it, Little bit ok, Comparing Old One.Thank you Sir.
    Small question, From Where could i Start OOPs Abap Concepts

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 15, 2016 at 04:34 AM

    Hi,

    To avoid performance issues,you can also explore MM04 report.

    At the first level of the report display the Changenumber and when the user clicks (interactive report) on that Change Number let the processing logic to fetch the details from CDPOS run and display those details at the second level of the report.User may consider this option as doubling his work and may expect all the details to be shown in the first level of the report itself rather than clicking on each changenumber and then checking the other details.

    K.Kiran.

    Add comment
    10|10000 characters needed characters exceeded