"-Begin-----------------------------------------------------------------
Program Z_CLASSVIEWER.
"-Begin Class-------------------------------------------------------
Class Z_CL_VIEWER Definition Inheriting From CL_GUI_CONTROL
Final Create Public.
Public Section.
Type-Pools CNTL.
Methods Constructor Importing Parent Type
Ref To CL_GUI_CONTAINER.
Methods Dispatch Redefinition.
Methods SetDataSource Importing ClassName Type String.
EndClass.
Class Z_CL_VIEWER Implementation.
Method Constructor.
Call Method Super->constructor
Exporting
CLSID = 'SAPGUI.TextEditCtrl'
PARENT = Parent
LIFETIME = 2
Exceptions
Others = 1.
EndMethod.
Method Dispatch.
Call Method CL_GUI_CFW=>Flush.
EndMethod.
Method SetDataSource.
"-Variables---------------------------------------------------
Data l_Tab_RepObj Type Standard Table Of TADIR.
Data l_Str_RepObj Type TADIR.
Data l_Pattern Type String Value ''.
Data l_Tab_RepSrc Type Standard Table Of REPOSRC.
Data l_Str_RepSrc Type REPOSRC.
Data l_Tab_Rep Type Standard Table Of String.
Data l_Str_Rep Type String Value ''.
Data l_Str_Source Type String Value ''.
Data l_LineCount Type i Value 0.
"-Main--------------------------------------------------------
Select * From TADIR Into Table l_Tab_RepObj
Where OBJ_NAME = ClassName And OBJECT = 'CLAS'.
If sy-subrc = 0.
Loop At l_Tab_RepObj Into l_Str_RepObj.
Concatenate l_Str_RepObj-OBJ_NAME '%' Into l_Pattern.
Select * From REPOSRC Into Table l_Tab_RepSrc
Where PROGNAME Like l_Pattern And R3STATE = 'A'.
If sy-subrc = 0.
Loop At l_Tab_RepSrc Into l_Str_RepSrc.
Read Report l_Str_RepSrc-PROGNAME Into l_Tab_Rep.
If sy-subrc = 0.
Concatenate l_Str_Source cl_abap_char_utilities=>cr_lf
'">>>' l_Str_RepSrc-PROGNAME '<<cr_lf Into l_Str_Source.
Loop At l_Tab_Rep Into l_Str_Rep.
Concatenate l_Str_Source l_Str_Rep
cl_abap_char_utilities=>cr_lf Into l_Str_Source.
EndLoop.
EndIf.
EndLoop.
EndIf.
EndLoop.
EndIf.
Call Method Set_Property
Exporting
PROPERTY = 'Text'
VALUE = l_Str_Source.
Call Method Set_Property
Exporting
PROPERTY = 'UseFixedFont'
VALUE = 1.
Call Method CL_GUI_CFW=>FLUSH.
EndMethod.
EndClass.
"-End Class---------------------------------------------------------
"-Variables---------------------------------------------------------
Data Ref_Dock Type Ref To CL_GUI_DOCKING_CONTAINER.
Data Ref_Viewer Type Ref To Z_CL_VIEWER.
Data NameOfClass Type String.
"-GUI---------------------------------------------------------------
Selection-Screen Begin Of Block Viewer.
Parameters clName(40).
Selection-Screen End Of Block Viewer.
"-Initialization----------------------------------------------------
Initialization.
clName = 'CL_BSP_FLIGHT_DEMO'.
"-Main--------------------------------------------------------------
At Selection-Screen.
NameOfClass = clName.
If Ref_Dock Is Initial.
Create Object Ref_Dock
Exporting
REPID = sy-repid
DYNNR = sy-dynnr
SIDE = CL_GUI_DOCKING_CONTAINER=>dock_at_bottom
RATIO = 85
Exceptions
Others = 1.
Create Object Ref_Viewer
Exporting
PARENT = Ref_Dock
Exceptions
Others = 1.
EndIf.
Call Method Ref_Viewer->setdatasource
Exporting
ClassName = NameOfClass.
Call Screen 1000.
"-End-------------------------------------------------------------------
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |