‎2007 Jul 17 3:35 PM
loop at gt_cc.
call function 'CHANGEDOCUMENT_READ'
exporting
* ARCHIVE_HANDLE = 0
* CHANGENUMBER = ' '
* DATE_OF_CHANGE = '00000000'
objectclass = 'MATERIAL'
OBJECTID = gt_cc-matnr
TABLEKEY =
tables
editpos = CHGDOC
* EXCEPTIONS
* NO_POSITION_FOUND = 1
* WRONG_ACCESS_TO_ARCHIVE = 2
* TIME_ZONE_CONVERSION_ERROR = 3
* OTHERS = 4
.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endloop.
Getting a error "Field "TABLES" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement"How to fix this error.
‎2007 Jul 17 3:37 PM
The problem is that you are not specifying the parameter before the TABLES line.
call function 'CHANGEDOCUMENT_READ'
exporting
* ARCHIVE_HANDLE = 0
* CHANGENUMBER = ' '
* DATE_OF_CHANGE = '00000000'
objectclass = 'MATERIAL'
OBJECTID = gt_cc-matnr
TABLEKEY = "<<--- RIGHT HERE
tables
editpos = CHGDOC
Either comment it out, or provide a parameter/value here.
REgards,
Rich Heilman
‎2007 Jul 17 3:40 PM
What has to filled to the Table_key... I am passing the material number and would like to get the changes in the quantity of the material...
‎2007 Jul 17 3:44 PM
You can leave it blank i guess
The table key is the key of a changed table entry.
If no table key is specified, all change document positions with the
specified change document number are determined.
If a table key is specified, only the change document positions with the
specified change document number and table key are determined.
‎2007 Jul 17 3:49 PM
can i give the field name, whose changes i want to record and update in table key.
Thank you.
‎2007 Jul 17 3:37 PM
check out the one in bold..if you are not passing any value to this..just comment that
loop at gt_cc.
call function 'CHANGEDOCUMENT_READ'
exporting
ARCHIVE_HANDLE = 0
CHANGENUMBER = ' '
DATE_OF_CHANGE = '00000000'
objectclass = 'MATERIAL'
OBJECTID = gt_cc-matnr
<b>TABLEKEY =</b>
tables
editpos = CHGDOC
EXCEPTIONS
NO_POSITION_FOUND = 1
WRONG_ACCESS_TO_ARCHIVE = 2
TIME_ZONE_CONVERSION_ERROR = 3
OTHERS = 4
.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endloop.
‎2007 Jul 17 3:38 PM
Hi,
your call is wrong:
call function 'CHANGEDOCUMENT_READ'
exporting
ARCHIVE_HANDLE = 0
CHANGENUMBER = ' '
DATE_OF_CHANGE = '00000000'
objectclass = 'MATERIAL'
OBJECTID = gt_cc-matnr
<b> TABLEKEY =</b>
tables
editpos = CHGDOC
EXCEPTIONS
NO_POSITION_FOUND = 1
WRONG_ACCESS_TO_ARCHIVE = 2
TIME_ZONE_CONVERSION_ERROR = 3
OTHERS = 4
.
You have to fill TABLEKEY!!
Regards, Dieter
‎2007 Jul 17 3:48 PM
Hi Karthik,
Please do this if you don't have tablekey parameter.
loop at gt_cc.
call function 'CHANGEDOCUMENT_READ'
exporting
* ARCHIVE_HANDLE = 0
* CHANGENUMBER = ' '
* DATE_OF_CHANGE = '00000000'
objectclass = 'MATERIAL'
OBJECTID = gt_cc-matnr
* TABLEKEY = "Change here (commented)
tables
editpos = CHGDOC
* EXCEPTIONS
* NO_POSITION_FOUND = 1
* WRONG_ACCESS_TO_ARCHIVE = 2
* TIME_ZONE_CONVERSION_ERROR = 3
* OTHERS = 4
.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endloop.
Regards,
Ferry Lianto
‎2007 Jul 17 3:50 PM
Hi,
try this
DATA: CDRED TYPE TABLE OF CDRED.
CALL FUNCTION 'CHANGEDOCUMENT_READ'
EXPORTING
OBJECTCLASS = 'MATERIAL'
OBJECTID = '000000000000000001'
TABLES
EDITPOS = CDRED
EXCEPTIONS
NO_POSITION_FOUND = 1
WRONG_ACCESS_TO_ARCHIVE = 2
TIME_ZONE_CONVERSION_ERROR = 3
OTHERS = 4.
*
and look into CDRED.
Regards, Dieter
‎2007 Jul 17 3:59 PM
Getting Error.
The function module interface allows you to specify only fields
of a particular type under "OBJECTID". The field "GT_CC-MATNR" specified here
has a different field type
‎2007 Jul 17 4:06 PM
Define a varaible of the smae type as OBJECTID and move the value GT_CC-MATNR to that variable before calling the FM. Pass that variable instead of the GT_CC-MATNR to the FM's interface
Regards,
Ravi
‎2007 Jul 17 4:13 PM
Hi,
try this:
PARAMETERS: P_MATNR LIKE MARA-MATNR.
Änderungen von Stammdaten/Belegen anzeigen lassen.
DATA: CDRED TYPE TABLE OF CDRED.
DATA: OBJECTID LIKE CDHDR-OBJECTID.
*
OBJECTID = P_MATNR.
*
CALL FUNCTION 'CHANGEDOCUMENT_READ'
EXPORTING
OBJECTCLASS = 'MATERIAL'
OBJECTID = OBJECTID
TABLES
EDITPOS = CDRED
EXCEPTIONS
NO_POSITION_FOUND = 1
WRONG_ACCESS_TO_ARCHIVE = 2
TIME_ZONE_CONVERSION_ERROR = 3
OTHERS = 4.
*
IF SY-SUBRC <> 0. WRITE SY-SUBRC. ENDIF.
Regards, Dieter
‎2007 Jul 17 4:45 PM
can i give the field name, whose changes i want to record and display in table key.
Thank you.
‎2007 Jul 17 4:50 PM
‎2007 Jul 17 5:14 PM
My requirement is to go thru FM CHANGEDOCUMENT_READ give the service entry number and get the old and new values of amount for a PO.
Please demonstrate how to achieve this
‎2007 Jul 17 5:21 PM
You can only give PO number to this function module, get all the changes for the given date range and then keep only the field changes that you are interested in. The changes are tracked using the key fields of the main table EKKO which is the PO number.
‎2007 Jul 17 5:32 PM
I was told give the Service Entry Number to track the changes.......
However I am really not able to understand how to work with fm...
can you explain me in detail with a clear example.
Thank you.
‎2007 Jul 17 5:40 PM
What is a service entry number in your system? Is it a service PO? Please check if there is an entry in EKKO with that number. What transaction do you use to see the sevice entry? If it is PO like document, then you can call this function module by sending the service PO number (with leading zeros) to the OBJECTID, OBJECTCLASS = 'EINKBELEG' and DATE_OF_CHANGE = date since you want to track the changes for this PO
‎2007 Jul 18 8:17 AM
Hi Karthik,
i'm not quiet sure if the changes, wich you want to see, are be stored.
The simples way is, make the changes by yourselve and look in
table CDHDR with the date and your user-id. If you find some entries
in CDHDR takes this Informations for the FM CHANGEDOCUMENT_READ
If you don't find any entries in CDHDR you cannot use this FM.
Hope it helps.
Regards, Dieter
‎2007 Jul 18 11:59 AM