on 04-11-2006 4:40 PM
Hello,
Is there any way I can find out in ME21n if a PO is getting created or changed (something like UPDKZ in Sales order creation)? I basically want to execute some code only when PO creation.
Thanks
Ramesh
Hi Ramesh,
There are number of ways you can find if PO has been changed or not.
<u><b>Method-1).</b></u> You can check in ME22n. Once you create a PO using ME21N, go to ME22N to see the PO again
( ME22n doesn't always means that you are changing PO ).
In ME22n open PO
<u>a.</u> select menu option: <b>Environment --> Header Changes</b> to find header level change.
<u>b.</u> select menu option: <b>Environment --> Item Changes</b> to find iteam level change.
You have to select corresponding line and then select the given menu option for changes on that line.
<u><b>Method-2).</b></u> Check table entries CDHDR and CDPOS.
<u>a.</u> Go to Se11 --> Table name CDHDR
<b>OBJECTCLAS</b> = "EINKBELEG"
<b>OBJECTID</b> = "(PO Number)" and display records.
Neglect all records where CHANGE_IND field is 'I'. This is the record of when the PO is created. If there is any other
record when you neglect the one with 'I' indicator,then PO has been change.
For example, you have found two records.
<b>
OBJECTCLAS OBJECTID CHANGENR USERNAME UDATE UTIME TCODE PLANCHNGNR ACT_CHNGNO WAS_PLANND CHANGE_IND </b>
"EINKBELEG 4500000752 2252739 XCLAREP 03/30/2006 14:25:11 ME21N I"
"EINKBELEG 4500000752 2252740 XMICHEAL 03/30/2006 14:25:17 ME22N U"
Here the first record is for PO creation (CHANGE_IND = 'I' ). if you neglect it, you still have one more record with
CHANGE_IND = 'U', which indicates PO change.
Take the change docuement number (CHANGENR) from second record. Go to table CDPOS and display
record for the change document number you got from CDHDR and see what are the changes made to PO.
<u><b>Method-3).</b></u> Use <b>FM CHANGEDOCUMENT_READ_HEADERS</b> and <b>CHANGEDOCUMENT_READ_POSITIONS</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks every one for answering my question. Some of the answers are usefull.
Could anyone pls clarify, if there are any user exits in PO creation with has the flag which is called after the PO is saved in the database?
thanks
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please let us know why you want a user exit after the PO is committed to the database. Most of these values are available only during normal runtime and if you are looking at some user exits after PO is saved(which I doubt, if there are any), these values may not be there.
What is your requirement?
Hi,
UPDKZ = 'U' updated and UPDKZ = 'D' deleted.
Regards
vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramesh,
There is flag <b>I_AKTYP</b> which is used in ME21N/ME22N/ME23N to determine Create, Change, or Display activity.
Please check user exits <b>EXIT_SAPMM06E_016</b> for example.
Hope this will help.
Regards,
Ferry Lianto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
CHeck for sy-tcode.
If it is me21n then your are in create mode.
if it is me22n then you are in change mode.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.