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

To fetch from CDHDR and CDPOS using FM CHANGEDOCUMENT_READ_RANGES

Former Member
0 Likes
5,804

Hi all,

Please let me know how to fetch the Details from CDHDR and CDPOS using Function Module CHANGEDOCUMENT_READ_RANGES. If possible Clear me with an Example. It has to fetch the datas of Table KNVV

KNV1 etcc.... Separately for the Corresponding Table Selected In Report..

With regards,

Sudhakar Govndaraj.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,803

Hi ,

Please check this FM : SUSR_CHANGE_DOC_IDENTITY ,

or check report : RSSCD100_PFCG

Regards,

Srini.

Hi all,

Please let me know how to fetch the Details from CDHDR and CDPOS using Function Module CHANGEDOCUMENT_READ_RANGES. If possible Clear me with an Example. It has to fetch the datas of Table KNVV

KNV1 etcc.... Separately for the Corresponding Table Selected In Report..

With regards,

Sudhakar Govndaraj.

3 REPLIES 3
Read only

Former Member
0 Likes
2,804

Hi ,

Please check this FM : SUSR_CHANGE_DOC_IDENTITY ,

or check report : RSSCD100_PFCG

Regards,

Srini.

Read only

Former Member
0 Likes
2,803

Thanks.

Read only

0 Likes
2,803

Hi Sudhakar,

cdhdr-objectclas = 'MATERIAL'.

cdhdr-objectid = t_mara-matnr.

CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'

EXPORTING

date_of_change = cdhdr-udate

objectclass = cdhdr-objectclas

objectid = cdhdr-objectid

time_of_change = cdhdr-utime

username = cdhdr-username

TABLES

i_cdhdr = icdhdr

EXCEPTIONS

no_position_found = 1

OTHERS = 2.

CHECK sy-subrc EQ 0.

DELETE icdhdr WHERE change_ind EQ 'I'.

CHECK NOT icdhdr[] IS INITIAL.

LOOP AT icdhdr.

CHECK icdhdr-udate IN period.

CHECK icdhdr-username IN name.

CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'

EXPORTING

changenumber = icdhdr-changenr

IMPORTING

header = cdhdr

TABLES

editpos = icdshw

EXCEPTIONS

no_position_found = 1

OTHERS = 2.

CHECK sy-subrc EQ 0.

LOOP AT icdshw.

CHECK icdshw-text_case EQ space.

MOVE-CORRESPONDING icdshw TO itab.

MOVE-CORRESPONDING icdhdr TO itab.

MOVE icdshw-tabkey+3 TO itab-matnr.

APPEND itab.

ENDLOOP.

ENDLOOP.

Please refer the blog

/people/erwan.lebrun/blog/2007/03/09/documents-how-to-track-changes-through-abap

Edited by: Rahul Babukuttan on Nov 26, 2010 11:38 AM