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

CDPOS table

Former Member
0 Likes
4,061

Hi All,

I am using a FM CHANGEDOCUMENT_READ_RANGES to read the chage docs. It is taking too much time to execute.

Can somebody help me how to improve the performance?

It is fetching data from CDPOS and CDHDR.

Regards,

Jeetu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,707

Hi,

To query the table CDPOS, first query the table CDPOS to get the change number.

For eg: To track changes to a purchase order

OBJECTCLAS = 'EINKBELEG'

OBJECTID = 'Purchase order number'

get the change number from the CDHDR table

Depending on Objectclas, Objectid, Change number you can easily get the details from CDPOS table.

Thank you,

Juli

8 REPLIES 8
Read only

Former Member
0 Likes
2,707

Hi ,

Try using this Function Modules .

CHANGEDOCUMENT_READ_HEADERS Change document: Read change document header

CHANGEDOCUMENT_READ_POSITIONS Change document: Read change document items

Please reward if useful.

Read only

Former Member
0 Likes
2,707

Use Fms: 'CHANGEDOCUMENT_READ_HEADERS',

'CHANGEDOCUMENT_READ_POSITIONS'

REPORT ZEXAMPLE LINE-SIZE 255.

TABLES TCDOBT.

DATA: ICDHDR LIKE CDHDR OCCURS 0 WITH HEADER LINE,

IEDITPOS LIKE CDSHW OCCURS 0 WITH HEADER LINE,

VDATE(20).

PARAMETERS: P_OBJCLA LIKE TCDOBT-OBJECT OBLIGATORY,

P_OBJID LIKE CDHDR-OBJECTID,

P_UNAME LIKE SY-UNAME DEFAULT SY-UNAME,

P_DATUM LIKE SY-DATUM DEFAULT SY-DATUM.

PERFORM RPT_HEADERS.

CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'

EXPORTING

OBJECTCLASS = P_OBJCLA

OBJECTID = P_OBJID

USERNAME = P_UNAME

DATE_OF_CHANGE = P_DATUM

TABLES

I_CDHDR = ICDHDR

EXCEPTIONS

NO_POSITION_FOUND = 1

WRONG_ACCESS_TO_ARCHIVE = 2

TIME_ZONE_CONVERSION_ERROR = 3

OTHERS = 4.

IF SY-SUBRC EQ 0.

IF NOT ICDHDR[] IS INITIAL.

LOOP AT ICDHDR.

CLEAR VDATE.

CONCATENATE ICDHDR-UDATE ICDHDR-UTIME INTO VDATE SEPARATED BY SPACE.

WRITE:/ ICDHDR-OBJECTID, 15 ICDHDR-USERNAME, 30 VDATE, 45 ICDHDR-TCODE.

CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'

EXPORTING

CHANGENUMBER = ICDHDR-CHANGENR

TABLES

EDITPOS = IEDITPOS.

LOOP AT IEDITPOS.

WRITE:/60 IEDITPOS-FNAME, 75 IEDITPOS-F_OLD, 90 IEDITPOS-F_NEW.

ENDLOOP.

ENDLOOP.

ELSE.

WRITE:/ 'NO DOCUMENTS FOUND FOR', P_OBJCLA, P_OBJID.

ENDIF.

WRITE:/ 'ERROR ACCESSING DOCUMENT HEADER'.

ENDIF.

&----


*& FORM RPT_HEADERS

&----


FORM RPT_HEADERS.

SELECT SINGLE OBTEXT FROM TCDOBT INTO TCDOBT-OBTEXT

WHERE OBJECT EQ P_OBJCLA AND

SPRAS = SY-LANGU.

WRITE:/ 'OBJECTCLASS:', TCDOBT-OBTEXT.

WRITE:/ 'OBJECT ID', 15 'CHANGED BY', 30 'CHANGED ON', 45 'CHANGED WITH',

60 'FIELD CHANGED', 75 'OLD VALUE', 90 'NEW VALUE'.

ULINE.

ENDFORM. " RPT_HEADERS

Regards,

Joy.

Read only

Former Member
0 Likes
2,707

Hi

*Use FM CHANGEDOCUMENT_READ *

Read only

0 Likes
2,707

hi Chari,

I am using the CHANGEDOCUMENT_READ_RANGES to give the import parameter objectclass_tab. How can I achieve this in CHANGEDOCUMENT_READ case.

Regards,

Jeetu

Read only

Azeemquadri
Contributor
0 Likes
2,707

Hi,

To restrict data from cdpos and cdhdr tables you need to provide the full key which could include the document number , item number schedule line etc etc ...

VERKBELEG is the class for sales orders.

Read only

0 Likes
2,707

We might not be able to give OBJECTID or CHANGENR key values always since we do not know which object might be changed. It takes more than 10 mins to query from cdhdr table to track any changes in a particular object class (eg :material).Is there any other way, we can improve the performance?

Read only

Former Member
0 Likes
2,708

Hi,

To query the table CDPOS, first query the table CDPOS to get the change number.

For eg: To track changes to a purchase order

OBJECTCLAS = 'EINKBELEG'

OBJECTID = 'Purchase order number'

get the change number from the CDHDR table

Depending on Objectclas, Objectid, Change number you can easily get the details from CDPOS table.

Thank you,

Juli

Read only

506403
Product and Topic Expert
Product and Topic Expert
0 Likes
2,707

Hi,

This table might have grown too large its capacity is 2 billion so that might be an issue for your performance.

You can simply HASH partition table with column CHANGENR.

Eg: ALTER TABLE SCHEMA.CDPOS PARTITION BY HASH (CHANGENR) PARTITIONS 8

You can refer note " 2044468 - FAQ: SAP HANA Partitioning" for more details.