BUFFER TYPE RSWSOURCET
CANCELLED Cancelled by user
CLSNAME Types SEOCLSNAME
CMPNAME Types SEOCMPNAME
CMPTYPE Types SEOCMPTYPE
MTDTYPE Types SEOMTDTYPE
MTDDECLTYP Types SEOMTDDECL
ATTDECLTYP Types SEOATTDECL
EXPOSE Types SEOEXPOSE
STATE Types SEOSTATE
ATTVALUE Types SEOVALUE
Then repeat this process for the Output structure with the following description and fields.
CLSNAME Types SEOCLSNAME
CMPNAME Types SEOCMPNAME
CMPTYPE Types VAL_TEXT
MTDTYPE Types VAL_TEXT
ATTDECLTYP Types VAL_TEXT
EXPOSE Types VAL_TEXT
STATE Types VAL_TEXT
ATTVALUE Types SEOVALUE
COLOUR Types LVC_T_SCOL
Again, make it local then do the same for the output structure.
NONE Static Attribute Public Type I 0
BLUE Static Attribute Public Type I 1
GREY Static Attribute Public Type I 2
YELLOW Static Attribute Public Type I 3
DARKBLUE Static Attribute Public Type I 4
GREEN Static Attribute Public Type I 5
RED Static Attribute Public Type I 6
ORANGE Static Attribute Public Type I 7
GET_DATA Static Public
PROCESS Static Public
OUTPUT Static Public
FORMAT_CALL Static Public
SET_COLUMN_PROPERTIES Static Private
SET_HEADER Static Private
HANDLE_DOUBLE_CLICK Static Private
Get the possible objects
Prepare the selection for display
Display the list
Format the method to return to the ABAP editor
Set up column properties
Set column headers
IV_CLS Importing Type VSEOCOMPDF-CLSNAME Object Type Name
IV_CMP Importing Type VSEOCOMPDF-CMPNAME Component name
IV_MTH Importing Type FLAG Component type Method
IV_DAT Importing Type FLAG Component type Data
IV_EVT Importing Type FLAG Component type Event
ET_INPUT Exporting Type ZCAT_FIND_OBJECT_INPUT Input format for function Z_FIND_OBJECT_EDITOR_EXIT
method get_data.
data:
lv_typ type vseocompdf-cmptype,
lv_cls type vseocompdf-clsname,
lv_cmp type vseocompdf-cmpname.
clear at_output.
if iv_cls is initial.
move '%' to lv_cls.
else.
move iv_cls to lv_cls.
translate lv_cls using '*%'.
endif.
if iv_cmp is initial.
move '%' to lv_cmp.
else.
move iv_cmp to lv_cmp.
translate lv_cmp using '*%'.
endif.
case abap_true.
when iv_mth.
move 1 to lv_typ.
when iv_dat.
move 0 to lv_typ.
when iv_evt.
move 2 to lv_typ.
endcase.
select clsname, cmpname, cmptype, mtdtype, mtddecltyp,
attdecltyp, exposure, state, attvalue
from vseocompdf
where clsname like @lv_cls
and cmpname like @lv_cmp
and cmptype eq @lv_typ
and exposure eq 2
and state ne 2
into table @et_input.
endmethod.
IT_INPUT Importing Type ZCAT_FIND_OBJECT_INPUT Input format for function Z_FIND_OBJECT_EDITOR_EXIT
method process.
field-symbols:
<ls_input> type zcas_find_object_input,
<ls_output> type zcas_find_object_output,
<ls_colour> type lvc_s_scol.
loop at it_input assigning <ls_input>.
append initial line to at_output assigning <ls_output>.
move: <ls_input>-clsname to <ls_output>-clsname,
<ls_input>-cmpname to <ls_output>-cmpname,
<ls_input>-attvalue to <ls_output>-attvalue,
<ls_input>-state to <ls_output>-state.
if <ls_input>-cmptype eq 1.
move <ls_input>-mtddecltyp to <ls_output>-attdecltyp.
endif.
if <ls_input>-state eq '2'.
move 'Obsolete'(d13) to <ls_output>-state.
else.
clear <ls_output>-state.
endif.
case <ls_input>-cmptype.
when 0.
move 'Data'(d01) to <ls_output>-cmptype.
append initial line to <ls_output>-colour assigning <ls_colour>.
move: 'CMPTYPE' to <ls_colour>-fname,
zcl_colour=>yellow to <ls_colour>-color-col.
when 1.
move 'Method'(d02) to <ls_output>-cmptype.
append initial line to <ls_output>-colour assigning <ls_colour>.
move: 'CMPTYPE' to <ls_colour>-fname,
zcl_colour=>green to <ls_colour>-color-col.
when 2.
move 'Event'(d03) to <ls_output>-cmptype.
append initial line to <ls_output>-colour assigning <ls_colour>.
move: 'CMPTYPE' to <ls_colour>-fname,
zcl_colour=>orange to <ls_colour>-color-col.
when 3.
move 'Type'(d04) to <ls_output>-cmptype.
append initial line to <ls_output>-colour assigning <ls_colour>.
move: 'CMPTYPE' to <ls_colour>-fname,
zcl_colour=>blue to <ls_colour>-color-col.
endcase.
if <ls_input>-cmptype eq 1.
case <ls_input>-mtdtype.
when 0.
move 'Method'(d02) to <ls_output>-mtdtype.
append initial line to <ls_output>-colour assigning <ls_colour>.
move: 'MTDTYPE' to <ls_colour>-fname,
zcl_colour=>green to <ls_colour>-color-col.
when 1.
move 'Handler'(d07) to <ls_output>-mtdtype.
append initial line to <ls_output>-colour assigning <ls_colour>.
move: 'MTDTYPE' to <ls_colour>-fname,
zcl_colour=>blue to <ls_colour>-color-col.
when 2.
move 'Constructor'(d08) to <ls_output>-mtdtype.
append initial line to <ls_output>-colour assigning <ls_colour>.
move: 'MTDTYPE' to <ls_colour>-fname,
zcl_colour=>orange to <ls_colour>-color-col.
when 3.
move 'Destructor'(d09) to <ls_output>-mtdtype.
append initial line to <ls_output>-colour assigning <ls_colour>.
move: 'MTDTYPE' to <ls_colour>-fname,
zcl_colour=>red to <ls_colour>-color-col.
endcase.
endif.
case <ls_input>-attdecltyp.
when 0.
move 'Instance'(d14) to <ls_output>-attdecltyp.
append initial line to <ls_output>-colour assigning <ls_colour>.
move: 'ATTDECLTYP' to <ls_colour>-fname,
zcl_colour=>green to <ls_colour>-color-col.
when 1.
move 'Static'(d15) to <ls_output>-attdecltyp.
append initial line to <ls_output>-colour assigning <ls_colour>.
move: 'ATTDECLTYP' to <ls_colour>-fname,
zcl_colour=>yellow to <ls_colour>-color-col.
when 2.
move 'Constant'(d16) to <ls_output>-attdecltyp.
append initial line to <ls_output>-colour assigning <ls_colour>.
move: 'ATTDECLTYP' to <ls_colour>-fname,
zcl_colour=>blue to <ls_colour>-color-col.
endcase.
case <ls_input>-expose.
when 0.
move 'Private'(d10) to <ls_output>-expose.
append initial line to <ls_output>-colour assigning <ls_colour>.
move: 'EXPOSURE' to <ls_colour>-fname,
zcl_colour=>red to <ls_colour>-color-col.
when 1.
move 'Protected'(d11) to <ls_output>-expose.
append initial line to <ls_output>-colour assigning <ls_colour>.
move: 'EXPOSURE' to <ls_colour>-fname,
zcl_colour=>yellow to <ls_colour>-color-col.
when 2.
move 'Public'(d12) to <ls_output>-expose.
append initial line to <ls_output>-colour assigning <ls_colour>.
move: 'EXPOSURE' to <ls_colour>-fname,
zcl_colour=>green to <ls_colour>-color-col.
endcase.
endloop.
endmethod.
method output.
data:
lo_functions type ref to cl_salv_functions_list,
lo_events type ref to cl_salv_events_table,
lo_columns type ref to cl_salv_columns_table,
lo_display type ref to cl_salv_display_settings,
lo_ref type ref to cx_root,
lo_layout type ref to cl_salv_layout,
ls_layout_key type salv_s_layout_key,
lv_text type text132.
try.
cl_salv_table=>factory(
importing
r_salv_table = ao_alv
changing
t_table = at_output ).
catch cx_salv_msg into lo_ref.
lv_text = lo_ref->get_longtext( ).
message e020(0D) with lv_text.
endtry.
lo_functions = ao_alv->get_functions( ).
lo_functions->set_all( abap_true ).
lo_events = ao_alv->get_event( ).
lo_layout = ao_alv->get_layout( ).
move sy-cprog to ls_layout_key-report.
lo_layout->set_key( ls_layout_key ).
lo_layout->set_default( abap_true ).
lo_layout->set_save_restriction( co_allow_none ).
lo_columns = ao_alv->get_columns( ).
lo_columns->set_key_fixation( abap_true ).
lo_columns->set_optimize( ).
set_column_properties( changing co_columns = lo_columns ).
lo_display = ao_alv->get_display_settings( ).
lo_display->set_striped_pattern( abap_true ).
try.
lo_columns->set_color_column( 'COLOUR' ).
catch cx_salv_data_error into lo_ref.
lv_text = lo_ref->get_longtext( ).
message e020(0D) with lv_text.
endtry.
set handler handle_double_click for lo_events.
ao_alv->set_screen_popup(
start_column = 5
end_column = 110
start_line = 5
end_line = 26 ).
ao_alv->display( ).
endmethod.
IV_CLSNAME Importing Type SEOCLSNAME Object Type Name
IV_CMPNAME Importing Type SEOCMPNAME Component name
IV_CMPTYPE Importing Type VAL_TEXT Short Text for Fixed Values
RT_BUFFER Returning Type RSWSOURCET ABAP Source
method format_call.
data:
lt_parameters_int type cl_sedi_shared=>tt_parameters,
lt_parameters type seos_parameters_r,
lt_buffer type swbse_max_line_tab,
ls_mtdkey type seocpdkey,
lt_pattern type swbse_max_line_tab,
ls_cmpkey type seocmpkey,
lv_instance type seoclsname.
field-symbols:
<ls_parameter> type seos_parameter_r,
<ls_parameter_i> type cl_sedi_shared=>ts_parameter.
move: iv_clsname to ls_mtdkey-clsname,
iv_cmpname to ls_mtdkey-cpdname.
call function 'SEOM_CALL_METHOD_PATTERN_NEW'
exporting
mtdkey = ls_mtdkey
instance = lv_instance
tables
patternsource = lt_buffer
exceptions
others = 0.
move: iv_clsname to ls_cmpkey-clsname,
iv_cmpname to ls_cmpkey-cmpname.
call function 'SEO_METHOD_SIGNATURE_GET'
exporting
mtdkey = ls_cmpkey
importing
parameters = lt_parameters
exceptions
others = 1.
if sy-subrc = 0.
loop at lt_parameters assigning <ls_parameter>.
append initial line to lt_parameters_int
assigning <ls_parameter_i>.
move: <ls_parameter>-sconame to <ls_parameter_i>-name,
<ls_parameter>-typtype to <ls_parameter_i>-type,
<ls_parameter>-type to <ls_parameter_i>-obj.
endloop.
cl_sedi_shared=>parameters_to_pattern(
exporting
i_parameters = lt_parameters_int
importing
e_pattern = lt_pattern ).
append lines of: lt_pattern to rt_buffer,
lt_buffer to rt_buffer.
endif.
endmethod.
CO_COLUMNS Changing Type Ref To CL_SALV_COLUMNS_TABLE Columns in Simple, Two-Dimensional Tables
method set_column_properties.
data:
lo_column type ref to cl_salv_column,
lo_ref type ref to cx_root,
lt_fieldcat type salv_t_column_ref,
lv_text type text132.
field-symbols:
<ls_fieldcat> type salv_s_column_ref.
lt_fieldcat = co_columns->get( ).
loop at lt_fieldcat assigning <ls_fieldcat>.
try.
lo_column = co_columns->get_column( <ls_fieldcat>-columnname ).
catch cx_salv_not_found into lo_ref.
lv_text = lo_ref->get_longtext( ).
message e020(0D) with lv_text.
endtry.
case <ls_fieldcat>-columnname.
when 'CLSNAME'.
set_header(
exporting
iv_header = 'Class'(h00)
changing
co_column = lo_column ).
when 'CMPNAME'.
set_header(
exporting
iv_header = 'Attribute'(h05)
changing
co_column = lo_column ).
when 'CMPTYPE'.
set_header(
exporting
iv_header = 'Attrib typ'(h01)
changing
co_column = lo_column ).
when 'MTDTYPE'.
set_header(
exporting
iv_header = 'Method Type'(h02)
changing
co_column = lo_column ).
when 'EXPOSE'.
set_header(
exporting
iv_header = 'Scope'(h03)
changing
co_column = lo_column ).
when 'ATTVALUE'.
set_header(
exporting
iv_header = 'Value'(h04)
changing
co_column = lo_column ).
when 'ATTDECLTYP'.
set_header(
exporting
iv_header = 'Declaration'(h07)
changing
co_column = lo_column ).
when 'STATE'.
set_header(
exporting
iv_header = 'State'(h06)
changing
co_column = lo_column ).
when others.
endcase.
endloop.
endmethod.
IV_HEADER Importing Type TEXT40 Text, 40 Characters Long
CO_COLUMN Changing Type Ref To CL_SALV_COLUMN Individual Column Object
method set_header.
data:
lv_s_header type text10,
lv_m_header type text20,
lv_l_header type text40.
move iv_header to: lv_s_header,
lv_m_header,
lv_l_header.
co_column->set_short_text( lv_s_header ).
co_column->set_medium_text( lv_m_header ).
co_column->set_long_text( lv_l_header ).
endmethod.
ROW
COLUMN
method handle_double_click.
data:
lt_sconame type standard table of seosconame,
lv_refclsname type seoclsname,
lv_buffer type string.
field-symbols:
<ls_output> type zcas_find_object_output,
<lv_sconame> type seosconame.
read table at_output assigning <ls_output> index row.
if sy-subrc ne 0.
return.
endif.
case <ls_output>-cmptype.
when 'Method'.
at_buffer = zcl_find_object=>format_call(
iv_clsname = <ls_output>-clsname
iv_cmpname = <ls_output>-cmpname
iv_cmptype = <ls_output>-cmptype ).
when 'Data'.
if <ls_output>-attdecltyp = 'Instance'.
concatenate 'ME->' <ls_output>-cmpname
into lv_buffer.
else.
concatenate <ls_output>-clsname
<ls_output>-cmpname
into lv_buffer separated by '=>'.
endif.
append lv_buffer to at_buffer.
when 'Event'.
concatenate 'on_' <ls_output>-cmpname
into lv_buffer.
append lv_buffer to at_buffer.
concatenate '~~for event~'
<ls_output>-cmpname
'~of~'
<ls_output>-clsname
into lv_buffer.
translate lv_buffer using '~ '.
append lv_buffer to at_buffer.
select single refclsname
into lv_refclsname
from vseoevent
where clsname eq <ls_output>-clsname
and cmpname eq <ls_output>-cmpname.
if lv_refclsname is initial.
move <ls_output>-clsname to lv_refclsname.
endif.
select sconame
into table lt_sconame
from vseoeparam
where clsname eq lv_refclsname
and cmpname eq <ls_output>-cmpname
and langu eq sy-langu
order by editorder.
if lt_sconame is not initial.
append ' importing' to at_buffer.
endif.
loop at lt_sconame assigning <lv_sconame>.
shift <lv_sconame> right by 4 places.
append <lv_sconame> to at_buffer.
endloop.
endcase.
leave to screen 0.
endmethod.
AT_BUFFER Static Attribute Public Type RSWSOURCET ABAP Source
CO_ALLOW_NONE Static Attribute Private Type I ALV Layout authority
AO_ALV Static Attribute Private Type Ref To CL_SALV_TABLE Basis Class for Simple Tables
AT_OUTPUT Static Attribute Private Type ZCAT_FIND_OBJECT_OUTPUT Table of output structure for Find Objects
BUFFER TYPE RSWSOURCET
CANCELLED Cancelled by user
function z_find_object_editor_exit .
*"----------------------------------------------------------------------
*"*"Local Interface:
*" TABLES
*" BUFFER TYPE RSWSOURCET
*" EXCEPTIONS
*" CANCELLED
*"----------------------------------------------------------------------
clear: gf_cancelled, zcl_find_object=>at_buffer.
call screen 9000 starting at 10 5
ending at 60 8.
if gf_cancelled eq abap_true
or zcl_find_object=>at_buffer is initial.
raise cancelled.
else.
move zcl_find_object=>at_buffer to buffer[].
endif.
endfunction.
*&---------------------------------------------------------------------*
*& Module STATUS_9000 OUTPUT
*&---------------------------------------------------------------------*
* Set up the option screen
*----------------------------------------------------------------------*
module status_9000 output.
set pf-status 'STAT_9000'.
endmodule.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
* Process the user command
*----------------------------------------------------------------------*
module user_command_9000 input.
case sy-ucomm.
when 'OK'.
zcl_find_object=>get_data(
exporting
iv_cls = gs_input-clsname
iv_cmp = gs_input-cmpname
iv_mth = gv_cmptypem
iv_dat = gv_cmptyped
iv_evt = gv_cmptypee
importing
et_input = gt_input ).
zcl_find_object=>process(
exporting
it_input = gt_input ).
zcl_find_object=>output( ).
leave to screen 0.
when 'BACK'
or 'CANC'
or 'EXIT'.
move abap_true to gf_cancelled.
leave to screen 0.
endcase.
endmodule.
function-pool zabapeditor. "MESSAGE-ID ..
data:
gt_input type zcat_find_object_input,
gs_input type zcas_find_object_input,
gf_cancelled type flag.
GS_INPUT-CLSNAME
GS_INPUT-CLSNAME
GS_INPUT-CMPNAME
GS_INPUT-CMPNAME
GV_CMPTYPEM
GV_CMPTYPEM
GV_CMPTYPED
GV_CMPTYPED
GV_CMPTYPEE
GV_CMPTYPEE
process before output.
module status_9000.
process after input.
module user_command_9000.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |