Skip to end of metadata
Go to start of metadata

* This is an interactive report. You can click on the sapscript name  and it will take you to the sapscript directly in Change/Display mode*
* based on the radio button chosen *

* Two select-options ---------------------

* 1. Sapscript Form name like Z* or Y* or blank etc....

* 2. Development Class in which you want to select the SAPscript *

* Two radio buttons ----------------------

* 1. Change Mode *

* 2. Display Modereport zread_sapscript no standard page heading.

tables: tadir.

type-pools: slis.

types: begin of typ_alv,

devc type tadir-devclass,

form type tadir-obj_name,

tdform type stxh-tdform,

end of typ_alv .

data: it_alv type standard table of typ_alv.

data: wa_alv like line of it_alv,

w_idx type sy-tabix,

ls_fieldcat type slis_fieldcat_alv,

pos type i value 0,

p_form type stxh-tdform,

p_ed(1) type c.
*For ALV ----*data: gt_fieldcat type slis_t_fieldcat_alv.

data: gt_fieldcatall type slis_t_fieldcat_alv.

data: g_repid like sy-repid.

data: gs_layout type slis_layout_alv.

data: gs_layoutall type slis_layout_alv.

data: gt_events type slis_t_event.

data: gt_eventsall type slis_t_event.

data: gt_list_top_of_page type slis_t_listheader.

data: gs_keyinfo type slis_keyinfo_alv.

data: g_tabname_header type slis_tabname.

data: g_tabname_item type slis_tabname.

data: gc_top_of_page_db type slis_formname value 'TOP_OF_PAGE_DB'.

data gc_user_command_db type slis_formname value 'USER_COMMAND_DB'.

data: ls_event type slis_alv_event.

data: gc_top_of_page type slis_formname.*-- Selection screen --*selection-screen begin of block blk1 with frame title text-0b1.

select-options: s_form for tadir-obj_name."Sapscript Form Name

select-options: s_devc for tadir-devclass."Development Class

selection-screen end of block blk1.

selection-screen begin of block blk2 with frame title text-0b2.

parameters: p_chg radiobutton group r1. "Change Mode

parameters: p_dis radiobutton group r1 default 'X'. "Display Mode

selection-screen end of block blk2.

initialization.

g_repid = sy-repid.

start-of-selection.

perform select_data.

end-of-selection.

perform fieldcat_init using gt_fieldcat[].

perform eventtab_build using gt_events[].

perform comment_build using gt_list_top_of_page[].

perform layout_build using gs_layout.

perform write_alv_grid.*&---------------------------------------------------------------------*

*& Include ZREAD_SCRIPTF01 *

*&---------------------------------------------------------------------**&---------------------------------------------------------------------*

*& Form select_data

*&---------------------------------------------------------------------*

* text*----------------------------------------------------------------------*

* --> p1 text

* <-- p2 text

*----------------------------------------------------------------------*

form select_data.

select devclass as devc obj_name as form

from tadir

into table it_alv

where pgmid eq 'R3TR'

and object eq 'FORM'

and obj_name in s_form

and devclass in s_devc

and masterlang eq sy-langu.

loop at it_alv into wa_alv.

w_idx = sy-tabix.

select single tdform from stxh into wa_alv-tdform

where tdobject = 'FORM'

and tdname = wa_alv-form

and tdid = 'DEF'

and tdspras = sy-langu

and tdospras = sy-langu.

if sy-subrc = 0.

modify it_alv from wa_alv index w_idx transporting tdform.

else.

delete it_alv.

continue.

endif.

endloop.

sort it_alv by devc form.

delete adjacent duplicates from it_alv.

endform. " select_data*&---------------------------------------------------------------------*

*& Form fieldcat_init

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* -->P_GT_FIELDCAT[] text

*----------------------------------------------------------------------*form fieldcat_init using lt_fieldcat type slis_t_fieldcat_alv.

pos = pos + 1.

clear ls_fieldcat.

ls_fieldcat-col_pos = pos.

ls_fieldcat-tabname = 'IT_ALV'.

ls_fieldcat-fieldname = 'DEVC'.

ls_fieldcat-seltext_m = 'Dev. Class' .

ls_fieldcat-emphasize = 'C410'.

ls_fieldcat-outputlen = '10'.

append ls_fieldcat to lt_fieldcat.

pos = pos + 1.

clear ls_fieldcat.

ls_fieldcat-col_pos = pos.

ls_fieldcat-tabname = 'IT_ALV'.

ls_fieldcat-fieldname = 'TDFORM'.

ls_fieldcat-seltext_m = 'Sapscript Form' .

ls_fieldcat-outputlen = '14'.

ls_fieldcat-hotspot = 'X'.

append ls_fieldcat to lt_fieldcat.

endform. " fieldcat_init

*&---------------------------------------------------------------------*

*& Form eventtab_build

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* -->P_GT_EVENTS[] text

*----------------------------------------------------------------------*

form eventtab_build using lt_events type slis_t_event.

