Function Module MESSAGES GIVE, how to find error?

1k views Asked by At

I call the FM MESSAGES GIVE into Function Module MRM_SRM_INVOICE_SIMULATE, how do I find the point where the error is generated?

Thanks

2

There are 2 answers

0
rplantiko On

Extract the message ID MSGID and message number MSGNO from the list of messages as displayed.

Then try the following:

  1. Try to find the place where the message was triggered by static code analysis: In transaction SE91, navigate to the message given by MSGID and MSGNO, then perform a Where-Used-List for the single message. This will give you the code places where that message is issued. Put a breakpoint at each place and repeat the transaction that leads to the message. The system should stop at the point where the message is issued.
  2. Some developers issue their messages dynamically (with variables for MSGID and MSGNO), so that the points where they are issued cannot be found by static code analysis. This is bad, but there is another way to find it. The breakpoint at statement MESSAGE as described in the answer of @cape_bsas usually stops too often, but you can put a watchpoint on the field SY-MSGNO, instructing the debugger to stop as soon as SY-MSGNO assumes the given message number.
1
cape_bsas On

Further data is needed to give you appropriate help.

But have you already tried to add a breakpoint in the MESSAGE statement?

To do this:

  • Open debugger via /h + action

  • then in menu Breakpoints -> Breakpoint at -> Breakpoint at statement [Shift+F5] ABAP debugger: how to place Breakpoint at statement

  • in the pop-up window grid, write MESSAGE in the first line and then click Ok. ABAP debugger: Breakpoint at statement confirmation pop-up

  • after that, you need to replicate the error and the debugger will stop in EVERY MESSAGE statement reached in runtime.

Note: there may be many MESSAGE statements reached. Yo need to check one by one using F8 key.