Application Development 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: 

cdpos

Former Member
0 Kudos

Hi,

Can anybody tell how to use the FM CHANGEDOCUMENT_READ_HEADERS?

2 REPLIES 2

Former Member
0 Kudos

ARCHIVE_HANDLE

DATE_OF_CHANGE

OBJECTCLASS ADRESSE

OBJECTID

TIME_OF_CHANGE 00:00:00

USERNAME

LOCAL_TIME

DATE_UNTIL 31.12.9999

TIME_UNTIL 23:59:59

NOPLUS_ASWILDCARD_INOBJID

here for object class go to CDHDR table and see your class

CDHDR-OBJECTCLAS

CDHDR-OBJECTID can be "MATERIAL' or what you r looking for just check

Former Member
0 Kudos

"CHANGE DOCUMENTS" in SAP Terminology

1 The same thing which u are asking

we had developed here. For Eg : Any change

in the material master will be detected

and a mail will be sent to the concerned

employee.

THIS WILL ALSO DETECT WHICH FILEDS HAVE CHANGED.

IT CAN ALSO GIVE, The Old Value, And The New Value.

2. This Mechanism is called CHANGE DOCUMENTS in

SAP Terminology

3. 2 Fuction Modules are Required.

(They will fetch necessary data from CDHDR,CDPOS)

CHANGEDOCUMENT_READ_HEADERS

CHANGEDOCUMENT_READ_POSITIONS

4. The First FM gives list of all

records ( with change no) which have changed.

5. Loop at the above and the second FM will

provide the details (old-val, new-val) for

each record.

6. While using 1st Fm, i used docclass as 'MATERIAL'.

BCOS

the concept of change documents is applicable

to other type of documents also (depends upon

customization)

***************

Changedocument_Read_Headers :

From FM Documentation,

Change document: Read change document header

Preliminary comment

This function module has been released.

The documentation is being revised so that it conforms to the requirements for released function modules.

Functionality

The function module determines change document numbers with the respective header information for an object class. The determination can be limited by specifying various parameters (see interface description).

The change documents are read from the database (default) or from an archive depending on the ARCHIV_HANDLE parameter.

Using the parameter LOCAL_TIME you can also specify whether the local time and date (referring to the time zone) or a system time and date (default) are transferred.

Example call:

DATA: OBJEKT LIKE CDHDR-OBJECTCLAS,

OBJEKTID LIKE CDHDR-OBJECTID,

AENDERER LIKE CDHDR-USERNAME,

DATUM LIKE CDHDR-UDATE,

ZEIT LIKE CDHDR-UTIME,

DATA: BEGIN OF ICDHDR OCCURS 50.

INCLUDE STRUCTURE CDHDR.

DATA: END OF ICDHDR.

CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'

EXPORTING OBJECTCLASS = OBJEKT

OBJECTID = OBJEKTID

USERNAME = AENDERER

TIME_OF_CHANGE = ZEIT

DATE_OF_CHANGE = DATUM

TABLES I_CDHDR = ICDHDR

EXCEPTIONS ...

***************************

Changedocument_Read_Headers :

The function module determines change document numbers with the

respective header information for an object class. The determination can

be limited by specifying various parameters (see interface description).

The change documents are read from the database (default) or from an

archive depending on the ARCHIV_HANDLE parameter.

Using the parameter LOCAL_TIME you can also specify whether the local

time and date (referring to the time zone) or a system time and date

(default) are transferred.