Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2812

Determine class name used for calling a static method ( CL_ABAP_GET_CALL_STACK )

$
0
0

Hello,

coming back to Re: Determine class name used for calling a static method . I've played a bit with a stack as I don't like not fully working solutions, but I'm stuck now and without a help of SAP people I can't go further I think. That's why I hope maybe Horst Keller or any other SAP employee may be able to help here.

 

Ok. So what's the point at the moment ? I have no problem with determining class name used for calling a static method as long there is only ONE call of this static method in a line, or even probably in one block ( means one syntax ended with .). The problem appears only when the method is used several times in a line or block.

 

But let's go to example, here is part of the program which calls 2 times creation of FALV "from" local class.

 

2016-04-02_20h54_12.png

Inside factory method CREATE I can check with CL_ABAP_COMPILER how many times the factory method is used and where exactly.

2016-04-02_20h55_02.png

 

2016-04-02_20h55_56.png

With CL_ABAP_PARSER I can get easily what class name was used to call CREATE method.

2016-04-02_20h57_18.png2016-04-02_20h57_59.png

 

But the problem is still that in my example from STACK I will get info 2 times that method was called from 46th line.

 

I found that CL_ABAP_GET_CALL_STACK=>GET_CALL_STACK method, returns unformated STACK info, where if you look on the 3rd line into field PROGRAM_INFO, then you'll notice that the numbers in last \*\ are different for the calls at different column of the 46th line. The problem is that I cannot figure out how they are calculated and I cannot find the way to exchange this info into line & COLUMN number.

2016-04-02_20h54_44.png

1st Call at 46th line

2016-04-02_20h58_18.png

2nd Call at 46th line

2016-04-02_20h59_56.png

 

Can anyone help?

 

Cheers

Łukasz


Viewing all articles
Browse latest Browse all 2812

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>