on 10-06-2005 3:14 PM
Hi,
We have a requirement where we have to capture the changes to certain fields done through transactions
MM02, CS02, CA22, KP26 & KZ21.
What would be best way to acheive this?
One way which I could figure out was querying CDHDR and CDPOS? Is this the best way to do it?
If so what is best way in finding the object class and number for a particular field?
Will the table TCDOB be enough?
Please give your valuable inputs. Thank you.
Regards,
Saji.
My friend, follow these steps:
1st step:
SELECT *
FROM cdhdr
INTO table t_cdhdr
WHERE OBJECTCLAS = 'MATERIAL' and
OBJECTID = 'put the document/material number'.
2nd step:
LOOP AT t_cdhdr.
CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
EXPORTING
changenumber = t_cdhdr-CHANGENR
TABLES
EDITPOS = t_EDITPOS
EDITPOS_WITH_HEADER = t_EDITPOS_WITH_HEADER
EXCEPTIONS
NO_POSITION_FOUND = 1
WRONG_ACCESS_TO_ARCHIVE = 2
OTHERS = 3.
IF sy-subrc <> 0.
Sort t_cdhdr by CHANGENR. "changes order
****error message
else.
HOU HAVE TO PREPARE YOUR READ STATEMENT WITH THE POSITION'S POSITIONS YOU WANT TO READ.
Read table t_EDITPOS_WITH_HEADER
with key tabkey+X(X) = IT_TABLE-DOCUMENT
tabkey+X(X) = IT_TABLE-ITEM
outlen = 'SIZE' "EX.: '0017'
fname = 'FIELDNAME'.
if sy-subrc = 0.
perform CALCULATE_CHANGES.
endif.
clear: t_EDITPOS,
t_EDITPOS_WITH_HEADER.
clear: t_EDITPOS[],
t_EDITPOS_WITH_HEADER[].
Endif.
endloop.
ENDIF.
*----
Glauco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Object for
MM02 - MATERIAL
CS02 - STUE
CA22 - PLAN
Other two I am not sure.
And yes for selection from CDHDR you can specify TCODE also. For example MATERIAL change documents are written for MM01 also.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can use fm CHANGEDOCUMENT_READ_HEADERS and CHANGEDOCUMENT_READ_ITEM but you should know the type object for each transaction: you can see transaction SCDO to get out it.
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
use FM Chancedocument_read
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.