*

gc_top_of_page = gc_top_of_page_db.

call function 'REUSE_ALV_EVENTS_GET'

exporting

i_list_type = 0

importing

et_events = lt_events.

read table lt_events with key name = slis_ev_top_of_page

into ls_event.

if sy-subrc = 0.

move gc_top_of_page to ls_event-form.

append ls_event to lt_events.

endif.

endform. " eventtab_build

*&---------------------------------------------------------------------*

*& Form comment_build

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* -->P_GT_LIST_TOP_OF_PAGE[] text

*----------------------------------------------------------------------*

form comment_build using lt_top_of_page type slis_t_listheader.

data: ls_line type slis_listheader.

clear ls_line.

ls_line-typ = 'H'.

ls_line-info = 'List of SAP scripts'.

append ls_line to lt_top_of_page.

clear ls_line.

ls_line-typ = 'H'.

concatenate sy-datum+0(4) sy-datum+4(2) sy-datum+6(2)

into ls_line-info separated by '/'.

concatenate 'Run Date :' ls_line-info into ls_line-info

separated by space.

append ls_line to lt_top_of_page.

endform. " comment_build

*&---------------------------------------------------------------------*

*& Form layout_build

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* -->P_GS_LAYOUT text

*----------------------------------------------------------------------*

form layout_build using ls_layout type slis_layout_alv.

ls_layout-zebra = 'X'.

ls_layout-colwidth_optimize = 'X'.

endform. " layout_build

*&---------------------------------------------------------------------*

*& Form write_alv_grid

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* --> p1 text

* <-- p2 text

*----------------------------------------------------------------------*

form write_alv_grid.

data gc_user_command type slis_formname .

gc_user_command = gc_user_command_db.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

* I_INTERFACE_CHECK = ' '

* I_BYPASSING_BUFFER =

* I_BUFFER_ACTIVE = ' '

i_callback_program = g_repid

* I_CALLBACK_PF_STATUS_SET = ' '

i_callback_user_command = gc_user_command

* I_CALLBACK_TOP_OF_PAGE = ' '

* I_CALLBACK_HTML_TOP_OF_PAGE = ' '

* I_CALLBACK_HTML_END_OF_LIST = ' '

* I_STRUCTURE_NAME =

i_background_id = 'ALV_BACKGROUND'

* I_GRID_TITLE =

* I_GRID_SETTINGS =

is_layout = gs_layout

it_fieldcat = gt_fieldcat[]

* IT_EXCLUDING =

* IT_SPECIAL_GROUPS =

* IT_SORT =

* IT_FILTER =

* IS_SEL_HIDE =

* I_DEFAULT = 'X'

* I_SAVE = ' '

* IS_VARIANT =

it_events = gt_events[]

* IT_EVENT_EXIT =

* IS_PRINT =

* IS_REPREP_ID =

* I_SCREEN_START_COLUMN = 0

* I_SCREEN_START_LINE = 0

* I_SCREEN_END_COLUMN = 0

* I_SCREEN_END_LINE = 0

* IT_ALV_GRAPHICS =

* IT_ADD_FIELDCAT =

* IT_HYPERLINK =

* I_HTML_HEIGHT_TOP =

* I_HTML_HEIGHT_END =

* IMPORTING

* E_EXIT_CAUSED_BY_CALLER =

* ES_EXIT_CAUSED_BY_USER =

tables

t_outtab = it_alv

exceptions

program_error = 1

others = 2

.

if sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

endform. " write_alv_grid

*----------------------------------------------------------------------*

* FORM USER_COMMAND_DB *

*----------------------------------------------------------------------*

form user_command_db using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

if p_dis = 'X'.

p_ed = 'X'.

else.

clear: p_ed.

endif.

data: w_field(30) type c.

case r_ucomm.

when '&IC1'. "doubleclick

clear r_ucomm.

if rs_selfield-fieldname = 'TDFORM'.

perform edit_display_form using rs_selfield-value p_ed.

endif.

endcase.

endform.

*---------------------------------------------------------------------*

* FORM TOP_OF_PAGE_DB *

*---------------------------------------------------------------------*

* ........ *

*---------------------------------------------------------------------*

form top_of_page_db.

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = gt_list_top_of_page

i_logo = 'ENJOYSAP_LOGO'.

endform.*&---------------------------------------------------------------------*

*& Form EDIT_DISPLAY_form

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* -->P_RS_SELFIELD_FIELDVALUE text

* -->P_P_ED text

*----------------------------------------------------------------------*form edit_display_form using value(p_formval)

value(p_display).

p_form = p_formval.

call function 'EDIT_FORM'

exporting

form = p_form

language = sy-langu

display = p_display* COMPONENT = 'HEADER'

* IMPORTING

* LAST_COMPONENT =exceptions

unknown_activity = 1

unknown_component = 2

others = 3

.

if sy-subrc <> 0.* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.endif.

endform. " EDIT_DISPLAY_form

  • No labels