Code listing for: ZDTI_SYNTAXCHECK_REP

Description: Report

***********************************************************************************************************************
*
* Author          : Copyright (C) 2006 E.G.Mellodew
* program contact : www.dalestech.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*
***********************************************************************************************************************
* ZDTI_SYNTAXCHECK_REP... Reporting routines
*----------------------------------------------------------------------------------------------------------------------
* Version  Correction Number  Date Changed  Changed By        Description
* ---------------------------------------------------------------------------------------------------------------------
* 1.0                                       Ed Mellodew       Original version
*
***********************************************************************************************************************

* ---------------------------------------------------------------------------------------------------------------------
* module status0100....
* ---------------------------------------------------------------------------------------------------------------------
module initScreen0100 output.

  set pf-status 'ZGUI_REPORT'.
  set titlebar 'ZTITLE_REPORT'.

  if not iMessages[] is initial.
    if objSplitter is initial.
      create object objSplitter exporting parent = cl_gui_container=>DEFAULT_SCREEN
                                          rows = 2
                                          columns = 1
                                exceptions cntl_error = 1
                                           cntl_system_error = 2
                                           others = 3 .
       if sy-subrc = 0.
*        Get the top container reference and create the grid instance
         objTopContainer = objSplitter->get_container( row = 1 column =  1 ).
         create object objAlvGridResults exporting i_parent = objTopContainer
                                         exceptions error_cntl_create = 1
                                                    error_cntl_init = 2
                                                    error_cntl_link = 3
                                                    error_dp_create = 4
                                                    others = 5 .
        if sy-subrc = 0.
          case 'X'.
           when rbProg.
              perform displayPrograms using iProgramDetails[]
                                            iProgFieldCatalogue[].
            when rbFunc.
              perform displayFuncs using iFuncDetails[]
                                         iFuncFieldCatalogue[].
            when rbClass.
              perform displayClasses using iClassDetails[]
                                           iClassFieldCatalogue[].
          endcase.
        endif.

*        Get the bottom container reference and create the grid instance
         objBottomContainer = objSplitter->get_container( row = 2 column =  1 ).
         create object objAlvGridMessages exporting i_parent = objBottomContainer
                                          exceptions error_cntl_create = 1
                                                     error_cntl_init = 2
                                                     error_cntl_link = 3
                                                     error_dp_create = 4
                                                     others = 5 .
        if sy-subrc = 0.
          iAlvMessages[] = iMessages[].
          perform displayMessages using iAlvMessages[]
                                        iMessFieldCatalogue[]
                                        objMessEventReceiver.                                        .
        endif.
      endif.
    endif.
  else.
*   Only display the programs grid.
    create object objAlvGridResults exporting i_parent = cl_gui_container=>DEFAULT_SCREEN
                                    exceptions error_cntl_create = 1
                                               error_cntl_init = 2
                                               error_cntl_link = 3
                                               error_dp_create = 4
                                               others = 5 .

    case 'X'.
      when rbProg.
        perform displayPrograms using iProgramDetails[]
                                      iProgFieldCatalogue[].
      when rbFunc.
        perform displayFuncs using iFuncDetails[]
                                   iFuncFieldCatalogue[].
      when rbClass.
        perform displayClasses using iClassDetails[]
                                     iClassFieldCatalogue[].
    endcase.
  endif.
endmodule.

* ---------------------------------------------------------------------------------------------------------------------
* module userCommand...
* ---------------------------------------------------------------------------------------------------------------------
module userCommand0100 input.

  case okCode.
    when 'BACK' or 'ENDE' or 'CANC'.
      set screen 0.
      leave screen.
  endcase.
endmodule.

* ---------------------------------------------------------------------------------------------------------------------
* displayPrograms...  Display the report on the screen
* ---------------------------------------------------------------------------------------------------------------------
form displayPrograms using iLocProgDetails like iProgramDetails[]
                           iLocProgFieldCatalogue like iProgFieldCatalogue[].

data: layoutForGrid1 type lvc_s_layo.
data: variantToUse type disvariant.
data: objEventReceiver type ref to clsEventReceiver.
data: iExcludeToolbar type ui_functions.

  if iLocProgFieldCatalogue is initial.
