Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

zz_ucounter(Counter - delivery date changes by users) from ekpo table is not updating even though i change the delivery date

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

4 REPLIES 4

Former Member
0 Kudos

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

former_member193464
Contributor
0 Kudos

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.

rosenberg_eitan
Active Contributor
0 Kudos

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).

Former Member
0 Kudos

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.