2008 Aug 05 11:58 AM
how to use this FM "CHANGEDOCUMENT_READ_POSITIONS'"
hi gurus pls let me know how to use this function module............
if u have any sample program send to me which is very useful for me........
cheers
Venky
2008 Aug 05 12:00 PM
Keep the cursor on the FM name and check for Where Used List to find the usage of this program
2008 Aug 05 12:01 PM
hi
go to SE37
give FM name and
F7
here u find and button Funtion module documentation
check this documentation
Cheers
Snehi
2008 Aug 05 12:04 PM
Hi,
The function module reads change document items and processes both the old and the new values according to their category. In some cases, the units and currencies are added on to the value fields. Additionally, the corresponding table header is determined.
The change document number is required as a minimum entry.
The program RSSCD100 uses this function module and can be regarded as a possible application.
Example call:
DATA: NUMMER LIKE CDPOS-CHANGNR,
TABNAME LIKE CDPOS-TABNAME,
TABKEY LIKE CDPOS-TABKEY.
DATA: BEGIN OF EDIT_FORM OCCURS 50.
INCLUDE STRUCTURE CDSHW.
DATA: END OF EDIT_FORM.
CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
EXPORTING CHANGENR = NUMMER
TABLENAME = TABKEY
TABLEKEY = TABKEY
IMPORTING HEADER = CDHDR
TABLES EDITPOS = EDIT_FORM.
Regards,
Venkat n
2008 Aug 05 12:04 PM
Hello,
The function module reads change document items and processes both the old and the new values according to their category. In some cases, the units and currencies are added on to the value fields. Additionally, the corresponding table header is determined.
The change document number is required as a minimum entry.
The program RSSCD100 uses this function module and can be regarded as a possible application.
Example call:
DATA: NUMMER LIKE CDPOS-CHANGNR,
TABNAME LIKE CDPOS-TABNAME,
TABKEY LIKE CDPOS-TABKEY.
DATA: BEGIN OF EDIT_FORM OCCURS 50.
INCLUDE STRUCTURE CDSHW.
DATA: END OF EDIT_FORM.
...
CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
EXPORTING CHANGENR = NUMMER
TABLENAME = TABKEY
TABLEKEY = TABKEY
IMPORTING HEADER = CDHDR
TABLES EDITPOS = EDIT_FORM
EXCEPTIONS ...
Regards
Mustameer
2008 Aug 05 12:04 PM
Hi VENKAT,
DATA: NUMMER LIKE CDPOS-CHANGNR,
TABNAME LIKE CDPOS-TABNAME,
TABKEY LIKE CDPOS-TABKEY.
DATA: BEGIN OF EDIT_FORM OCCURS 50.
INCLUDE STRUCTURE CDSHW.
DATA: END OF EDIT_FORM.
...
CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
EXPORTING CHANGENR = NUMMER
TABLENAME = TABKEY
TABLEKEY = TABKEY
IMPORTING HEADER = CDHDR
TABLES EDITPOS = EDIT_FORM
EXCEPTIONS .
Regards,
Mahi.
2008 Aug 05 12:05 PM
DATA: NUMMER LIKE CDPOS-CHANGNR,
TABNAME LIKE CDPOS-TABNAME,
TABKEY LIKE CDPOS-TABKEY.
DATA: BEGIN OF EDIT_FORM OCCURS 50.
INCLUDE STRUCTURE CDSHW.
DATA: END OF EDIT_FORM.
...
CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
EXPORTING CHANGENR = NUMMER
TABLENAME = TABKEY
TABLEKEY = TABKEY
IMPORTING HEADER = CDHDR
TABLES EDITPOS = EDIT_FORM
EXCEPTIONS .
Regards,
Mahi.
2008 Aug 05 12:05 PM
hi
Click on the Tab Pattern on the top menu bar and give the FM name and click on ok.
you will get the FM parameters and put cursor on the FM and double click you can get the whole source code ,export,import parameters.
regards
atul
2008 Aug 05 12:10 PM
CHANGEDOCUMENT_READ_POSITIONS
Get the details of a change document, and store them in an internal table. This will tell you whether a field was changed, deleted, or updated.
CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
EXPORTING
objectclass = 'EINKBELEG'
objectid = l_objectid
username = space
TABLES
i_cdhdr = lt_cdhdr.
LOOP AT lt_cdhdr WHERE udate IN s_aedat.
CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
EXPORTING
changenumber = lt_cdhdr-changenr
TABLES
editpos = lt_editpos.
LOOP AT lt_editpos WHERE fname = 'LOEKZ'
AND f_new = 'L'.
p_desc = text-r01. " Cancel Contract
ENDLOOP.
ENDLOOP.
refer to the link for Sample program:
http://www.sap-img.com/ab024.htm
With luck,
Pritam.