07-02-2007 8:39 AM
Hi,
i am fetching changenr from cdpos based on the requirement.
Then giving changenr for that material as input i am getting username and date.
I am getting desired result but cdpos is a cluster table so performance issue is there. so pls tell me is there any method or function module.
I am writing querries as follows:-
FORM extract_data_cdhdr.
*
itab_mara1[] = itab_mara[].
SELECT objectclas objectid changenr tabkey
INTO TABLE itab_cdpos
from cdpos
WHERE objectid IN S_MATNR " itab_mara1-objectid
AND TABNAME = 'MARC'
AND FNAME = 'STAWN'.
SORT itab_cdpos BY OBJECTCLAS OBJECTID CHANGENR.
Delete itab_cdpos where NOT tabkey+21(4) IN s_werks.
IF NOT itab_cdpos[] IS INITIAL.
SELECT changenr username udate OBJECTID
INTO TABLE itab_cdhdr
FROM cdhdr
FOR ALL ENTRIES IN itab_cdpos
WHERE OBJECTCLAS = itab_cdpos-objectclas
AND objectid = itab_cdpos-objectid
AND changenr = itab_cdpos-changenr.
if sy-subrc eq 0.
sort itab_cdhdr descending by udate.
SORT itab_cdhdr BY objectid.
endif.
Thanks,
Sandeep Garg
07-02-2007 10:32 AM
FM :
CHANGEDOCUMENT_READ_HEADERS - Change document: Read change document header
CHANGEDOCUMENT_READ_POSITIONS - Change document: Read change document items
CHANGEDOCUMENT_READ - Change document: Read and edit change documents
PLANNED_CHANGES_READ_HEADERS - Change document: Read change documentscheduling headers
PLANNED_CHANGES_READ_POSITIONS - Change document: Read and edit scheduling items
Regards,
Anish Thomas
07-02-2007 10:58 AM
hi,
i used these function modules but these are asking for changenr.
And i donot have changenr. So i am using cdpos.
So can you tell me what to do.
Thanks,
SK Garg
07-02-2007 11:02 AM
Hi Take a look at my blog plz :
/people/erwan.lebrun/blog/2007/03/09/documents-how-to-track-changes-through-abap href="/people/erwan.lebrun/blog/2007/03/09/documents-how-to-track-changes-through-abap:///people/erwan.lebrun/blog/2007/03/09/documents-how-to-track-changes-through-abap
Hope this helps,
Erwan