11-20-2012 7:24 PM
Hi All,
I am trying to capture the number of user updates done to the delivery date for the PO line item in the ME22N. ZZ_COUNTER(Counter for system moves) is capturing right but the ZZ_UCOUNTER(counter for user moves) is not updating. Can any one of you help me how to resolve this issue?
Thanks,
Uday.
11-21-2012 3:08 PM
Thank you all for your quick and helpful suggestions. I dont know how i missed the fact that those two are custom fields.
But i wrote a below logic to get the usermoves for the PO
SELECT objectclas objectid changenr
FROM cdhdr
INTO TABLE gt_usermov
WHERE objectclas = 'EINKBELEG'
AND objectid = <fs_items>-ebeln
AND username NE 'BATCH_MGR' " not the auto moves
AND change_ind = 'U'.
(FYI: I got to join CDPOS as i need to count only the changes done to EINDT field for that particular PO)
IF NOT gt_usermov[] IS INITIAL.
SELECT objectclas objectid changenr
INTO TABLE gt_userpos
FROM cdpos
FOR ALL ENTRIES IN gt_usermov
WHERE objectid = gt_usermov-objectid
AND objectclas = 'EINKBELEG'
AND changenr = gt_usermov-changenr
AND fname = 'EINDT' "need to fetch the changes made only to the delivery date field
AND chngind = 'U'.
IF sy-subrc = 0.
DELETE ADJACENT DUPLICATES FROM gt_userpos COMPARING ALL FIELDS.
ENDIF.
DESCRIBE TABLE gt_userpos LINES lv_usercount.
ENDIF.
it has impacted the performance little bit due to the size and type of CDHDR and CDPOS(cluster) tables. Any other better way you can think of.
11-21-2012 5:48 AM
Hello Uday,
I guess zz_ucounter and zz_counter are your custom fields to track the system moves and user update.
Check in delivery program, may be someone has put logic in exit/badi for ZZ_COUNTER (system moves) and same you need to write this for your counter zz_ucounter.
Regards,
Deepti
11-21-2012 6:09 AM
Hi ,
These are custom fields , so there logic would be written in a BADI/User-exit (for e.g. ME_PROCESS_PO_CUST) . Just check what has been implemented for these fields and then you can debug and find out why zzucounter is not working as it is supposed to.
11-21-2012 6:16 AM
Hi ,
If you do not need the information immediately why not write a report based on the change documents.
Have a look at Transaction VL22N (Program WSCDSHOW_ALV).
11-21-2012 3:08 PM
Thank you all for your quick and helpful suggestions. I dont know how i missed the fact that those two are custom fields.
But i wrote a below logic to get the usermoves for the PO
SELECT objectclas objectid changenr
FROM cdhdr
INTO TABLE gt_usermov
WHERE objectclas = 'EINKBELEG'
AND objectid = <fs_items>-ebeln
AND username NE 'BATCH_MGR' " not the auto moves
AND change_ind = 'U'.
(FYI: I got to join CDPOS as i need to count only the changes done to EINDT field for that particular PO)
IF NOT gt_usermov[] IS INITIAL.
SELECT objectclas objectid changenr
INTO TABLE gt_userpos
FROM cdpos
FOR ALL ENTRIES IN gt_usermov
WHERE objectid = gt_usermov-objectid
AND objectclas = 'EINKBELEG'
AND changenr = gt_usermov-changenr
AND fname = 'EINDT' "need to fetch the changes made only to the delivery date field
AND chngind = 'U'.
IF sy-subrc = 0.
DELETE ADJACENT DUPLICATES FROM gt_userpos COMPARING ALL FIELDS.
ENDIF.
DESCRIBE TABLE gt_userpos LINES lv_usercount.
ENDIF.
it has impacted the performance little bit due to the size and type of CDHDR and CDPOS(cluster) tables. Any other better way you can think of.