2006 Jun 21 5:21 PM
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
2006 Jun 21 5:24 PM
Hi Solman,
Please use this FM.
<b>CHANGEDOCUMENT_READ_HEADERS
CHANGEDOCUMENT_READ_POSITIONS
CHANGEDOCU_CDPOS_READ</b>
Hope this will help.
Regards,
Ferry Lianto
2006 Jun 21 5:25 PM
Hi,
CHANGEDOCUMENT_READ_HEADERS Change document: Read change document header
CHANGEDOCUMENT_READ_POSITIONS Change document: Read change document items
2006 Jun 21 5:28 PM
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,
2006 Jun 21 5:29 PM
2006 Jun 21 5:47 PM
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
2006 Jun 21 6:48 PM
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..
2006 Jun 21 7:14 PM
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
2006 Jun 21 7:21 PM
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.