Professional Documents
Culture Documents
cdat
like trdir-cdat,
myfield(1) type c,
end of i_data.
*-------------------------------* Global Variables
*-------------------------------data:
w_variant
like disvariant,
wx_variant
like disvariant,
w_variant_save(1) type c,
w_exit(1)
type c,
w_repid
like sy-repid,
w_user_specific(1) type c,
w_callback_ucomm
type slis_formname,
w_print
type slis_print_alv,
w_layout
type slis_layout_alv,
w_html_top_of_page type slis_formname,
w_fieldcat_alv
like line of i_fieldcat_alv,
w_excluding
like line of i_excluding,
w_events
like line of i_events,
w_event_exit
like line of i_event_exit,
w_list_comments
like line of i_list_comments.
*-------------------------------* Global Constants
*-------------------------------*constants:
*-------------------------------* Selection Screen
*-------------------------------selection-screen begin of block blk_criteria with frame title text-f01.
select-options:
s_name for trdir-name.
selection-screen end of block blk_criteria.
selection-screen begin of block blk_params with frame title text-f02.
parameters:
p_vari like disvariant-variant.
selection-screen skip 1.
parameters:
p_grid radiobutton group rb01 default 'X',
p_html as checkbox.
selection-screen skip 1.
parameters:
p_list radiobutton group rb01.
selection-screen end of block blk_params.
*-------------------------------* Initialization
*-------------------------------initialization.
perform init_variant.
perform variant_default using p_vari.
clear: s_name[].
s_name-sign
= 'I'.
s_name-option = 'CP'.
s_name-low
= 'Z*'.
append s_name.
*-------------------------------* At Selection Screen PBO
*-------------------------------at selection-screen output.
*---------------------------------* At Selection Screen Value Request
*---------------------------------at selection-screen on value-request for p_vari.
perform variant_f4 using p_vari.
*-------------------------------* At Selection Screen
*-------------------------------at selection-screen.
perform variant_fill.
*-------------------------------* Start of Selection
*-------------------------------start-of-selection.
perform get_data.
end-of-selection.
perform fieldcat_build.
perform event_build.
perform event_exit_build.
perform exclude_build.
perform print_build.
perform layout_build.
perform display_data.
*-------------------------------* Top of Page
*-------------------------------top-of-page.
*-------------------------------* Top of Page During Line Sel
*-------------------------------top-of-page during line-selection.
*-------------------------------* At User Command
*-------------------------------at user-command.
*-------------------------------* At Line Selection
*-------------------------------at line-selection.
*-------------------------------* Macros
*-------------------------------define skip_1.
write: /001 sy-vline,
at sy-linsz sy-vline.
end-of-definition.
*---------------------------------------------------------------------*
Forms
*---------------------------------------------------------------------*&---------------------------------------------------------------------*
*&
Form variant_f4
*&---------------------------------------------------------------------*
form variant_f4 using p_variant.
call function 'LVC_VARIANT_F4'
exporting
is_variant
= w_variant
i_save
= w_variant_save
importing
e_exit
= w_exit
es_variant
= wx_variant
exceptions
not_found
= 1
program_error = 2
others
= 3.
if sy-subrc <> 0.
message i000(zz) with text-g01.
endif.
if w_exit is initial.
w_variant-variant = wx_variant-variant.
p_variant
= wx_variant-variant.
endif.
endform.
*&---------------------------------------------------------------------*
*&
Form init_variant
*&---------------------------------------------------------------------*
form init_variant.
clear: w_variant.
w_repid
w_variant-report
w_variant-username
w_variant_save
=
=
=
=
sy-repid.
w_repid.
sy-uname.
'A'. "All types
endform.
*&---------------------------------------------------------------------*
*&
Form variant_default
*&---------------------------------------------------------------------*
form variant_default using p_variant.
wx_variant = w_variant.
exporting
i_program_name
i_structure_name
i_internal_tabname
i_inclname
changing
ct_fieldcat
=
=
=
=
w_repid
'TRDIR'
'I_DATA'
w_repid
= i_fieldcat_alv.
= 'CALLBACK_UCOMM'.
case 'X'.
when p_grid.
if p_html = 'X'.
w_html_top_of_page = 'HTML_TOP_OF_PAGE'.
endif.
*
*
*
*
'SIWB_WALLPAPER'
'SIWB_WALLPAPER'
w_repid
w_html_top_of_page
'TRDIR'
'X'
'A'
w_variant
w_layout
w_callback_ucomm
i_fieldcat_alv
i_events
i_event_exit
i_excluding
w_print
1
1
70
30
tables
t_outtab
= i_data.
when p_list.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_background_id
= 'ALV_BACKGROUND'
i_callback_program
= w_repid
i_default
= 'X'
i_save
= 'A'
is_variant
= w_variant
is_layout
= w_layout
i_callback_user_command = w_callback_ucomm
it_fieldcat
= i_fieldcat_alv
it_events
= i_events
it_event_exit
= i_event_exit
is_print
= w_print
tables
t_outtab
= i_data.
endcase.
endform.
*---------------------------------------------------------------------*
*
FORM user_command
*
*---------------------------------------------------------------------*
form callback_ucomm using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
message i000(zz) with r_ucomm.
case r_ucomm.
when '&IC1'.
set parameter id 'RID' field rs_selfield-value.
call transaction 'SE38'.
when others.
endcase.
endform.
*&---------------------------------------------------------------------*
*&
Form get_data
*&---------------------------------------------------------------------*
form get_data.
select * up to 15 rows from trdir
into corresponding fields of table i_data
where name in s_name.
endform.
*---------------------------------------------------------------------*
*
FORM ALV_TOP_OF_PAGE
*
*---------------------------------------------------------------------*
form alv_top_of_page.
clear: i_list_comments[].
w_list_comments-typ
w_list_comments-key
=
=
=
=
=
=
'X'.
'X'.
'X'.
'X'.
'X'.
'Detail Title Bar'.
endform.
*&---------------------------------------------------------------------*
*&
Form event_exit_build
*&---------------------------------------------------------------------*
form event_exit_build.
clear: i_event_exit[].
* Pick
w_event_exit-ucomm
w_event_exit-before
w_event_exit-after
append w_event_exit
= '&ETA'.
= ' '.
= 'X'.
to i_event_exit.
endform.
*---------------------------------------------------------------------*
*
FORM HTML_TOP_OF_PAGE
*
*---------------------------------------------------------------------*
form html_top_of_page using r_top type ref to cl_dd_document.
data:
text
s_table
col_key
col_info
a_logo
type
type
type
type
type
sdydo_text_element,
ref to cl_dd_table_element,
ref to cl_dd_area,
ref to cl_dd_area,
ref to cl_dd_area.
* Split TOP-Document
call method r_top->vertical_split
exporting split_area = r_top
split_width = '30%'
importing right_area = a_logo.
* Fill TOP-Document
call method r_top->add_text
exporting text = 'Example of a Heading'
sap_style
= 'HEADING'.
call method r_top->new_line.
call method r_top->new_line.
call method r_top->add_table
exporting no_of_columns
with_heading
border
importing table
=
=
=
=
2
' '
'1'
s_table.
exporting width = 3.
= text.
exporting width = 6.
text = '200' .
call method col_info->add_text
exporting text
= text
sap_style = 'Success'.
call method col_info->add_gap
exporting width = 3.
" exclude_build