Skip to Content
0

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

Dec 09, 2016 at 04:37 AM

251

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Best Answer
Raymond Giuseppi
Dec 09, 2016 at 06:47 AM
1

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

Share
10 |10000 characters needed characters left characters exceeded
Raymond Giuseppi
Dec 09, 2016 at 07:59 AM
1

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

Regards,
Raymond

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Ok. Noted.

0
Nic Teunckens Dec 09, 2016 at 09:46 PM
1

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.

Share
10 |10000 characters needed characters left characters exceeded
Anirudh Vishwamithra 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.

Share
10 |10000 characters needed characters left characters exceeded
Kali Charan Dec 09, 2016 at 06:56 AM
0

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

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi NewB,

1. Start with class and attributes first later Visibility and stuff.

2. What is the difference between local class and global class.

3. What is the difference between FM's and Methods? Why Methods to be preferred over FM's.

4. OO design pattern's and why we should go for them.

As far as I am concerned,If you follow ThomasJung series: https://blogs.sap.com/2009/08/11/basic-abap-oo-elearnings/ , You can jump start you OO learning.

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.

1
Anirudh Vishwamithra

Ok,I Will check it.

1
Kiran K Dec 15, 2016 at 04:34 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded