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

Tables CDPOS CDHDR

Former Member
0 Likes
1,716

Hi !

I have to create report that select materials which their status changed. In the report i selected the entries from cdpos that field old_value changed

to new_value and objectclas = 'MATERIAL'.

however when i execute the report in the production environment the report failed because "timeout"

( because cdpos contain 3,000,000 records ).

Is in SAP other tables similar to cdpos and cdhdr that

contain the changes of the material status however contains much less record ?

thanks

moshe

Hi !

I have to create report that select materials which their status changed. In the report i selected the entries from cdpos that field old_value changed

to new_value and objectclas = 'MATERIAL'.

however when i execute the report in the production environment the report failed because "timeout"

( because cdpos contain 3,000,000 records ).

Is in SAP other tables similar to cdpos and cdhdr that

contain the changes of the material status however contains much less record ?

thanks

moshe

8 REPLIES 8
Read only

Former Member
0 Likes
1,268

Hi Solman,

Please use this FM.

<b>CHANGEDOCUMENT_READ_HEADERS

CHANGEDOCUMENT_READ_POSITIONS

CHANGEDOCU_CDPOS_READ</b>

Hope this will help.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,268

Hi,

CHANGEDOCUMENT_READ_HEADERS Change document: Read change document header

CHANGEDOCUMENT_READ_POSITIONS Change document: Read change document items

Read only

0 Likes
1,268

Solmon,

Generally the tables cdhdr and cdpos contain all the change document entries. Obviously you can not just do a select on that table since those tables will be huge. Always suggested to use the fm's mentioned in the above posts for this purpose.

Thanks,

Read only

Former Member
0 Likes
1,268

Best one is a CHANGEDOCUMENT_READ

Read only

Former Member
0 Likes
1,268

I don't think it matters whether you use the FMs or a simple select. If you only have the OBJECTCLAS, it will take time. You might be able to reduce the time by giving a range of OBJECTIDs that correspond to the dates you are interested in.

Rob

Read only

0 Likes
1,268

write a select staement which reads from cdhdr where tcode is ur desired t-code.

carry objectclass, objectid and change nr 's in itab

loop at itab.

select statement from cdpos where objectclass = iatb-objectclass and objectid = itab-objectid and changenr = itab.changenr.

endloop.

add all neccessary stuff u need...

hope this saves ur time..

Read only

0 Likes
1,268

I did a quick test. If you can specify some sort of range or pattern for the OBJECTIDs, it should run more quickly. Exactly how quickly will depend on the range or pattern you use. Be careful though, using a range on a character field may give you results you don't expect. A pattern would be better.

Rob

Read only

Former Member
0 Likes
1,268

Hi,

primary key fields need to be passed in the select statement. So that access will be faster. you would not get timeout when such kind of situation arise.

Regards,

Sudhakar.