Enhance Cross dock Monitor (LXDCK) Selection Screen

Selection screen of Cross-Docking Monitor (Transaction LXDCK) displays first 10 fields by default. If the field user need is not in first 10 fields then users can add that to screen using ‘Select fields’ option. Or all fields can be displayed by default by setting up parameter LMON_ALL_SEL_FIELDS in user profile.

At our client location this transaction is used often and users most of the time needs material selection criteria. Unfortunately, material is not in first 10 fields and therefore every time user comes to this transaction they have to add field from ‘Select fields’ option. Setting up parameter LMON_ALL_SEL_FIELDS wasn’t a satisfactory solution as all fields then appear on screen with material toward the end of list which can only be reached using scroll bars.

LXDCK Enhancement

An elegant solution was required where default field on selection screen can be configured to appear by default which includes hiding some of first 10 fields and displaying other fields on report.

We created this solution using an implicit enhancement in subroutine BUILD_SEL_TABS of program RMONITORSEL_F05, a configuration table and class with logic to switch display property of fields based on configuration table.

Configuration table looks like this

LXDCK Enhancement

Using this table a field can be set to display or hide on each individual tabs. With these two rows in table we have material field displayed by default on ‘Inbound delivery’ and ‘Outbound delivery’ tabs.

LXDCK Enhancement

Implementation detail

Table

LXDCK Enhancement

Class

lxdck sap class enhancement attributes

lxdck sap class enhancement method

LXDCK Enhancement

METHOD modify_sel_tab.

IF me->configuration_data IS INITIAL .
SELECT *
INTO TABLE me->configuration_data
FROM zfld_con
WHERE appl = application .
ENDIF.

CASE application.
WHEN me->cross_docking .
me->cross_dock_screen_mod( CHANGING tab = tab ).
ENDCASE.

ENDMETHOD.

METHOD cross_dock_screen_mod.

FIELD-SYMBOLS : <fs_tab> TYPE lmont_tabpage     ,
<fs_con> TYPE zfld_con          ,
<fs_sel> TYPE lmont_field_ddic  ,
<fs_all> TYPE lmont_field_ddic  .

LOOP AT tab ASSIGNING <fs_tab> .

*   loop at configuratin table
LOOP AT me->configuration_data ASSIGNING <fs_con>
WHERE obcls = <fs_tab>-obcls AND
tab   = <fs_tab>-tab .

*     Action based on mode
CASE <fs_con>-zmode.
WHEN me->display_on.

*         If display required, then move field from allfields to selfields
READ TABLE <fs_tab>-allfields ASSIGNING <fs_all> WITH KEY field = <fs_con>-field .
IF sy-subrc = 0 .
APPEND INITIAL LINE TO <fs_tab>-selfields ASSIGNING <fs_sel> .
<fs_sel> = <fs_all> .
ENDIF.

WHEN me->display_off.
*         If display off then delete field from selfields table
READ TABLE <fs_tab>-selfields ASSIGNING <fs_sel> WITH KEY field = <fs_con>-field.
IF sy-subrc = 0 .
DELETE  <fs_tab>-selfields INDEX sy-tabix .
ENDIF .
ENDCASE.

ENDLOOP.
ENDLOOP . "LOOP AT tab ASSIGNING <fs_tab>

ENDMETHOD.

Implicit enhancement in report RMONITORSEL_F05

ENHANCEMENT 1  ZLXDCK_SCREEN_MOD.    "active version

*--------------------------------------------------------------------*
* Based on configuration table ZFLD_CON, this enhacement
* prepares selection screen for user
* Documentation : CLXDCK001
*--------------------------------------------------------------------*

DATA : ob_sel TYPE REF TO zcl_lxdck_screen_mod .

CREATE OBJECT ob_sel .
CALL METHOD ob_sel->modify_sel_tab
CHANGING
tab = gt_tabs.

ENDENHANCEMENT.
ENDFORM.                    "build_sel_tabs

Leave a Reply