Application Development and Automation 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: 
Read only

how to put a breakpoint at a particular text in program while debugging

former_member185116
Active Participant
0 Likes
9,938

hello all,

while debugging , suppose i want stop my debugger at a position where there is some text

like 'Please Check the LOC No' (which is coded is my program as if sy-subrc = 4.

message 'Please check the LOC No' type 'E'.

and there is no message number assigned for this error message..

how do i force stop my debugger at this particular point..

in my system there is no option break point at->message

thanks in advance..

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
6,098

The message number 001 of message class 00 is implicitly used to map the text. Try setting a watchpoint on "SY-MSGNO = '001' "

11 REPLIES 11
Read only

Sandra_Rossi
Active Contributor
6,099

The message number 001 of message class 00 is implicitly used to map the text. Try setting a watchpoint on "SY-MSGNO = '001' "

Read only

matt
Active Contributor
0 Likes
6,098

Ooo - I never knew that! 🙂

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
6,098

Hi Sandra,

per SAP documentation -

For compatibility reasons, this variant can still be used for classes that only implement the interface IF_MESSAGE. In this case, the interface methods GET_TEXT and GET_LONGTEXT are called automatically in the referenced object and their return value is used as the short text or long text of the message. In this case, the system fields sy-msgid and sy-msgno are not filled specifically.

What am i missing here? 😕

BR,

Suhas


Read only

0 Likes
6,098

hi sandra,

thanks for your solution, now i am able to force stop the debugger at any message text,

is this the only method or is there any other way by which we can force stop the debugger.

thanks and regards,

vinay..

Read only

Armin_Beil
Product and Topic Expert
Product and Topic Expert
6,098

The documentation you refer to is relevant for message statements that use object references (section "Alternative 4"). I think the original question was how to stop at message statements that use text literals.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
6,098

Gotcha... My bad!

Read only

Peter_Inotai
Active Contributor
6,098

Is "Breakpoint at statement" with statement MESSAGE not an option?

Read only

Armin_Beil
Product and Topic Expert
Product and Topic Expert
6,098

To stop at each and every message statement you can create a statement breakpoint as already mentioned by Peter. To do that: Start the debugger, press Shift-F5, enter 'message' and confirm.

If you want to stop only at message statements that use text literals and not if they use message classes (as described in your original question) then Sandras solution is great and I think you won't find a better one.

If you have even more complicated requirements, e.g. stop only if a special literal occurs, then a custom debugger script might be helpful but that would be much more effort. The script would have to fetch the current source line...

Read only

former_member185116
Active Participant
0 Likes
6,098

hi armin,

in my system there is no option for message,

i think i should go with sandras solution..

thanks and regards,

vinay.

Read only

6,098

You nearly made it. ABAP Cmnds is the right tab. <Enter 'message'> means enter the text 'message' as first row entry into that table that is visible on your screenshot.

But as mentioned that will stop at each and every message statement while Sandras solution is better if you only want to stop at those message statements that use literals.

Read only

former_member185116
Active Participant
0 Likes
6,098

Hi Armin Beil,

got your point,

thanks for your reply..

Note : unfortunately there is no Helpful Answer option in new platform, i hope the community designers would add this option in coming days..

thanks and regards,

vinay..