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: 

Issue on output message in ME21N and ME22N

former_member239066
Participant
0 Kudos

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.

8 REPLIES 8

Former Member
0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

0 Kudos

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

0 Kudos

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.

0 Kudos

Thank you, actually, as of now, am in a impression that, we can stick to SY-UCOMM, in enhancements, so, now, I got clarified.