2009 May 21 3:16 PM
Hi,
I am working on creating a report for changed documents for scheduling agreement.
I am reading tables cdhdr and cdpos for getting the changed doc data.
How can I get data for schedule Line number and Item number from CDPos or cdhdr ? as this needs to be displayed in the output as well.
Is it available in other tables ? or any FM can be used?
Regards,
Shital.
2009 May 21 3:22 PM
Try this function module..
CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
EXPORTING
date_of_change = p_datefr
objectclass = 'MATERIAL'
date_until = p_dateto
username = '*'
TABLES
i_cdhdr = i_cdhdr
EXCEPTIONS
no_position_found = 1
wrong_access_to_archive = 2
time_zone_conversion_error = 3
OTHERS = 4.
LOOP AT i_cdhdr.
**For each change document header, read the corresponding change document line items
refresh: editpos.
CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
EXPORTING
changenumber = i_cdhdr-changenr
TABLES
editpos = editpos
EXCEPTIONS
no_position_found = 1
wrong_access_to_archive = 2
OTHERS = 3.
ENDLOOP.
Prabhu
Edited by: Prabhu Das on May 21, 2009 7:53 PM
Hi,
I am working on creating a report for changed documents for scheduling agreement.
I am reading tables cdhdr and cdpos for getting the changed doc data.
How can I get data for schedule Line number and Item number from CDPos or cdhdr ? as this needs to be displayed in the output as well.
Is it available in other tables ? or any FM can be used?
Regards,
Shital.
2009 May 21 3:22 PM
Try this function module..
CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
EXPORTING
date_of_change = p_datefr
objectclass = 'MATERIAL'
date_until = p_dateto
username = '*'
TABLES
i_cdhdr = i_cdhdr
EXCEPTIONS
no_position_found = 1
wrong_access_to_archive = 2
time_zone_conversion_error = 3
OTHERS = 4.
LOOP AT i_cdhdr.
**For each change document header, read the corresponding change document line items
refresh: editpos.
CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
EXPORTING
changenumber = i_cdhdr-changenr
TABLES
editpos = editpos
EXCEPTIONS
no_position_found = 1
wrong_access_to_archive = 2
OTHERS = 3.
ENDLOOP.
Prabhu
Edited by: Prabhu Das on May 21, 2009 7:53 PM
2009 May 21 3:27 PM
Thanks.
Could you please tell me which field in the editpos table will correspond to line item number and schedule line number?
REgards,
Shital
2009 May 21 3:35 PM
check in you system where used list and see the sample code...
this is how it is going to use..
SELECT SINGLE matnr maktx INTO (w_matnr, w_maktx)
FROM makt WHERE matnr = i_cdhdr-objectid AND "header data
spras = sy-langu.
**Loop thru all change document line items and filter out changes to the
**US material tax classification indicator
LOOP AT editpos WHERE tabname = 'MARC' AND
tabkey = 'US UTXJ'.
IF editpos-chngind = 'U'.
w_text = 'Changes done'.
read respective table and display.
ENDLOOP.
Prabhudas
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |