2

I've watched quite a few videos on YouTube and have a basic understanding of how to find user-exits (enhancements?) and implement them. However when I try to replicate what I've seen it doesn't appear to be working.

I'm looking to create a user-exit that would execute when a production order has been confirmed (closed/finished) via CO11N. Someone suggested that I put in a line of code "BREAK username." So that I could verify that my code was firing. Nothing breaks. I've tried putting in a message from code found on the internet

MESSAGE s208(00) WITH 'TEST'.

No message is shown. I've activated the include and the project. I've tried different exits/includes and no matter what I do, nothing seems to break or show a message.

Is there something simple I'm missing? I've tried CONFPI05 and CONFPM05.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
DragonYen
  • 958
  • 9
  • 22
  • If you have put the BREAK, then you should have noticed if it fired. It looks like you need to find another user-exit. – Christian Tapia Sep 25 '15 at 20:22
  • Thanks for the response Christian. I've additionally tried CONFPP05 now (which we already have a user exit on) and that still isn't breaking for me. Do I need to be in debug mode for the break to happen? I switched it on with /h -- but again, it didn't break. – DragonYen Sep 25 '15 at 20:38
  • You just need to put a break-point, no need to be in debug mode. Or, if you want to be 100% sure, you can try a break point with code: `BREAK-POINT.` (don't forget to delete it after your tests). – Christian Tapia Sep 25 '15 at 20:42
  • Did you use enhancements or used a user-exit? Did you activate your code? Did you check the system log (SM21)? Is your change in a update task? Instead of break-points you could try logpoints (activate it with transaction SAAB). – knut Sep 25 '15 at 20:50
  • @knut CMOD to create a project. Assigned an enhancement (CONFPI05 for example). Then create the code in SE38 (matching the "include" name from the above item). Activated both the project and the code. I'm not seeing anything in SM21. I'll do some research on SAAB. – DragonYen Sep 25 '15 at 20:58
  • @DragonYen Can you post some pictures of the screen of CMOD and the code? – Nelson Miranda Sep 25 '15 at 21:16

2 Answers2

2

CONFPI05 is for process orders. CONFPM05 is for plant maintenance orders. First you need to check which kind of order you use. I assume you use production orders. You should check User-Exit CONFPP05 than.

Anyway, I would recommend using BAdI WORKORDER_CONFIRM. Within this BAdI there are methods available where you can raise an error message.

From the BAdI documentation:

Note that in the methods, no system messages may be sent. The only exceptions are the AT_SAVE and AT_CANCEL_CHECK methods. Within these methods, a system message may be issued, but only if you trigger the exception ERROR_WITH_MESSAGE (for AT_SAVE method) or NOT_ALLOWED (for AT_CANCEL_CHECK method) at the same time.

Note also that within the methods, the "commit work" instruction may not be carried out because this would lead to incorrect data in the database.

I strongly recommend not to use MESSAGE statement in any User-Exit or BAdI implementation. The MESSAGE statement will implicit call a COMMIT WORK which could cause database inconsistencies (happens very often by the way).

One additional note. You should check using Checkpoint Groups instead of using BREAK-POINT or BREAK username directly.

Tapio Reisinger
  • 196
  • 1
  • 8
1

I checked the documentation:

CONFPI05 to update your own data after saving the confirmation

In another documentation I found another warning:

In this customer enhancement it is strictly forbidden to send error messages or other messages because otherwise there is the danger that data will be inconsistent. SAP cannot be held responsible for this!!

This sounds like changes in update task. By default breakpoints in update task are not enabled.

Should your code be processed after you pushed save?

If yes, what you can try:

  • Set anywhere a breakpoint. Or try /h during data insertion.
  • In debug screen activate the update debugging: enter image description here
  • Continue the process with F8.
  • Hopefully you stop at your break-point.
knut
  • 27,320
  • 6
  • 84
  • 112