‎2010 Mar 05 11:09 AM
Hi,
I have a requirement where in I have to modify all the articles (MARC-MATNR) which are specified in the selection screen of a report. This report would be running in back ground for every one hour. user would not be entering input in the selection screen, since report would be running as a bactch job. whenver the article is changed and new article is created my report has to get triggerred.But it does not mean that the program should be run at the very moment a new article is created or changed. It just means that program should run for only those records which have undergone any of the below 4 changes in the last 1 hour
( 1.Supply source field MARC-BWSCL is changed for a article
2.vendorEORD-LIFNR is changed for a article
3. new purchasing source list is added (EORD Records) for a article.
4. new article is created).
Can anyone please tell me how to proceed with this requirement
Thanks in advance
Ram Devi
‎2010 Mar 05 11:57 AM
You report may analyze tables CDHDR/CDPOS(1) for material, since the last run (stored somewhere)
In this table you will get the key of the record, and for updates the values before and after (not for insertion)
Look for objects(2) MATERIAL "Change documents for material" (contains MARC) and ORDERBUCH "Change documents for source list entries" (contains EORG) in CDHDR, then look for your field/table names in CDPOS for updates or inserts.
NB: A more elegant, and much more harder to develop way would be to use BADI/Exit to trigger V3 updates and then collecting them for your requirement, but that doesnt seem to be necessary.
Regards,
Raymond
(1) Read some documentation at [Change Documents|http://help.sap.com/SAPHELP_NWPI71/helpdata/EN/2a/fa0175493111d182b70000e829fbfe/frameset.htm]
(2) Search objects by table by browsing TCDOB "Objects for change document creation"
‎2010 Mar 05 12:06 PM
Another way is
Enable the change pointers for the 4 fields you mentioned for article master using transaction code SCDO.This will be create change pointer entreis in BDCPV tables
then
CALL FUNCTION 'CHANGE_POINTERS_READ'
EXPORTING
message_type = gc_message_type
read_not_processed_pointers = 'X'
TABLES
change_pointers = lt_chgptrs_tab.
if any values found you can run your report , then after that. then call the following fm to update the processed entreis in change pointer table to be marked as processed, so next time theses entries will not consider
CALL FUNCTION 'CHANGE_POINTERS_STATUS_WRITE'
EXPORTING
message_type = gc_message_type
TABLES
change_pointers_idents = gt_pointer_id.
a®
‎2010 Mar 12 11:05 AM
Hi,
After reading Change pointers from the functional module CHANGE_POINTERS_READ, how can I generate IDOC and read that IDOC for further processing
Please help me out
‎2010 Mar 12 12:18 PM
hi...
follow the steps to trigger Idoc
1) go to transaction BD61 to acivate change pointers.
2) go to transaction BD50 to activate message type "MATMAS".
3) go to transaction BD52 and find the entries corresponding to message type "matmas". delete all the entries except the four fields you need.
5) maintain the partner profile.
4) set the transaction BD21 in back ground job so that when ever create/changes happened in the four fields then change pointers will track those changes and trigger idoc.
Regards,
Lokeswari.