* _ _ _ _ _ * /_\ | |__ __ _ _ __ ___ __ _ __| | __ _| |__ _ __ /_\ * //_\\| '_ \ / _` | '_ \ / __/ _` |/ _` |/ _` | '_ \| '__//_\\ * / _ \ |_) | (_| | |_) | (_| (_| | (_| | (_| | |_) | | / _ \ * \_/ \_/_.__/ \__,_| .__/ \___\__,_|\__,_|\__,_|_.__/|_| \_/ \_/ * |_| www.abapcadabra.com *---------------------------------------------------------------------------- * ____ _ _ _ _ _ * | __ ) _ _| |_| |_ ___ _ __ | (_)_ __ | | _____ Assistance programs * | _ \| | | | __| __/ _ \| '_ \ | | | '_ \| |/ / __| to be called from * | |_) | |_| | |_| || (_) | | | | | | | | | | <\__ \ your report selection * |____/ \__,_|\__|\__\___/|_| |_| |_|_|_| |_|_|\_\___/ screen: BLINKS ! * * AbapcadabrA Button Links: an AbapcadabrA trade mark product - FREE DOWNLOAD * Turn-key and ready to use functionality that can be made available * from a button on the selection screen of your report. There are a variety * of Button-link reports and this is one of them. * Find out MORE on AbapcadabrA.com - Search for "Button links" * * program : ZABAPCADABRA_TABLE_MAINT * title : Table maintenance (sm30) access * functional area : Cross modules * environment : 4.7 * program Function : This report allows easy access to the SM30 transaction, * for which a pre-selection can be set (SQL instruction) * Documentation : Search for "Button links" on AbapcadabrA.com * Previous version : This is the initial version * Developer name : Wim Maasdam * Development date : 04/10/2017 * Version : 0.1 *--------------------------------------------------------------------- * Change list: * Date Description * 04/10/2017 Initial release * *--------------------------------------------------------------------- REPORT ZABAPCADABRA_TABLE_MAINT. class lcl_controller definition. public section. class-data: gt_sellist type STANDARD TABLE OF VIMSELLIST. class-methods: view_maintenance_call importing view_name type any instruction type string OPTIONAL editing_allowed type boolean default abap_true, set_listbox_operators importing parametername type char80, set_listbox_and_or importing parametername type char80, set_sellist importing field type any operator type any value type any andor type any. endclass. class lcl_controller implementation. METHOD view_maintenance_call. data: lt_exclusions type standard table of VIMEXCLFUN, lv_action type c length 1, lt_instructions type standard table of string, lv_instruction type string, lv_view_name type DD02V-TABNAME, lv_dummy type string. if editing_allowed = abap_true. lv_action = 'U'. clear lt_exclusions[]. else. lv_action = 'S'. * The exclusions: menu options that are to be excluded from the SM30 functionality clear lt_exclusions[]. append 'AEND' to lt_exclusions. "Change mode to editing append 'MKAL' to lt_exclusions. "Selection (mark for...) append 'MKLO' to lt_exclusions. "Selection (mark for...) append 'MKBL' to lt_exclusions. "Selection (mark for...) endif. lv_view_name = view_name. if gt_sellist[] is initial. CALL FUNCTION 'VIEW_MAINTENANCE_CALL' EXPORTING action = lv_action view_name = lv_view_name TABLES excl_cua_funct = lt_exclusions EXCEPTIONS others = 4. else. CALL FUNCTION 'VIEW_MAINTENANCE_CALL' EXPORTING action = lv_action view_name = lv_view_name TABLES dba_sellist = gt_sellist excl_cua_funct = lt_exclusions EXCEPTIONS others = 4. endif. if sy-subrc <> 0. message 'Call failed' type 'S'. endif. ENDMETHOD. METHOD set_listbox_operators. DATA: lt_list TYPE vrm_values, lw_list LIKE LINE OF lt_list. clear lw_list. APPEND lw_list TO lt_list. lw_list-key = lw_list-text = 'EQ'. APPEND lw_list TO lt_list. lw_list-key = lw_list-text = 'NE'. APPEND lw_list TO lt_list. lw_list-key = lw_list-text = 'GT'. APPEND lw_list TO lt_list. lw_list-key = lw_list-text = 'GE'. APPEND lw_list TO lt_list. lw_list-key = lw_list-text = 'LE'. APPEND lw_list TO lt_list. lw_list-key = lw_list-text = 'LT'. APPEND lw_list TO lt_list. lw_list-key = lw_list-text = 'CP'. APPEND lw_list TO lt_list. CALL FUNCTION 'VRM_SET_VALUES' EXPORTING id = parametername values = lt_list. ENDMETHOD. METHOD set_listbox_and_or. DATA: lt_list TYPE vrm_values, lw_list LIKE LINE OF lt_list. clear lw_list. APPEND lw_list TO lt_list. lw_list-key = lw_list-text = 'AND'. APPEND lw_list TO lt_list. lw_list-key = lw_list-text = 'OR'. APPEND lw_list TO lt_list. CALL FUNCTION 'VRM_SET_VALUES' EXPORTING id = parametername values = lt_list. ENDMETHOD. METHOD set_sellist. data: lw_sellist type VIMSELLIST. check not field is initial. lw_sellist-viewfield = field. lw_sellist-operator = operator. lw_sellist-value = value. lw_sellist-AND_OR = andor. append lw_sellist to gt_sellist. ENDMETHOD. endclass. * When you call this report with a Submit - make sure you fill in pa_BLINK with 'X'. PARAMETERS pa_BLINK type c length 1 default space NO-DISPLAY. SELECTION-SCREEN: BEGIN OF LINE, COMMENT 1(20) lbl_01 for field pa_TABLE. PARAMETERS pa_TABLE type DD02V-TABNAME. SELECTION-SCREEN: END OF LINE. SELECTION-SCREEN: BEGIN OF LINE, COMMENT 1(20) lbl_02 for field pa_SQLF1. PARAMETERS pa_SQLF1 type c LENGTH 14. PARAMETERS pa_SQLO1 TYPE c LENGTH 2 AS LISTBOX VISIBLE LENGTH 5. PARAMETERS pa_SQLV1 type c LENGTH 25 LOWER CASE. PARAMETERS pa_and01 TYPE c LENGTH 2 AS LISTBOX VISIBLE LENGTH 6. SELECTION-SCREEN: END OF LINE. SELECTION-SCREEN: BEGIN OF LINE, position 22. PARAMETERS pa_SQLF2 type c LENGTH 14. PARAMETERS pa_SQLO2 TYPE c LENGTH 2 AS LISTBOX VISIBLE LENGTH 5. PARAMETERS pa_SQLV2 type c LENGTH 25 LOWER CASE. PARAMETERS pa_and02 TYPE c LENGTH 2 AS LISTBOX VISIBLE LENGTH 6. SELECTION-SCREEN: END OF LINE. SELECTION-SCREEN: BEGIN OF LINE, position 22. PARAMETERS pa_SQLF3 type c LENGTH 14. PARAMETERS pa_SQLO3 TYPE c LENGTH 2 AS LISTBOX VISIBLE LENGTH 5. PARAMETERS pa_SQLV3 type c LENGTH 25 LOWER CASE. PARAMETERS pa_and03 TYPE c LENGTH 2 AS LISTBOX VISIBLE LENGTH 6. SELECTION-SCREEN: END OF LINE. SELECTION-SCREEN: BEGIN OF LINE, position 22. PARAMETERS pa_SQLF4 type c LENGTH 14. PARAMETERS pa_SQLO4 TYPE c LENGTH 2 AS LISTBOX VISIBLE LENGTH 5. PARAMETERS pa_SQLV4 type c LENGTH 25 LOWER CASE. PARAMETERS pa_and04 TYPE c LENGTH 2 AS LISTBOX VISIBLE LENGTH 6. SELECTION-SCREEN: END OF LINE. SELECTION-SCREEN: BEGIN OF LINE, position 22. PARAMETERS pa_SQLF5 type c LENGTH 14. PARAMETERS pa_SQLO5 TYPE c LENGTH 2 AS LISTBOX VISIBLE LENGTH 5. PARAMETERS pa_SQLV5 type c LENGTH 25 LOWER CASE. PARAMETERS pa_and05 TYPE c LENGTH 2 AS LISTBOX VISIBLE LENGTH 6. SELECTION-SCREEN: END OF LINE. SELECTION-SCREEN: BEGIN OF LINE, position 22. PARAMETERS pa_SQLF6 type c LENGTH 14. PARAMETERS pa_SQLO6 TYPE c LENGTH 2 AS LISTBOX VISIBLE LENGTH 5. PARAMETERS pa_SQLV6 type c LENGTH 25 LOWER CASE. SELECTION-SCREEN: END OF LINE. SELECTION-SCREEN: BEGIN OF LINE, position 22. PARAMETERS pa_EDIT as checkbox. SELECTION-SCREEN: COMMENT 24(20) lbl_03 for field pa_EDIT, END OF LINE. AT SELECTION-SCREEN OUTPUT. lcl_controller=>set_listbox_operators( 'PA_SQLO1' ). lcl_controller=>set_listbox_and_or( 'PA_AND01' ). lcl_controller=>set_listbox_operators( 'PA_SQLO2' ). lcl_controller=>set_listbox_and_or( 'PA_AND02' ). lcl_controller=>set_listbox_operators( 'PA_SQLO3' ). lcl_controller=>set_listbox_and_or( 'PA_AND03' ). lcl_controller=>set_listbox_operators( 'PA_SQLO4' ). lcl_controller=>set_listbox_and_or( 'PA_AND04' ). lcl_controller=>set_listbox_operators( 'PA_SQLO5' ). lcl_controller=>set_listbox_and_or( 'PA_AND05' ). lcl_controller=>set_listbox_operators( 'PA_SQLO6' ). INITIALIZATION. lbl_01 = 'Table/view'. lbl_02 = 'SQL instruction'. lbl_03 = 'Editing allowed'. START-OF-SELECTION. if not pa_TABLE is initial. lcl_controller=>set_sellist( field = PA_SQLF1 operator = PA_SQLO1 value = PA_SQLV1 andor = PA_AND01 ). lcl_controller=>set_sellist( field = PA_SQLF2 operator = PA_SQLO2 value = PA_SQLV2 andor = PA_AND02 ). lcl_controller=>set_sellist( field = PA_SQLF3 operator = PA_SQLO3 value = PA_SQLV3 andor = PA_AND03 ). lcl_controller=>set_sellist( field = PA_SQLF4 operator = PA_SQLO4 value = PA_SQLV4 andor = PA_AND04 ). lcl_controller=>set_sellist( field = PA_SQLF5 operator = PA_SQLO5 value = PA_SQLV5 andor = PA_AND05 ). lcl_controller=>set_sellist( field = PA_SQLF6 operator = PA_SQLO6 value = PA_SQLV6 andor = space ). lcl_controller=>view_maintenance_call( exporting view_name = pa_TABLE editing_allowed = pa_edit ). endif. if pa_BLINK = abap_true. LEAVE PROGRAM. endif.