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

Getting through a FM while debugging

Former Member
0 Likes
1,601

Hi Folks,

I am trying to debug a FM and set the bP @the FM. It fails to reach the FM and goes beyond the fM.

This FM is subset of another FM within the program......

Since , I don't know the FM or spot just above the this FM I am unable set the BP for the same.

Kindly suggest me how to debug If I know the FM and I want to do it during the execution of transaction.

Thanks

M Kaushik

8 REPLIES 8
Read only

Former Member
0 Likes
1,456

Can you say which FM and in which transaction you want to debug it ?

Looks like the FM is called in UPDATE task in which you indeed won't see the debugger pop up at your breakpoint.

There is a way to debug, but first we need to be sure whether is in fact is called in UPDATE task. So, give more details so we can give also more details.

Read only

0 Likes
1,456

This is in SCM ie while operating in ECC the module is called... How would you find whether it is done using update task......

thanx

Read only

0 Likes
1,456

Hmm, you still didn't mention which FM

Anyways, to find out whether it's in update task or not, you will have to go to transaction SE37, fill in your FM and do a where-used search. In the result list, double click the line to go to the source of the call and there you can see whether the FM is called in update task or not.

But if there is no statement 'IN UPDATE TASK', that doesn't mean the FM is not called in update task. Because maybe the FM that is calling your FM, is called in update task. So again, for all the places where your FM is called, you should check the calling FM and see whether that is in update task or not. And so on, and so on. So it can be a very tedious job...

But as Vindy_he already mentioned, are you sure that the FM is called ? How do you know if it is ?

Read only

Former Member
0 Likes
1,456

Hi;

Are you sure that the FM mentioned is called during the execution?

if yes, it may be called in update task or RFC.

Try to turn on all debug modes.System , update and TRFC etc..

Sometimes, it will create separate session for updating or RFC processing in background.

If your FM is only triggered in those new sessions, it is of no use even you run one round the currect session.

Regards

Vindy

Read only

Former Member
0 Likes
1,456

Hi,

Just a quick try.

Just put /h (system debug) and execute your program. In the debug (use classic debugger) and check on calls tab (next to watch points tab) and you can see all the calling programs.

Just cross check whether your program is there or not.

Regards,

Selva K.

Read only

0 Likes
1,456

Hi,

I have tried all your suggestions but cudn't make it. Meanwhile please clear my doubt...When I know a FM Can't I reach by debugging or just above that Is there any structured way to do it?

Or you can reach only by trial and error.

Thanx

Kaushik

Read only

0 Likes
1,456

Well, normally you would just put a breakpoint at the first line of your FM.

If SAP doesn't stop at your breakpoint, but you are sure it has gone through it (because some updated/created stuff that only happens there or whatever), then you can almost conclude that your FM is called in UPDATE TASK.

To find this out, you should start doing where-used's, starting from your FM and work your way up to the FM that is called in UPDATE TASK.

Once you know this, you can set the option "Update Debugging" (once you are in debug). When the transaction is over, the debugger will open a new window and will start to process all the FM's that were called in UPDATE TASK. Then you just have to find the one you need and start debugging from there. Note that if you would put breakpoints here, they are not saved for later on.

Hope this helps.

Read only

_IvanFemia_
Active Contributor
0 Likes
1,456

Hi,

in some Z-FM i used to put this code.


DATA lv_check TYPE c.
DO.
IF lv_check EQ abap_true.
EXIT.
ENDIF.
ENDDO.

From SM50 you will see your code hanging the DO-ENDDO statement, get into debug from SM50 and set lv_check variable to 'X' and you get into the debug of your FM.

Regards,

Ivan