11-17-2009 7:54 AM
Hi experts,
I am having an issue on transactions ME21N and ME22N. When i save the PO, there is an output type that creates an IDOC, ORDERS05. I have extended the IDOC by adding a new segment. The problem is:
When a user creates a PO and saves it, the new segment is not populated and the IDOC falls in error. But when logs off and logs in again and saves the PO created again, the new segment is populated and the IDOC is succesfull.
When another user creates a new PO, the new segment is populated and the IDOC is succesfull.
Can you please help me on this?
Thanks,
Vitz.
11-17-2009 2:41 PM
Hi Vitz,
Do you mean to say that IDOC is successfully generated only when PO is changed ?
And not getting generated when PO is created ?
Or is the problem like some users are able to generate IDOC, where as others cannot ?
Can you explain problem clearly.
Regards,
Nisha Vengal.
11-20-2009 7:58 AM
Hi Nisha,
Thanks for your reply. Actually the problem is that some users are cannot create the IDOC. But when these users log off and logon again, they are able to create the IDOC.
Thanks,
Vitz.
11-23-2009 7:06 AM
Hi Vitz,
When a user creates a PO and saves it, the new segment is not populated and the IDOC falls in error. But when logs off and logs in again and saves the PO created again, the new segment is populated and the IDOC is succesfull.
Put a break-point at the place where you are populating the new segment.
See if control comes there, when a PO is created.
What I feel is, the code is executing only on PO change, and not on PO creation.
Regards,
Nisha Vengal.
11-27-2009 12:20 PM
Hi Nisha,
Thanks again for your reply. I have debugged all possibilities and the code should be executed for ME21N also. We have found a possible reason for that issue. It might be that sometimes SY-UCOMM is empty when the enhancement is reached. So what we have done is remove the check on transaction and rather check on the message type / extension.
Thanks,
Vitz.
11-30-2009 5:26 AM
Hi Vitz,
Your approach is right.
You can use message type / extension, to check if code should get executed or not.
You can even check with receiver partner number & partner type.
Regards,
Nisha Vengal.
11-30-2009 6:36 AM
Fine. But, I am surprise that, Why SY-UCOMM is blank, some times? it must get have some value(CREATE-H), right?pls. clarify
Thak you
11-30-2009 1:42 PM
Hi Raju,
If you check in debugging, sy-ucomm will have a value as soon as action is performed.
But after that, somewhere in standard code, sy-ucomm can get cleared.
We should not always be relying on sy-ucomm, while coding in enhancements.
Regards,
Nisha Vengal.
12-01-2009 4:55 AM
Thank you, actually, as of now, am in a impression that, we can stick to SY-UCOMM, in enhancements, so, now, I got clarified.