*   Set the grid title.
    layoutForGrid1-grid_title = ''.
    layoutForGrid1-cwidth_opt = 'X'.
    layoutForGrid1-zebra = 'X'.
    layoutForGrid1-excp_fname = 'ALVSTATUS'.
    layoutForGrid1-excp_led = 'X'.

*    Set the variant to use on the grid.
     variantToUse-report = sy-repid.

*    We do not want the edit toolbar showing
     append cl_gui_alv_grid=>MC_FG_EDIT to iExcludeToolbar.

*    Retrieve the field catalogue
     perform getFieldCatalogue using iLocProgFieldCatalogue[]
                                     'ZDTS_PROGRAMDETAILS'.

     perform modifyProgCatalogue using iLocProgFieldCatalogue[].
   endif.

*  Instantiate the receiver event class
   if objEventReceiver is initial.
     create object objEventReceiver.
     set handler objEventReceiver->user_command for objAlvGridResults.
     set handler objEventReceiver->toolbar for objAlvGridResults.
     set handler objEventReceiver->context_menu_request for objAlvGridResults.
     set handler objEventReceiver->hotspot_click for objAlvGridResults.
     set handler objEventReceiver->menu_button for objAlvGridResults.
   endif.

   objAlvGridResults->set_table_for_first_display( exporting i_structure_name = 'ZDTS_PROGRAMDETAILS'
                                                             is_layout = layoutForGrid1
                                                             is_variant = variantToUse
                                                             i_save = 'A'
                                                             it_toolbar_excluding = iExcludeToolbar[]
                                                   changing it_outtab = iLocProgDetails[]
                                                            it_fieldCatalog = iLocProgFieldCatalogue[] ).

*   Set the current focus onto the grid
    cl_gui_control=>set_focus( exporting control = objAlvGridResults ).
endform.

* ---------------------------------------------------------------------------------------------------------------------
* displayFuncs...  Display the report on the screen
* ---------------------------------------------------------------------------------------------------------------------
form displayFuncs using iLocFuncDetails like iFuncDetails[]
                        iLocFieldCatalogue like iFuncFieldCatalogue[].

data: layoutForGrid1 type lvc_s_layo.
data: variantToUse type disvariant.
data: objEventReceiver type ref to clsEventReceiver.
data: iExcludeToolbar type ui_functions.

  if iLocFieldCatalogue is initial.
*   Set the grid title.
    layoutForGrid1-grid_title = ''.
    layoutForGrid1-cwidth_opt = 'X'.
    layoutForGrid1-zebra = 'X'.
    layoutForGrid1-excp_fname = 'ALVSTATUS'.
    layoutForGrid1-excp_led = 'X'.

*    Set the variant to use on the grid.
     variantToUse-report = sy-repid.

*    We do not want the edit toolbar showing
     append cl_gui_alv_grid=>MC_FG_EDIT to iExcludeToolbar.

*    Retrieve the field catalogue
     perform getFieldCatalogue using iLocFieldCatalogue[]
                                     'ZDTS_FUNCDETAILS'.

     perform modifyFuncCatalogue using iLocFieldCatalogue[].
   endif.

*  Instantiate the receiver event class
   if objEventReceiver is initial.
     create object objEventReceiver.
     set handler objEventReceiver->user_command for objAlvGridResults.
     set handler objEventReceiver->toolbar for objAlvGridResults.
     set handler objEventReceiver->context_menu_request for objAlvGridResults.
     set handler objEventReceiver->hotspot_click for objAlvGridResults.
     set handler objEventReceiver->menu_button for objAlvGridResults.
   endif.

   objAlvGridResults->set_table_for_first_display( exporting i_structure_name = 'ZDTS_FUNCDETAILS'
                                                             is_layout = layoutForGrid1
                                                             is_variant = variantToUse
                                                             i_save = 'A'
                                                             it_toolbar_excluding = iExcludeToolbar[]
                                                   changing it_outtab = iLocFuncDetails[]
                                                            it_fieldCatalog = iLocFieldCatalogue[] ).

*   Set the current focus onto the grid
    cl_gui_control=>set_focus( exporting control = objAlvGridResults ).
endform.

