* _ _ _ _ _ * /_\ | |__ __ _ _ __ ___ __ _ __| | __ _| |__ _ __ /_\ * //_\\| '_ \ / _` | '_ \ / __/ _` |/ _` |/ _` | '_ \| '__//_\\ * / _ \ |_) | (_| | |_) | (_| (_| | (_| | (_| | |_) | | / _ \ * \_/ \_/_.__/ \__,_| .__/ \___\__,_|\__,_|\__,_|_.__/|_| \_/ \_/ * |_| 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_BLINK_INVENTORY * title : Reports/transaction inventory * functional area : Cross modules * environment : 4.7 * program Function : This report can be set up to display a series of reports * that are somehow related. The report or transaction group * settings are stored in a variant and reports can be triggered * from this report. * * Other than the "Run manager", this report is started with the * name of the group-variant as NO-DISPLAY parameter pa_varia. * Installation : Look up "SET TITLEBAR" and follow the instructions, this * should influence the report title of the button overview * Instructions : From any report call the inventory blink (this report) like * so: * SUBMIT ZABAPCADABRA_BLINK_INVENTORY * with pa_blink = abap_true * with pa_varia = '' * VIA SELECTION-SCREEN. * * Documentation : Search for "Run manager" or "button links" on AbapcadabrA.com * Previous version : This is the initial version * Developer name : Wim Maasdam * Development date : 23/03/2018 * Version : 1.1 *--------------------------------------------------------------------- * Change list: * Date Description * 30/09/2017 Initial release * 23/03/2018 Version 1.1, series of improvements * - Icons and quickinfo on buttons * - Optional pull-down on other menu's *--------------------------------------------------------------------- * __ _ * /\ \ \__ _ _ __ ___ (_)_ __ __ _ * / \/ / _` | '_ ` _ \| | '_ \ / _` | * / /\ / (_| | | | | | | | | | | (_| | * \_\ \/ \__,_|_| |_| |_|_|_| |_|\__, | _ _ * ___ ___ _ ____ _____|___/ | |_(_) ___ _ __ ___ * / __/ _ \| '_ \ \ / / _ \ '_ \| __| |/ _ \| '_ \/ __| * | (_| (_) | | | \ V / __/ | | | |_| | (_) | | | \__ \ * \___\___/|_| |_|\_/ \___|_| |_|\__|_|\___/|_| |_|___/ * Selection screen variables: * PA_ Parameter field * SO_ Select-option field * Globally defined variables: Locally defined variables: * TY_ Type definition | LTY_ Locally defined Type definition (types: begin of lty_...) * GC_ Constant | LC_ Constant * GV_ Variable | LV_ Variable * GW_ Work Area | LW_ Work Area (holding multiple fields) * GT_ internal Table | LT_ internal Table * GR_ Range variable | LR_ Range variable (type range of) * GO_ Object variable | LO_ Object variable (type ref to ..) * LCL_ Local class definition/implementation * Field-symbols: * - Field symbol definitions have no naming convention, but * should be used for a single data type only * Local classes: * - A local class can hold globally defined variables as well as * locally defined variables * - Instance and static variables use the same naming convention * - Parameters on a method have no naming convention * - Exceptions have no naming convention *--------------------------------------------------------------------- REPORT ZABAPCADABRA_BLINK_INVENTORY. TABLES: syst, sscrfields. "Selection screen definition purpose only * ___ _ _ __ _ _ _ _ * / __\ | __ _ ___ ___ __| | ___ / _(_)_ __ (_) |_(_) ___ _ __ * / / | |/ _` / __/ __| / _` |/ _ \ |_| | '_ \| | __| |/ _ \| '_ \ * / /___| | (_| \__ \__ \ | (_| | __/ _| | | | | | |_| | (_) | | | | * \____/|_|\__,_|___/___/ \__,_|\___|_| |_|_| |_|_|\__|_|\___/|_| |_| CLASS lcl_variant_utility DEFINITION. PUBLIC SECTION. TYPES: ty_date_range type range of sy-datum. DATA: gv_report type RSVAR-REPORT, gv_variant TYPE RSVAR-VARIANT, gw_varid type varid. METHODS: constructor IMPORTING report_name TYPE any DEFAULT sy-repid variant_name TYPE any. CLASS-METHODS: update, update_selop importing select_optionname type any changing content_table type rsparams_tt, set_listbox_varid. ENDCLASS. CLASS lcl_controller DEFINITION. PUBLIC SECTION. TYPES: ty_date_range type range of sy-datum. CLASS-DATA: gc_report_name type sy-repid value 'ZABAPCADABRA_BLINK_INVENTORY', gv_administrator_mode type boolean, gv_buttons_active type boolean. CLASS-METHODS: set_variant importing variant type any, get_description importing object type any RETURNING VALUE(description) type string, submit_report importing report type any variant type any direct type boolean default abap_true. ENDCLASS. * ___ _ _ _ * / __\ | __ _ ___ ___ (_)_ __ ___ _ __ | | ___ _ __ ___ * / / | |/ _` / __/ __| | | '_ ` _ \| '_ \| |/ _ \ '_ ` _ \ * / /___| | (_| \__ \__ \ | | | | | | | |_) | | __/ | | | | |_ * \____/|_|\__,_|___/___/ |_|_| |_| |_| .__/|_|\___|_| |_| |_(_) * |_| CLASS lcl_variant_utility IMPLEMENTATION. METHOD constructor. gv_report = report_name. gv_variant = variant_name. SELECT * FROM varid INTO gw_varid UP TO 1 ROWS WHERE REPORT = gv_report AND variant = gv_variant. ENDSELECT. IF sy-subrc <> 0. clear: gv_report, gv_variant. ENDIF. ENDMETHOD. "constructor method update. data: lt_selnames type standard table of RSSCR_NAME, lv_selname type RSSCR_NAME, lt_contents type rsparams_tt, lw_content type rsparams, lw_RSVAR type RSVAR, lw_VARID type VARID, lv_tabix type sy-tabix. field-symbols: type any table, type any, type any. check not SY-SLSET is initial. lw_RSVAR-report = SY-REPID. lw_RSVAR-variant = SY-SLSET. clear: lt_contents[]. * Read current variant settings: CALL FUNCTION 'RS_VARIANT_CONTENTS' EXPORTING REPORT = lw_RSVAR-report variant = lw_RSVAR-variant move_or_write = 'M' TABLES valutab = lt_contents EXCEPTIONS OTHERS = 4. check sy-subrc = 0. select * from varid into lw_varid up to 1 rows where report = lw_RSVAR-report and variant = lw_RSVAR-variant. endselect. check sy-subrc = 0. * Update all possible fields with the values that are currently set: clear: lt_selnames[]. loop at lt_contents into lw_content. append lw_content-selname to lt_selnames. endloop. loop at lt_selnames into lv_selname. read table lt_contents into lw_content with key selname = lv_selname. if sy-subrc = 0. lv_tabix = sy-tabix. if lw_content-kind = 'P'. assign (lw_content-selname) to . lw_content-low = . modify lt_contents from lw_content index lv_tabix. elseif lw_content-kind = 'S'. update_selop( exporting select_optionname = lw_content-selname changing content_table = lt_contents ). endif. endif. endloop. CALL FUNCTION 'RS_CHANGE_CREATED_VARIANT' EXPORTING CURR_REPORT = lw_RSVAR-report CURR_VARIANT = lw_RSVAR-variant VARI_DESC = lw_varid ONLY_CONTENTS = abap_true TABLES VARI_CONTENTS = lt_contents EXCEPTIONS OTHERS = 4. check sy-subrc = 0. message 'Changes applied' type 'S'. endmethod. method update_selop. DATA: lr_structdescr TYPE REF TO cl_abap_structdescr, lr_tabledescr TYPE REF TO cl_abap_tabledescr, lr_datadescr TYPE REF TO cl_abap_datadescr, lt_components TYPE abap_component_tab, lw_component TYPE LINE OF abap_component_tab, lr_wa TYPE REF TO data, lr_tab TYPE REF TO data, lv_fieldname type string, lw_RSPARAMS type RSPARAMS, lv_tabix type sy-tabix. FIELD-SYMBOLS: TYPE ANY. FIELD-SYMBOLS: TYPE ANY. FIELD-SYMBOLS: TYPE TABLE. read table content_table with key SELNAME = select_optionname transporting no fields. check sy-subrc = 0. lv_tabix = sy-tabix. delete content_table where SELNAME = select_optionname. * determine components of structure -> LT_COMPONENTS MOVE 'SIGN' TO lw_component-name. lw_component-type ?= cl_abap_elemdescr=>get_c( p_length = 1 ). INSERT lw_component INTO TABLE lt_components. MOVE 'OPTION' TO lw_component-name. lw_component-type ?= cl_abap_elemdescr=>get_c( p_length = 2 ). INSERT lw_component INTO TABLE lt_components. concatenate select_optionname '-LOW' into lv_fieldname. assign (lv_fieldname) to . MOVE 'LOW' TO lw_component-name. lw_component-type ?= cl_abap_elemdescr=>describe_by_data( ). INSERT lw_component INTO TABLE lt_components. MOVE 'HIGH' TO lw_component-name. lw_component-type ?= cl_abap_elemdescr=>describe_by_data( ). INSERT lw_component INTO TABLE lt_components. * get structure descriptor -> LR_STRUCTDESCR lr_structdescr ?= cl_abap_structdescr=>create( lt_components ). * create work area of structure LR_STRUCTDESCR -> GR_WA CREATE DATA lr_wa TYPE HANDLE lr_structdescr. ASSIGN lr_wa->* TO . lr_datadescr ?= lr_structdescr. lr_tabledescr ?= cl_abap_tabledescr=>create( lr_datadescr ). * Create dynmaic internal table CREATE DATA lr_tab TYPE HANDLE lr_tabledescr. ASSIGN lr_tab->* TO . concatenate select_optionname '[]' into lv_fieldname. assign (lv_fieldname) to . loop at assigning . move-corresponding to lw_RSPARAMS. lw_RSPARAMS-SELNAME = select_optionname. lw_RSPARAMS-KIND = 'S'. insert lw_RSPARAMS into content_table index lv_tabix. add 1 to lv_tabix. endloop. endmethod. method set_listbox_varid. DATA: lt_list TYPE vrm_values, lw_list LIKE LINE OF lt_list, lt_varid type standard table of varid, lw_varid type varid, lw_varit type varit, lt_valutab type standard table of RSPARAMS, lw_valutab type RSPARAMS. select * from varid into table lt_varid where report = LCL_CONTROLLER=>gc_report_name. clear: lt_list[]. loop at lt_varid into lw_varid. * Read the variant to check certain values CALL FUNCTION 'RS_VARIANT_CONTENTS' EXPORTING REPORT = lw_varid-report VARIANT = lw_varid-variant TABLES VALUTAB = lt_VALUTAB EXCEPTIONS OTHERS = 4. IF SY-SUBRC = 0. * Determine the value of PA_ACTIV - which controls whether settings are active read table lt_VALUTAB into lw_valutab with key SELNAME = 'PA_ONMEN'. if sy-subrc = 0 and lw_valutab-low = abap_true. * All well, keep going else. continue. "Skip this entry endif. ENDIF. select single * from varit into lw_varit where report = lw_varid-report and variant = lw_varid-variant and LANGU = sy-langu. if sy-subrc <> 0. select * from varit into lw_varit up to 1 rows where report = lw_varid-report and variant = lw_varid-variant. endselect. endif. if sy-subrc <> 0. clear lw_varit. endif. lw_list-key = lw_varid-variant. concatenate lw_varid-variant '-' lw_varit-VTEXT into lw_list-text SEPARATED BY space. APPEND lw_list TO lt_list. endloop. CALL FUNCTION 'VRM_SET_VALUES' EXPORTING id = 'PA_VARID' values = lt_list. endmethod. ENDCLASS. CLASS lcl_controller IMPLEMENTATION. METHOD set_variant. data: lw_varid type varid. IF sy-batch = space and "Not run as batch job sy-slset <> variant. "Current variant is not specified in pa_varia * Check: variant with the name of the transaction available ? select single * from varid into lw_varid where report = sy-repid and variant = variant and flag1 = space and flag2 = space. IF sy-subrc = 0. * A variant exists, restart the report for this variant: SUBMIT (lw_varid-report) USING SELECTION-SET lw_varid-variant VIA SELECTION-SCREEN. ENDIF. ENDIF. ENDMETHOD. METHOD get_description. data: lw_TRDIRT type TRDIRT, lw_tstct type TSTCT. select single * from TRDIRT into lw_TRDIRT where name = object and sprsl = sy-langu. if sy-subrc = 0. description = lw_TRDIRT-text. else. select single * from tstct into lw_tstct where tcode = object and sprsl = sy-langu. if sy-subrc = 0. description = lw_tstct-ttext. endif. endif. ENDMETHOD. METHOD submit_report. data: lo_variant type ref to lcl_variant_utility, lv_variant_needs_2b_saved type boolean, lv_tcode type tstc-tcode, lv_name type trdir-name, lv_message type string. if lcl_controller=>gv_administrator_mode = abap_true. message 'Not allowed in administrator mode - please restart' type 'S'. exit. endif. * Check whether the object is a transaction code: select single tcode from tstc into lv_tcode where tcode = report. if sy-subrc = 0. call transaction report. else. select single name from trdir into lv_name where name = report. if sy-subrc <> 0. * Check whether the report exists message 'Report/transaction does not exist' type 'S'. exit. endif. if not variant is initial. * Check the variant CREATE OBJECT lo_variant EXPORTING report_name = report variant_name = variant. if lo_variant->gv_report is initial. concatenate 'Variant' variant 'of report' report 'does not exist' into lv_message SEPARATED BY space. message lv_message type 'S'. exit. endif. * Submit the report if direct = abap_true. * A variant is available, and the selection screen should be skipped SUBMIT (report) USING SELECTION-SET variant. else. * A variant is available, the selection screen should be shown SUBMIT (report) USING SELECTION-SET variant VIA SELECTION-SCREEN. endif. else. "No variant * Submit the report, show selection screen SUBMIT (report) VIA SELECTION-SCREEN. endif. endif. ENDMETHOD. ENDCLASS. * __ _ _ _ * / _\ ___| | ___ ___| |_(_) ___ _ __ ___ ___ _ __ ___ ___ _ __ * \ \ / _ \ |/ _ \/ __| __| |/ _ \| '_ \ / __|/ __| '__/ _ \/ _ \ '_ \ * _\ \ __/ | __/ (__| |_| | (_) | | | | \__ \ (__| | | __/ __/ | | | * \__/\___|_|\___|\___|\__|_|\___/|_| |_| |___/\___|_| \___|\___|_| |_| define set_object_field. * Normally visible line, the button or buttons: SELECTION-SCREEN: BEGIN OF LINE. SELECTION-SCREEN PUSHBUTTON 5(65) btxt&1 USER-COMMAND btxt&1 MODIF ID b&1. SELECTION-SCREEN PUSHBUTTON 71(30) icon&1 USER-COMMAND icon&1 MODIF ID b&1 VISIBLE LENGTH 5. SELECTION-SCREEN END OF LINE. * Line that is shown as "blank line" SELECTION-SCREEN: BEGIN OF LINE. SELECTION-SCREEN: comment 5(70) skip&1 modif id s&1. SELECTION-SCREEN END OF LINE. * Administrator edit line SELECTION-SCREEN BEGIN OF LINE. PARAMETERS pa_rep&1 type RSVAR-REPORT VISIBLE LENGTH 25 MODIF ID adm. PARAMETERS pa_ico&1 type icon-id MODIF ID adm. PARAMETERS pa_lbl&1 type c length 65 lower case VISIBLE LENGTH 30 MODIF ID adm. PARAMETERS pa_qin&1 type c length 80 lower case VISIBLE LENGTH 20 MODIF ID adm. PARAMETERS pa_var&1 type RSVAR-VARIANT MODIF ID adm. SELECTION-SCREEN END OF LINE. end-of-definition. * 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 abap_false NO-DISPLAY, pa_VARIA type c length 30 NO-DISPLAY. selection-SCREEN: BEGIN OF LINE, POSITION 6. parameter: pa_varid type RSVAR-VARIANT AS LISTBOX VISIBLE LENGTH 64 USER-COMMAND jump_to_variant MODIF ID men. selection-SCREEN END OF LINE. * Line that is shown as "blank line" SELECTION-SCREEN: BEGIN OF LINE. SELECTION-SCREEN: comment 5(60) skipwelc modif id wel. SELECTION-SCREEN END OF LINE. * Comment line on first time use SELECTION-SCREEN BEGIN OF LINE. SELECTION-SCREEN COMMENT 5(79) lbl_welc MODIF ID wel. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN BEGIN OF LINE. SELECTION-SCREEN COMMENT 1(25) lbl_titl FOR FIELD pa_title MODIF ID adm. PARAMETERS pa_title type c length 40 lower case MODIF ID adm. SELECTION-SCREEN PUSHBUTTON 70(30) varsave USER-COMMAND varsave MODIF ID adm VISIBLE LENGTH 2. SELECTION-SCREEN END OF LINE. * Header line SELECTION-SCREEN: SKIP, BEGIN OF LINE. PARAMETER pa_hdr01 type c length 25 lower case modif id adm. PARAMETER pa_hdr02 type c length 4 lower case modif id adm. PARAMETER pa_hdr03 type c length 30 lower case modif id adm. PARAMETER pa_hdr04 type c length 20 lower case modif id adm. PARAMETER pa_hdr05 type c length 14 lower case modif id adm. SELECTION-SCREEN END OF LINE. * Report or transaction lines. set_object_field: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20. SELECTION-SCREEN: BEGIN OF LINE. PARAMETER: pa_smenu as checkbox default abap_true modif id adm. "Show menu SELECTION-SCREEN COMMENT 3(55) lbl_menu FOR FIELD pa_smenu MODIF ID adm. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN: BEGIN OF LINE. PARAMETER: pa_onmen as checkbox default abap_true modif id adm. "Show menu SELECTION-SCREEN COMMENT 3(55) lbl_mena FOR FIELD pa_onmen MODIF ID adm. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN: BEGIN OF LINE. PARAMETER: pa_shoad as checkbox default space modif id adm. "Show admin button SELECTION-SCREEN COMMENT 3(55) lbl_shoa FOR FIELD pa_shoad MODIF ID adm. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN: BEGIN OF LINE. PARAMETER: pa_abapc as checkbox default abap_true modif id adm. "Show documentation link SELECTION-SCREEN COMMENT 3(55) lbl_abra FOR FIELD pa_abapc MODIF ID adm. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN: SKIP, ULINE, BEGIN OF LINE. SELECTION-SCREEN PUSHBUTTON 5(50) admtxt USER-COMMAND ADMIN MODIF ID atx VISIBLE LENGTH 4. SELECTION-SCREEN PUSHBUTTON 10(50) doctxt USER-COMMAND DOCUMENTATION MODIF ID dcu VISIBLE LENGTH 4. SELECTION-SCREEN END OF LINE. AT SELECTION-SCREEN OUTPUT. data: lv_icon type icon-id, lv_quickinfo type string. define set_object_line. if lcl_controller=>gv_administrator_mode = abap_true. loop at screen. if screen-group1 = 'B&1' or screen-group1 = 'S&1' or screen-group1 = 'MEN'. screen-active = '0'. modify screen. endif. endloop. else. if not pa_rep&1 is initial. * Set the button description: to a preset value or to the report/transaction description if pa_lbl&1 is initial. btxt&1 = lcl_controller=>get_description( pa_rep&1 ). else. btxt&1 = pa_lbl&1. endif. * Hide the "with variant" option if no variant is supplied if pa_var&1 is initial. loop at screen. if screen-name = 'ICON&1'. screen-active = '0'. modify screen. endif. endloop. else. CALL FUNCTION 'ICON_CREATE' EXPORTING NAME = ICON_SYSTEM_OKAY TEXT = '' INFO = 'Execute without variant' IMPORTING RESULT = ICON&1 EXCEPTIONS OTHERS = 0. endif. loop at screen. if screen-group1 = 'S&1'. screen-active = '0'. modify screen. endif. endloop. if pa_ico&1 is initial. lv_icon = ICON_COLUMN_RIGHT. else. lv_icon = pa_ico&1. endif. if pa_qin&1 is initial. lv_quickinfo = btxt&1. else. lv_quickinfo = pa_qin&1. endif. CALL FUNCTION 'ICON_CREATE' EXPORTING NAME = lv_icon TEXT = btxt&1 INFO = lv_quickinfo IMPORTING RESULT = btxt&1 EXCEPTIONS OTHERS = 0. * Set the "there are active buttons" indicator lcl_controller=>gv_buttons_active = abap_true. else. * If no report/transaction was supplied, the label text field acts as a * menu-separator. if not pa_lbl&1 is initial. if not pa_ico&1 is initial. concatenate pa_ico&1 pa_lbl&1 into skip&1 SEPARATED BY space. else. skip&1 = pa_lbl&1. endif. endif. loop at screen. if screen-group1 = 'B&1'. screen-active = '0'. modify screen. endif. endloop. endif. endif. end-of-definition. lcl_controller=>set_variant( pa_varia ). * Assign button texts / OR disable buttons clear lcl_controller=>gv_buttons_active. set_object_line: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20. if lcl_controller=>gv_buttons_active = abap_false and lcl_controller=>gv_administrator_mode = abap_false. lbl_welc = '@1A@ No active menu items. For Administrator access put ADMIN in command field'. else. loop at screen. case screen-group1 . when 'WEL'. "Welcome screen-active = '0'. modify screen. endcase. endloop. endif. * Create the titlebar by double clicking on it - set the value to & if not pa_title is initial. set titlebar 'T01' with pa_title. endif. if lcl_controller=>gv_administrator_mode = abap_false. * Non-administrator mode, hide loop at screen. if screen-group1 = 'ADM'. screen-input = '0'. screen-active = '0'. modify screen. endif. endloop. else. * Administrator mode: set the column headers (don't rely on what is on any variant) pa_hdr01 = 'Report/transaction'. pa_hdr02 = 'Icon'. pa_hdr03 = 'Description'. pa_hdr04 = 'Quick info'. pa_hdr05 = 'Variant'. * In adminitstrator mode - some fields are invisible, or READ-ONLY loop at screen. if screen-group1 cs ':B01:B02:B03:B04:B05:B06:B07:B08:B09:B10:' && ':B11:B12:B13:B14:B15:B16:B17:B18:B19:B20:'. screen-active = '0'. modify screen. endif. if screen-name(6) = 'PA_HDR'. screen-input = '0'. modify screen. endif. * The Save button, only when a variant is already available if screen-name = 'VARSAVE'. if sy-slset is initial. screen-input = '0'. screen-active = '0'. modify screen. else. CALL FUNCTION 'ICON_CREATE' EXPORTING NAME = ICON_SYSTEM_SAVE TEXT = '' INFO = 'Save settings' IMPORTING RESULT = varsave EXCEPTIONS OTHERS = 0. endif. endif. endloop. endif. if pa_smenu = abap_false or lcl_controller=>gv_administrator_mode = abap_true. * Hide the Menu listbox loop at screen. if screen-name = 'PA_VARID'. screen-active = '0'. modify screen. endif. endloop. endif. if ( pa_shoad = abap_false or lcl_controller=>gv_administrator_mode = abap_true ) and lcl_controller=>gv_buttons_active = abap_true. * Hide the ADMIN button loop at screen. if screen-group1 = 'ATX'. screen-active = '0'. modify screen. endif. endloop. endif. if ( pa_abapc = abap_false or lcl_controller=>gv_administrator_mode = abap_true ) and lcl_controller=>gv_buttons_active = abap_true. * Hide the Documentation button loop at screen. if screen-group1 = 'DCU'. screen-active = '0'. modify screen. endif. endloop. endif. pa_varid = sy-slset. LCL_VARIANT_UTILITY=>SET_LISTBOX_VARID( ). AT SELECTION-SCREEN. define set_case_line. when 'BTXT&1'. lcl_controller=>submit_report( exporting report = pa_rep&1 variant = pa_var&1 ). when 'ICON&1'. lcl_controller=>submit_report( exporting report = pa_rep&1 variant = pa_var&1 direct = abap_false ). end-of-definition. case sscrfields-ucomm. when 'ADMIN'. lcl_controller=>gv_administrator_mode = abap_true. if sy-slset is initial. message 'Welcome administrator, save your settings as a variant' type 'S'. else. message 'Welcome administrator' type 'S'. endif. set_case_line: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20. WHEN 'JUMP_TO_VARIANT'. submit (LCL_CONTROLLER=>GC_REPORT_NAME) USING SELECTION-SET pa_varid VIA SELECTION-SCREEN. WHEN 'VARSAVE'. LCL_VARIANT_UTILITY=>update( ). WHEN 'DOCUMENTATION'. CALL FUNCTION 'CALL_BROWSER' EXPORTING URL = 'http://abapcadabra.com' "/index.php/interfacing/files/548-erasing-files' EXCEPTIONS OTHERS = 0. endcase. * _____ _ _ _ _ _ _ _ * \_ \_ __ (_) |_(_) __ _| (_)______ _| |_(_) ___ _ __ * / /\/ '_ \| | __| |/ _` | | |_ / _` | __| |/ _ \| '_ \ * /\/ /_ | | | | | |_| | (_| | | |/ / (_| | |_| | (_) | | | | * \____/ |_| |_|_|\__|_|\__,_|_|_/___\__,_|\__|_|\___/|_| |_| INITIALIZATION. lbl_titl = 'Inventory/group title'. icon01 = icon02 = icon03 = icon04 = icon05 = icon06 = icon07 = icon08 = icon09 = icon10 = icon11 = icon12 = icon13 = icon14 = icon15 = icon16 = icon17 = icon18 = icon19 = icon20 = '@MJ@'. CALL FUNCTION 'ICON_CREATE' EXPORTING NAME = ICON_PROCESS_CALLBACK TEXT = '' INFO = 'Change options, as administrator' IMPORTING RESULT = admtxt EXCEPTIONS OTHERS = 0. CALL FUNCTION 'ICON_CREATE' EXPORTING NAME = ICON_MESSAGE_INFORMATION_SMALL TEXT = '' INFO = 'Documentation: visit AbapcadabrA.com' IMPORTING RESULT = doctxt EXCEPTIONS OTHERS = 0. lbl_menu = 'Show menu pull-down'. lbl_mena = 'Include this menu in menu pull-down'. lbl_shoa = 'Show administrator button'. lbl_abra = 'Show documentation link'. * __ _ _ __ __ _ _ _ * / _\ |_ __ _ _ __| |_ ___ / _| / _\ ___| | ___ ___| |_(_) ___ _ __ * \ \| __/ _` | '__| __|__ / _ \| |_ ___\ \ / _ \ |/ _ \/ __| __| |/ _ \| '_ \ * _\ \ || (_| | | | ||___| (_) | _|___|\ \ __/ | __/ (__| |_| | (_) | | | | * \__/\__\__,_|_| \__| \___/|_| \__/\___|_|\___|\___|\__|_|\___/|_| |_| START-OF-SELECTION. if pa_BLINK = abap_true. * Leave the program - we explicitly don't want to go back to the selection * screen as this report is to be called from the selection screen of other * reports. leave program. endif.