05-14-2020 12:07 AM
Hi, I want to show a source code highlighted, something like transaction SCOV does to show coverage code.
The transaction uses class CL_SCOV_GUI_SOURCEEDIT_STMNT (inherit from CL_GUI_SOURCEEDIT) but this class is highly integrated with SCOV data.
So I want to use CL_GUI_SOURCEEDIT but I don't see any method to do this...debugging I found the method ( that it suppose to do that but inside it uses rare functions
METHOD lexer_send_color_info.
DATA: lt_data TYPE cvt_stmnt_cov_meta_data.
* Get highlighting info
lt_data = mo_stmnt_data_container->get_stmnt_cov_meta_data( ).
* Create dataprovider object
CALL FUNCTION 'DP_CREATE'
CHANGING
h_dp = m_h_dp.
CALL FUNCTION 'DP_SEND_TABLE'
EXPORTING
h_dp = m_h_dp
TABLES
data = lt_data.
* Get info in dataprovider object
call_method( method = 'SendLexerCommand'
p_count = 4
p1 = 1 "nCommand: SEND_COLOR_INFO
p2 = 0
p3 = 0
p4 = m_h_dp ).
* Destroy dataprovider object again
CALL FUNCTION 'DP_DESTROY'
CHANGING
h_dp = m_h_dp.
ENDMETHOD. "LEXER_SEND_COLOR_INFO
Does anyone nows how to accomplish this ??? I tried to do the same but without success
Thanks
05-14-2020 7:25 AM
Bravo! You have the code, why don't you do it yourself by creating your own subclass, and so you may create your own method with same code except the part concerning the code coverage.
05-15-2020 1:25 AM
I created my own subclass from CL_GUI_SOURCEEDIT but my problem it that I don't know how to color it and I can't use CL_SCOV_GUI_SOURCEEDIT_STMNT as my parent because the constructor already needs info related to SCOV transaction that I won't be using.
I tried to emulate only the "coloring" method of CL_SCOV_GUI_SOURCEEDIT_STMNT but without luck.I have no clue how DP_CREATE ...and DP_SEND_TABLE from what I can see is related to "Data Provider".
05-15-2020 2:36 AM
What I would do:
Or do you mean that the instance m_h_dp is complex to obtain? Or something else?
05-15-2020 5:46 AM
yeah it's what I have done. lt_data olds wich rows and col from to, that'ss the info that has to be highlighted.
I copy the extact same things.
Yeah the attribute m_h_dp it's assigned in that DP_CREATE and it hold very weird info
SCOV
My Class, it seams pretty similar.
Then it CALL FUNCTION 'DP_SEND_TABLE' is the same no error, but no highlight. I have no clue.