* ---------------------------------------------------------------------------------------------------------------------
* displayClasses...  Display the report on the screen
* ---------------------------------------------------------------------------------------------------------------------
form displayClasses using iLocClassDetails like iClassDetails[]
                          iLocFieldCatalogue like iClassFieldCatalogue[].

data: layoutForGrid1 type lvc_s_layo.
data: variantToUse type disvariant.
data: objEventReceiver type ref to clsEventReceiver.
data: iExcludeToolbar type ui_functions.

  if iLocFieldCatalogue is initial.
*   Set the grid title.
    layoutForGrid1-grid_title = ''.
    layoutForGrid1-cwidth_opt = 'X'.
    layoutForGrid1-zebra = 'X'.
    layoutForGrid1-excp_fname = 'ALVSTATUS'.
    layoutForGrid1-excp_led = 'X'.

*    Set the variant to use on the grid.
     variantToUse-report = sy-repid.

*    We do not want the edit toolbar showing
     append cl_gui_alv_grid=>MC_FG_EDIT to iExcludeToolbar.

*    Retrieve the field catalogue
     perform getFieldCatalogue using iLocFieldCatalogue[]
                                     'ZDTS_CLASSDETAILS'.

     perform modifyClassCatalogue using iLocFieldCatalogue[].
   endif.

*  Instantiate the receiver event class
   if objEventReceiver is initial.
     create object objEventReceiver.
     set handler objEventReceiver->user_command for objAlvGridResults.
     set handler objEventReceiver->toolbar for objAlvGridResults.
     set handler objEventReceiver->context_menu_request for objAlvGridResults.
     set handler objEventReceiver->hotspot_click for objAlvGridResults.
     set handler objEventReceiver->menu_button for objAlvGridResults.
   endif.

   objAlvGridResults->set_table_for_first_display( exporting i_structure_name = 'ZDTS_CLASSDETAILS'
                                                             is_layout = layoutForGrid1
                                                             is_variant = variantToUse
                                                             i_save = 'A'
                                                             it_toolbar_excluding = iExcludeToolbar[]
                                                   changing it_outtab = iLocClassDetails[]
                                                            it_fieldCatalog = iLocFieldCatalogue[] ).

*   Set the current focus onto the grid
    cl_gui_control=>set_focus( exporting control = objAlvGridResults ).
endform.


* ---------------------------------------------------------------------------------------------------------------------
* displayMessages...  Display the report on the screen
* ---------------------------------------------------------------------------------------------------------------------
form displayMessages using iLocMessages like iMessages[]
                           iLocMessFieldCatalogue like iMessFieldCatalogue[]
                           objLocMessEventReceiver type ref to clsEventReceiver.

data: layoutForGrid1 type lvc_s_layo.
data: variantToUse type disvariant.
data: iExcludeToolbar type ui_functions.

*   Set the grid title.
    layoutForGrid1-grid_title = text-004.
    layoutForGrid1-cwidth_opt = 'X'.
    layoutForGrid1-zebra = 'X'.
    layoutForGrid1-excp_fname = 'ALVSTATUS'.
    layoutForGrid1-excp_led = 'X'.
    layoutForGrid1-smallTitle = 'X'.

*   Set the variant to use on the grid.
    variantToUse-report = sy-repid.

*   We do not want the edit toolbar showing
    append cl_gui_alv_grid=>MC_FG_EDIT to iExcludeToolbar.

  if iLocMessFieldCatalogue[] is initial.
*   Retrieve the field catalogue
    perform getFieldCatalogue using iLocMessFieldCatalogue[]
                                    'ZDTS_SYNTAXMESSAGE'.

    perform modifyMessCatalogue using iLocMessFieldCatalogue[].
  endif.

*  Instantiate the receiver event class
   if objLocMessEventReceiver is initial.
     create object objMessEventReceiver.
     set handler objLocMessEventReceiver->double_click for objAlvGridMessages.
   endif.

  objAlvGridMessages->set_table_for_first_display( exporting i_structure_name = 'ZDTS_SYNTAXMESSAGE'
                                                             is_layout = layoutForGrid1
                                                             is_variant = variantToUse
                                                             i_save = 'A'
                                                             it_toolbar_excluding = iExcludeToolbar[]
                                                   changing it_outtab = iLocMessages[]
                                                            it_fieldCatalog = iLocMessFieldCatalogue[] ).
endform.