TEST ALV in SAP[BCALV

    技术2022-05-19  30

    SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L1S31 { font-style: italic; color: #808080; } .L1S32 { color: #3399FF; } .L1S33 { color: #4DA619; } .L1S52 { color: #0000FF; } *&---------------------------------------------------------------------* *& Report  BCALV_TEST_GRID_EDITABLE                                    * *&                                                                     * *&---------------------------------------------------------------------* *&                                                                     * *&                                                                     * *&---------------------------------------------------------------------* report  bcalv_test_grid_editable. types: g_ty_s_sflight type alv_t_t2. constants: con_sflight type lvc_fname value 'ALV_T_T2'. *----------------------------------------------------------------------* * DATA                                                                 * *----------------------------------------------------------------------* include <icon>. include <symbol>. class lcl_events_d0100 definition deferred. types: g_ty_t_icon  type standard table of icon,        g_ty_t_icont type standard table of icont,        begin of g_ty_s_onf4,          register        type char1,          get_before      type char1,          change_after    type char1,          internal_format type char1,        end   of g_ty_s_onf4,        begin of g_ty_s_test,          select_amount     type i,          only_db_info      type char1,          no_info_popup     type char1,          info_popup_once   type char1,          events_info_popup type lvc_fname occurs 0,          edit_type         type i,          edit_mode         type i,          edit_event        type i,          edit_fields       type lvc_fname occurs 0,          no_row_ins        type char1,          no_row_move       type char1,          onf4              type g_ty_s_onf4,          onf4_fields       type lvc_fname occurs 0,          excp_group        type char1,          excp_amount       type i,          excp_condense     type char1,          excp_led          type char1,          layo_selection    type char1,          layo_no_rowmark   type char1,          bypassing_buffer  type char1,          buffer_active     type char1,        end   of g_ty_s_test,        begin of g_ty_s_outtab. include type g_ty_s_sflight. types:   checkbox             type char1,          box                  type char1,          lights               type char1,          handle_style         type lvc_t_styl,          handle_hlink         type lvc_s_hype-handle,          handle_drdn          type lvc_s_drop-handle,          char(10)             type c,          string               type string,          int1                 type int1,          int2                 type int2,          int4                 type i,          numc(10)             type n,          dec(10)              type p decimals 2,          fltp                 type f,          dats                 type d,          tims                 type t,          icon                 type icon-id,          icon_qinfo           type icon-name,          symbol               type icon-id,          hotspot              type string,          hyperlink            type string,          button               type string,          dropdown_f4          type i,        end   of g_ty_s_outtab,        g_ty_t_outtab type table of g_ty_s_outtab. constants: con_exit type sy-ucomm value 'EXIT',            con_canc type sy-ucomm value 'CANC',            con_back type sy-ucomm value 'BACK',            con_save type sy-ucomm value 'SAVE',            con_true     type char1 value 'X',            con_on       type char1 value '1',            con_off      type char1 value '0',            con_edit_grid         type i value 1,            con_edit_column       type i value 2,            con_edit_cell         type i value 3,            con_edit_mode_display type i value 1,            con_edit_mode_change  type i value 2,            con_edit_event_enter  type i value 1,            con_edit_event_modify type i value 2. data: g_field type lvc_s_fcat-fieldname. data: g_okcode type sy-ucomm. data: gs_test type g_ty_s_test. data: gt_outtab            type g_ty_t_outtab,       gr_container_d0100   type ref to cl_gui_custom_container,       gr_grid_d0100        type ref to cl_gui_alv_grid,       gr_events_d0100      type ref to lcl_events_d0100. *---------------------------------------------------------------------* *       CLASS lcl_events_d0100 DEFINITION *---------------------------------------------------------------------* * *---------------------------------------------------------------------* class lcl_events_d0100 definition.   public section.     methods:     double_click         for event double_click                          of cl_gui_alv_grid                          importing e_row                                    e_column                                    es_row_no, "#EC CALLED     hotspot_click        for event hotspot_click                          of cl_gui_alv_grid                          importing e_row_id                                    e_column_id                                    es_row_no, "#EC CALLED     button_click         for event button_click                          of cl_gui_alv_grid                          importing es_col_id                                    es_row_no, "#EC CALLED     data_changed         for event data_changed                          of cl_gui_alv_grid                          importing er_data_changed                                    e_onf4                                    e_onf4_before                                    e_onf4_after, "#EC CALLED     data_changed_finished                          for event data_changed_finished                          of cl_gui_alv_grid. "#EC CALLED endclass.                    "lcl_events_d0100 DEFINITION *---------------------------------------------------------------------* *       CLASS lcl_events_d0100 IMPLEMENTATION *---------------------------------------------------------------------* * *---------------------------------------------------------------------* class lcl_events_d0100 implementation. *---------------------------------------------------------------------* *       METHOD double_click                                           * *---------------------------------------------------------------------* *       ........                                                      * *---------------------------------------------------------------------*   method double_click.     perform d0100_event_double_click using e_row                                            e_column.   endmethod.                    "double_click *---------------------------------------------------------------------* *       METHOD hotspot_click                                          * *---------------------------------------------------------------------* *       ........                                                      * *---------------------------------------------------------------------*   method hotspot_click.     perform d0100_event_hotspot_click using e_row_id                                             e_column_id.   endmethod.                    "hotspot_click *---------------------------------------------------------------------* *       METHOD button_click                                           * *---------------------------------------------------------------------* *       ........                                                      * *---------------------------------------------------------------------*   method button_click.     perform d0100_event_button_click using es_col_id                                            es_row_no.   endmethod.                    "button_click   method data_changed.     perform d0100_event_data_changed using er_data_changed                                            e_onf4                                            e_onf4_before                                            e_onf4_after.   endmethod.                    "data_changed   method data_changed_finished.     perform d0100_event_data_changed_finis.   endmethod.                    "data_changed_finished endclass.                    "lcl_events_d0100 IMPLEMENTATION *---------------------------------------------------------------------* *       CLASS random DEFINITION *---------------------------------------------------------------------* * *---------------------------------------------------------------------* class random definition.   public section.     types:       value(16type p decimals 0,       numcv(15type n.     constants:       max type random=>value value 4294967295.     class-methods: *   computes a random natural number from the set {0, ..., random=>max}.       number returning value(rval) type random=>value, *   computes a random character from the set {A-Za-z0-9}       c returning value(rval) type char01, *   computes a random string consisting of "len" random characters       string importing len type i              returning value(rval) type string, *   computes a date       dats returning value(rval) type d, *   computes a time       time returning value(rval) type t, *   computes a random numc from the set {low, ..., high}       numc importing low type random=>numcv high type random=>numcv         returning value(rval) type random=>numcv, *   computes a random integer from the set {low, ..., high}       i importing low type i high type i         returning value(rval) type i, *   computes a random integer from the set {low, ..., high}       int2 importing low type int2 high type int2            returning value(rval) type int2, *   computes a random integer from the set {low, ..., high}       int1 importing low type int1 high type int1            returning value(rval) type int1, *   computes a random float from the interval [low ; high]       f importing low type f high type f         returning value(rval) type f, *   computes a random character from the set {A-F0-9}       hex returning value(rval) type char01, *   computes a random character from the set {0-1}       x returning value(rval) type char01, *   method "random=>class_constructor"       class_constructor.   private section.     class-data: *   precomputed maximal index (= string length - 1) of "random=>chars" *   or of "random=>x_data".       charsmax type i,       xmax type i, *   random number seed value. *   (Used in method "random=>number".)       seed type random=>value.     constants: *   characters for class-method "random=>hex"       hex_data(100type c value 'ABCDEF' &                                  '0123456789', *   characters for class-method "random=>x"       x_data(100type c value '01', *   characters for class-metshod "random=>c"       chars(100type c value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' &                               'abcdefghijklmnopqrstuvwxyz' &                               '0123456789'. endclass.                    "random DEFINITION *---------------------------------------------------------------------* *       CLASS random IMPLEMENTATION *---------------------------------------------------------------------* * *---------------------------------------------------------------------* class random implementation. * implementation of the methods for randomizing the values   method x.     data: ri type i.     ri = random=>i( low = 0  high = random=>xmax ).     move x_data+ri(1to rval.   endmethod.                    "x   method hex.     data: ri type i.     ri = random=>i( low = 0  high = random=>charsmax ).     move hex_data+ri(1to rval.   endmethod.                    "hex   method number.     constants:       a(3type p  value 67301,        " Coefficient       c(1type p  value 1,            " Increment       m(6type p  value 4294967296.   " Modulus 2**32     random=>seed = ( a * random=>seed + c ) mod m.     rval = random=>seed.   endmethod.                    "number   method c.     data:       ri type i.     ri = random=>i( low = 0  high = random=>charsmax ).     move chars+ri(1to rval.   endmethod.                    "c   method string.     data:       char(1type c.     clear rval.     do len times.       char = random=>c( ).       concatenate rval char into rval.     enddo.   endmethod.                    "string   method dats.     data: l_date      type sy-datum,           l_day(2)    type n,           l_month(2)  type n,           l_year(4)   type n,           l_value     type random=>numcv,           l_low       type random=>numcv,           l_high      type random=>numcv.     l_year  = sy-datum+0(4).     l_low   = l_year - 5.     l_high  = l_year + 5.     l_value = random=>numc( low = l_low high = l_high ).     l_year  = l_value+11(4).     l_value = random=>numc( low = 1 high = 12 ).     l_month = l_value+13(2).     case l_month.       when 2.         l_high = 28.       when 4 or 6 or 9 or 11.         l_high = 30.       when others.         l_high = 31.     endcase.     l_value = random=>numc( low = 1 high = l_high ).     l_day   = l_value+13(2).     l_date+0(4) = l_year.     l_date+4(2) = l_month.     l_date+6(2) = l_day.     rval = l_date.   endmethod.                    "dats   method time.     data: l_time      type t,           l_hour(2)   type n,           l_min(2)    type n,           l_sec(2)    type n,           l_value     type random=>numcv.     l_value = random=>numc( low = 0 high = 60 ).     l_sec   = l_value+13(2).     l_value = random=>numc( low = 0 high = 60 ).     l_min   = l_value+13(2).     l_value = random=>numc( low = 1 high = 24 ).     l_hour  = l_value+13(2).     l_time+0(2) = l_hour.     l_time+2(2) = l_min.     l_time+4(2) = l_sec.     rval = l_time.   endmethod"time   method numc. *   Go from {0,...,random=>max} to {low,...,high} with ABAP rounding     data: l_dec(16)   type p,           l_char(16)  type c.     l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max            + '0.5'.     subtract 1 from l_dec.     add low to l_dec.     data: lr_type_descr  type ref to cl_abap_typedescr,           lr_elem_descr  type ref to cl_abap_elemdescr.     lr_type_descr =              cl_abap_typedescr=>describe_by_data( rval ).     lr_elem_descr ?= lr_type_descr.     l_char = l_dec.     shift l_char left deleting leading space.     rval = l_char+0(lr_elem_descr->output_length).   endmethod.                    "i   method i. *   Go from {0,...,random=>max} to {low,...,high} with ABAP rounding     data: l_dec(16)   type p,           l_char(16)  type c.     l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max            + '0.5'.     subtract 1 from l_dec.     add low to l_dec.     data: lr_type_descr  type ref to cl_abap_typedescr,           lr_elem_descr  type ref to cl_abap_elemdescr.     lr_type_descr =              cl_abap_typedescr=>describe_by_data( rval ).     lr_elem_descr ?= lr_type_descr.     l_char = l_dec.     shift l_char left deleting leading space.     rval = l_char+0(lr_elem_descr->output_length).   endmethod.                    "i   method int2. *   Go from {0,...,random=>max} to {low,...,high} with ABAP rounding     data: l_dec(16)   type p,           l_char(16)  type c.     l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max            + '0.5'.     subtract 1 from l_dec.     add low to l_dec.     data: lr_type_descr  type ref to cl_abap_typedescr,           lr_elem_descr  type ref to cl_abap_elemdescr.     lr_type_descr =              cl_abap_typedescr=>describe_by_data( rval ).     lr_elem_descr ?= lr_type_descr.     l_char = l_dec.     shift l_char left deleting leading space.     rval = l_char+0(lr_elem_descr->output_length).   endmethod.                    "i   method int1. *   Go from {0,...,random=>max} to {low,...,high} with ABAP rounding     data: l_dec(16)   type p,           l_char(16)  type c.     l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max            + '0.5'.     subtract 1 from l_dec.     add low to l_dec.     data: lr_type_descr  type ref to cl_abap_typedescr,           lr_elem_descr  type ref to cl_abap_elemdescr.     lr_type_descr =              cl_abap_typedescr=>describe_by_data( rval ).     lr_elem_descr ?= lr_type_descr.     l_char = l_dec.     shift l_char left deleting leading space.     rval = l_char+0(lr_elem_descr->output_length).   endmethod.                    "i   method f. *   Go from {0,...,random=>max} to [low;high]     rval = ( ( high - low ) * random=>number( ) ) / random=>max            + low.   endmethod.                    "f   method class_constructor.     charsmax = strlen( chars ) - 1.     xmax = strlen( x_data ) - 1.     seed = 1.   endmethod.                    "class_constructor endclass.                    "random IMPLEMENTATION *----------------------------------------------------------------------* * SELECTION-SCREEN                                                     * *----------------------------------------------------------------------* selection-screen begin of block gen with frame. parameters: p_amount type i default 30, p_dbinfo as checkbox. selection-screen end of block gen. selection-screen begin of block inf with frame. parameters: p_inf01 as checkbox default con_true, p_inf02 as checkbox. selection-screen end of block inf. selection-screen begin of block sel with frame title text-sel. parameters: p_sel01 as checkbox"NO ROWMARK p_sel02 radiobutton group sel, "SINGLE SELECTION p_sel03 radiobutton group sel, "MULTI SELECTION p_sel04 radiobutton group sel, "CELL SELECTION p_sel05 radiobutton group sel. "ROW/COL SELECTION selection-screen end of block sel. selection-screen begin of block ed1 with frame. parameters: p_grid   radiobutton group edit default 'X', p_cols   radiobutton group edit. select-options: p_colsf for g_field no intervals default 'CARRID'. parameters: p_cells  radiobutton group edit. select-options: p_cellsf for g_field no intervals default 'CARRID'. parameters: p_noedit radiobutton group edit. selection-screen   end of block ed1. selection-screen begin of block ed2 with frame. parameters: p_change radiobutton group tgle default 'X', p_disp   radiobutton group tgle. selection-screen   end of block ed2. selection-screen begin of block ed3 with frame. parameters: p_evedit radiobutton group eevt default 'X', p_evmod  radiobutton group eevt, p_noevt  radiobutton group eevt. selection-screen   end of block ed3. selection-screen begin of block ed4 with frame. parameters: p_rowins as checkbox default space, p_norwmv as checkbox default space. selection-screen   end of block ed4. selection-screen begin of block of4 with frame. parameters: p_regf4 as checkbox. select-options: p_onf4 for g_field no intervals default 'CARRID'. selection-screen begin of line. selection-screen comment 5(30text-c01 for field p_f401. parameters: p_f401 as checkbox default con_true. "REGISTER selection-screen end of line. selection-screen begin of line. selection-screen comment 5(30text-c02 for field p_f402. parameters: p_f402 as checkbox"GET_BEFORE selection-screen end of line. selection-screen begin of line. selection-screen comment 5(30text-c03 for field p_f403. parameters: p_f403 as checkbox"CHANGE_AFTER selection-screen end of line. selection-screen begin of line. selection-screen comment 5(30text-c04 for field p_f404. parameters: p_f404 as checkbox"INTERNAL_FORMAT selection-screen end of line. selection-screen end of block of4. selection-screen begin of block exp with frame. parameters: p_excp01 radiobutton group excp, p_excp02 radiobutton group excp, p_excp03 radiobutton group excp, p_excp04 radiobutton group excp, p_excp05 radiobutton group excp, p_excp06 radiobutton group excp, p_excp07 radiobutton group excp. parameters: p_excp_c as checkbox, p_excp_l as checkbox. selection-screen end of block exp. *----------------------------------------------------------------------* * AT SELECTION-SCREEN ON VALUE-REQUEST                                 * *----------------------------------------------------------------------* at selection-screen on value-request for p_colsf-low.   perform d0100_f4_fcode  changing p_colsf-low. at selection-screen on value-request for p_cellsf-low.   perform d0100_f4_fcode changing p_cellsf-low. at selection-screen on value-request for p_onf4-low.   perform d0100_f4_fcode changing p_onf4-low. *----------------------------------------------------------------------* * START-OF-SELECTION                                                   * *----------------------------------------------------------------------* start-of-selection.   gs_test-select_amount = p_amount.   gs_test-only_db_info  = p_dbinfo.   gs_test-no_info_popup   = p_inf01.   gs_test-info_popup_once = p_inf02.   gs_test-layo_no_rowmark   = p_sel01.   case con_true.     when p_sel02.       gs_test-layo_selection    = 'B'.     when p_sel03.       gs_test-layo_selection    = 'C'.     when p_sel04.       gs_test-layo_selection    = 'D'.     when p_sel05.       gs_test-layo_selection    = 'A'.   endcase.   case con_true.     when p_grid.       gs_test-edit_type     = con_edit_grid.     when p_cols.       gs_test-edit_type     = con_edit_column.       loop at p_colsf.         if not p_colsf-low is initial.           append p_colsf-low to gs_test-edit_fields.         endif.       endloop.     when p_cells.       gs_test-edit_type     = con_edit_cell.       loop at p_cellsf.         if not p_cellsf-low is initial.           append p_cellsf-low to gs_test-edit_fields.         endif.       endloop.   endcase.   case con_true.     when p_disp.       gs_test-edit_mode     = con_edit_mode_display.     when p_change.       gs_test-edit_mode     = con_edit_mode_change.   endcase.   case con_true.     when p_evedit.       gs_test-edit_event    = con_edit_event_enter.     when p_evmod.       gs_test-edit_event    = con_edit_event_modify.   endcase.   gs_test-no_row_ins  = p_rowins.   gs_test-no_row_move = p_norwmv.   if p_regf4 eq con_true.     loop at p_onf4.       if not p_onf4-low is initial.         append p_onf4-low to gs_test-onf4_fields.       endif.     endloop.   endif.   gs_test-onf4-register        = p_f401.   gs_test-onf4-get_before      = p_f402.   gs_test-onf4-change_after    = p_f403.   gs_test-onf4-internal_format = p_f404.   case con_true.     when p_excp01.       gs_test-excp_group    = '1'.       gs_test-excp_amount   = 4.     when p_excp02.       gs_test-excp_group    = '2'.       gs_test-excp_amount   = 4.     when p_excp03.       gs_test-excp_group    = '3'.       gs_test-excp_amount   = 4.     when p_excp04.       gs_test-excp_group    = '4'.       gs_test-excp_amount   = 5.     when p_excp05.       gs_test-excp_group    = '5'.       gs_test-excp_amount   = 5.     when p_excp06.       gs_test-excp_group    = '6'.       gs_test-excp_amount   = 3.     when p_excp07.       gs_test-excp_group    = '7'.       gs_test-excp_amount   = 3.   endcase.   gs_test-excp_condense = p_excp_c.   gs_test-excp_led      = p_excp_l.   gs_test-bypassing_buffer = space.   gs_test-buffer_active    = space. *----------------------------------------------------------------------* * END-OF-SELECTION                                                     * *----------------------------------------------------------------------* end-of-selection.   call screen 100. *&---------------------------------------------------------------------* *&      Module  d0100_set_status  OUTPUT *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* module d0100_set_status output.   perform d0100_set_status. endmodule.                 " d0100_set_status  OUTPUT *&---------------------------------------------------------------------* *&      Module  d0100_prepare_container  OUTPUT *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* module d0100_prepare_container output.   perform d0100_prepare_container. endmodule.                 " d0100_prepare_container  OUTPUT *&---------------------------------------------------------------------* *&      Module  d0100_exit  INPUT *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* module d0100_exit input.   perform d0100_exit. endmodule.                 " d0100_exit  INPUT *&---------------------------------------------------------------------* *&      Module  d0100_fcode  INPUT *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* module d0100_fcode input.   perform d0100_fcode. endmodule.                 " d0100_fcode  INPUT *&---------------------------------------------------------------------* *&      Form  d0100_set_status *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_set_status .   typesbegin of l_ty_s_excl,            func type syucomm,          end   of l_ty_s_excl,          l_ty_t_excl type standard table of l_ty_s_excl.   data: lt_excl type l_ty_t_excl.   set pf-status 'D0100' excluding lt_excl.   set titlebar 'D0100'. endform.                    " d0100_set_status *&---------------------------------------------------------------------* *&      Form  d0100_prepare_container *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_prepare_container .   data: lt_fcat             type lvc_t_fcat,         ls_layo             type lvc_s_layo,         ls_vari             type disvariant,         ls_prnt             type lvc_s_prnt,         lt_hype             type lvc_t_hype,         l_consistency_check type char1.   if gr_container_d0100 is initial.     if cl_gui_alv_grid=>offline( ) is initial.       create object gr_container_d0100                     exporting container_name = 'D0100_CONTAINER'.     endif.     create object gr_grid_d0100                   exporting i_parent = gr_container_d0100.     perform d0100_get_outtab.     perform d0100_set_grid_vari changing ls_vari.     perform d0100_set_grid_layo changing ls_layo.     perform d0100_set_grid_fcat changing lt_fcat.     perform d0100_set_grid_hype changing lt_fcat                                          lt_hype.     perform d0100_set_grid_drdn changing lt_fcat.     perform d0100_set_grid_butt changing lt_fcat.     perform d0100_set_grid_onf4.     perform d0100_set_grid_events.     perform d0100_set_grid_edit changing ls_layo                                          lt_fcat.     ls_prnt-grpchgedit = con_true.     call method gr_grid_d0100->set_table_for_first_display       exporting         i_buffer_active     = gs_test-buffer_active         i_bypassing_buffer  = gs_test-bypassing_buffer         i_consistency_check = l_consistency_check         is_variant          = ls_vari         i_save              = 'A'         i_default           = con_true         is_layout           = ls_layo         is_print            = ls_prnt         it_hyperlink        = lt_hype       changing         it_outtab           = gt_outtab[]         it_fieldcatalog     = lt_fcat.   endif. endform.                    " d0100_prepare_container *&---------------------------------------------------------------------* *&      Form  d0100_exit *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_exit .   data: l_okcode like sy-ucomm.   l_okcode = g_okcode.   clear g_okcode.   case l_okcode.     when con_exit or con_back or con_canc.       call method gr_grid_d0100->free.       call method gr_container_d0100->free.       call method cl_gui_cfw=>flush.       clear gr_container_d0100.       clear gr_grid_d0100.       clear gr_events_d0100.       set screen 0.       leave screen.   endcase. endform.                    " d0100_exit *&---------------------------------------------------------------------* *&      Form  d0100_fcode *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_fcode .   data: l_okcode like sy-ucomm.   l_okcode = g_okcode.   clear g_okcode.   case l_okcode.     when con_exit or con_back or con_canc.       g_okcode = l_okcode.       perform d0100_exit.     when con_save.       call method gr_grid_d0100->check_changed_data.     when 'TOGGLE'.                                          "#EC NOTEXT       data: l_edit type i.       case gs_test-edit_mode.         when con_edit_mode_change.           gs_test-edit_mode = con_edit_mode_display.           l_edit            = con_off.         when con_edit_mode_display.           gs_test-edit_mode = con_edit_mode_change.           l_edit            = con_on.       endcase.       call method gr_grid_d0100->set_ready_for_input         exporting           i_ready_for_input = l_edit.   endcase. endform.                    " d0100_fcode *&---------------------------------------------------------------------* *&      Form  d0100_set_grid_vari *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_set_grid_vari changing cs_vari type disvariant.   cs_vari-report      = sy-repid.   cs_vari-handle      = space.   cs_vari-log_group   = space.   cs_vari-username    = space.   cs_vari-variant     = space.   cs_vari-text        = space.   cs_vari-dependvars  = space. endform.                    " d0100_set_grid_vari *&---------------------------------------------------------------------* *&      Form  d0100_set_grid_layo *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_set_grid_layo  changing cs_layo type lvc_s_layo. *... ALV-Control: Allgemeine Anzeigeoptionen   cs_layo-stylefname  = space.   cs_layo-cwidth_opt  = con_true.   cs_layo-zebra       = space.   cs_layo-smalltitle  = space.   cs_layo-graphics    = space.   cs_layo-frontend    = space.   cs_layo-template    = space. *... ALV-Control: Gridcustomizing   cs_layo-no_colexpd  = space.   cs_layo-no_hgridln  = space.   cs_layo-no_vgridln  = space.   cs_layo-no_rowmark  = gs_test-layo_no_rowmark.   cs_layo-no_headers  = space.   cs_layo-no_merging  = space.   cs_layo-grid_title  = space.   cs_layo-no_toolbar  = space.   cs_layo-sel_mode    = gs_test-layo_selection.   cs_layo-box_fname   = 'BOX'.   cs_layo-sgl_clk_hd  = space. *... ALV-Control: Summenoptionen   cs_layo-totals_bef  = space.   cs_layo-no_totline  = space.   cs_layo-numc_total  = con_true.   cs_layo-no_utsplit  = space. *... ALV-Control: Exceptions   cs_layo-excp_group  = gs_test-excp_group.   cs_layo-excp_fname  = 'LIGHTS'.   cs_layo-excp_rolln  = space.   cs_layo-excp_conds  = gs_test-excp_condense.   cs_layo-excp_led    = gs_test-excp_led. *... ALV-Control: Steuerung Interaktion   cs_layo-detailinit  = space.   cs_layo-detailtitl  = space.   cs_layo-keyhot      = space.   cs_layo-no_keyfix   = space.   cs_layo-no_author   = space.   clear cs_layo-s_dragdrop. *... ALV-Control: Farben   cs_layo-info_fname  = space.   cs_layo-ctab_fname  = space. *... ALV-Control: Eingabefähigkeit   cs_layo-edit        = space.   cs_layo-edit_mode   = space.   cs_layo-no_rowins   = space.   cs_layo-no_rowmove  = space. *... ALV-Control: Web-Optionen   cs_layo-weblook     = space.   cs_layo-webstyle    = space.   cs_layo-webrows     = space.   cs_layo-webxwidth   = space.   cs_layo-webxheight  = space. endform.                    " d0100_set_grid_layo *&---------------------------------------------------------------------* *&      Form  d0100_set_grid_fcat *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_set_grid_fcat changing ct_fcat type lvc_t_fcat.   data: ls_fcat type lvc_s_fcat,         l_lin   type i.   call function 'LVC_FIELDCATALOG_MERGE'     exporting       i_buffer_active        = gs_test-buffer_active       i_structure_name       = con_sflight       i_client_never_display = con_true       i_bypassing_buffer     = gs_test-bypassing_buffer     changing       ct_fieldcat            = ct_fcat[]     exceptions       inconsistent_interface = 1       program_error          = 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.   check gs_test-only_db_info eq space.   describe table ct_fcat lines l_lin.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'CHECKBOX'.   ls_fcat-checkbox  = con_true.   ls_fcat-inttype   = 'C'.   ls_fcat-datatype  = 'CHAR'.   ls_fcat-intlen    = 1.   ls_fcat-col_pos   = l_lin.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'CHAR'.   ls_fcat-inttype   = 'C'.   ls_fcat-intlen    = 10.   ls_fcat-col_pos   = l_lin.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'STRING'.   ls_fcat-inttype   = 'g'.   ls_fcat-intlen    = 10.   ls_fcat-outputlen = 10.   ls_fcat-col_pos   = l_lin.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'INT1'.   ls_fcat-inttype   = 'b'.   ls_fcat-intlen    = 3.   ls_fcat-col_pos   = l_lin.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'INT2'.   ls_fcat-inttype   = 's'.   ls_fcat-intlen    = 5.   ls_fcat-col_pos   = l_lin.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'INT4'.   ls_fcat-inttype   = 'I'.   ls_fcat-intlen    = 10.   ls_fcat-col_pos   = l_lin.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'NUMC'.   ls_fcat-inttype   = 'N'.   ls_fcat-intlen    = 10.   ls_fcat-col_pos   = l_lin.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'DEC'.   ls_fcat-inttype   = 'P'.   ls_fcat-intlen    = 10.   ls_fcat-col_pos   = l_lin.   ls_fcat-decimals  = 2.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'FLTP'.   ls_fcat-inttype   = 'F'.   ls_fcat-intlen    = 10.   ls_fcat-col_pos   = l_lin.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'DATS'.   ls_fcat-inttype   = 'D'.   ls_fcat-intlen    = 8.   ls_fcat-col_pos   = l_lin.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'TIMS'.   ls_fcat-inttype   = 'T'.   ls_fcat-intlen    = 6.   ls_fcat-col_pos   = l_lin.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'ICON'.   ls_fcat-inttype   = 'C'.   ls_fcat-intlen    = 4.   ls_fcat-col_pos   = l_lin.   ls_fcat-icon      = con_true.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'ICON_QINFO'.   ls_fcat-inttype   = 'C'.   ls_fcat-intlen    = 30.   ls_fcat-outputlen = 4.   ls_fcat-col_pos   = l_lin.   ls_fcat-icon      = con_true.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'SYMBOL'.   ls_fcat-inttype   = 'C'.   ls_fcat-intlen    = 4.   ls_fcat-col_pos   = l_lin.   ls_fcat-symbol    = con_true.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'HOTSPOT'.   ls_fcat-inttype   = 'g'.   ls_fcat-intlen    = 10.   ls_fcat-col_pos   = l_lin. *  ls_fcat-hotspot   = con_true. *... oder   ls_fcat-style     = cl_gui_alv_grid=>mc_style_hotspot.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'BUTTON'.   ls_fcat-inttype   = 'g'.   ls_fcat-intlen    = 10.   ls_fcat-col_pos   = l_lin.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'HYPERLINK'.   ls_fcat-inttype   = 'g'.   ls_fcat-intlen    = 10.   ls_fcat-col_pos   = l_lin.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   add 1 to l_lin.   clear ls_fcat.   ls_fcat-tabname   = '1'.   ls_fcat-fieldname = 'DROPDOWN_F4'.   ls_fcat-inttype   = 'I'.   ls_fcat-intlen    = 10.   ls_fcat-col_pos   = l_lin.   ls_fcat-scrtext_s = ls_fcat-fieldname.   ls_fcat-scrtext_m = ls_fcat-fieldname.   ls_fcat-scrtext_l = ls_fcat-fieldname.   append ls_fcat to ct_fcat.   clear ls_fcat.   ls_fcat-no_init_ch = con_true.   modify ct_fcat from ls_fcat transporting no_init_ch                  where no_init_ch eq space. endform.                    " d0100_set_grid_fcat *&---------------------------------------------------------------------* *&      Form  d0100_set_grid_hype *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_set_grid_hype changing ct_fcat type lvc_t_fcat                                   ct_hype type lvc_t_hype.   field-symbols: <ls_outtab> type g_ty_s_outtab,                  <ls_fcat>   type lvc_s_fcat.   data: ls_hype type lvc_s_hype,         l_href  type lvc_s_hype-href.   define mac_get_hype.     add 1 to ls_hype-handle.     ls_hype-href   = &1.     append ls_hype to ct_hype.   end-of-definition.   mac_get_hype 'http://www.aa.com'.   mac_get_hype 'http://www.airberlin.com'.   mac_get_hype 'http://www.aircanda.ca'.   mac_get_hype 'http://www.airfrance.ca'.   mac_get_hype 'http://www.alitalia.it'.   mac_get_hype 'http://www.british-airways.com'.   mac_get_hype 'http://www.continental.com'.   mac_get_hype 'http://www.delta-air.com'.   mac_get_hype 'http://www.airpacific.com'.   mac_get_hype 'http://www.jal.co.jp'.   mac_get_hype 'http://www.lufthansa.com'.   mac_get_hype 'http://www.laudaair.com'.   mac_get_hype 'http://www.nwa.com'.   mac_get_hype 'http://www.gantas.com.au'.   mac_get_hype 'http://www.saa.co.za.de'.   mac_get_hype 'http://www.singaporeair.com'.   mac_get_hype 'http://www.swissair.com'.   mac_get_hype 'http://www.ual.com'. *... auf Zellenebene *    In Feldkatalog wird für das entsprechende Zelle der Ausgabetabelle *    in der ein Link erfolgen soll WEB_FIELD mit dem Wert der Spalte der *    Ausgabetabelle gesetzt, welches den Handle beinhalten soll   read table ct_fcat assigning <ls_fcat>              with key fieldname = 'HYPERLINK'.   if sy-subrc eq 0.     <ls_fcat>-web_field = 'HANDLE_HLINK'.   endif.   loop at gt_outtab assigning <ls_outtab>.     l_href = <ls_outtab>-hyperlink.     read table ct_hype into ls_hype                with key href = l_href.     if sy-subrc eq 0.       <ls_outtab>-handle_hlink = ls_hype-handle.     endif.   endloop. endform.                    " d0100_set_grid_hype *&---------------------------------------------------------------------* *&      Form  d0100_set_grid_drdn *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_set_grid_drdn changing ct_fcat type lvc_t_fcat.   field-symbols: <ls_outtab> type g_ty_s_outtab,                  <ls_fcat>   type lvc_s_fcat.   data: lt_drdn type lvc_t_drop,                            "#EC NEEDED         ls_drdn type lvc_s_drop,                            "#EC NEEDED         lt_dral type lvc_t_dral,                            "#EC NEEDED         ls_dral type lvc_s_dral,                            "#EC NEEDED         l_count type i.   define mac_get_drdn.     ls_drdn-handle  = 1.     ls_drdn-value   = &1.     append ls_drdn to lt_drdn.     add 1 to l_count.     ls_dral-handle    = 1.     ls_dral-value     = &1.     write l_count to ls_dral-int_value left-justified.     append ls_dral to lt_dral.   end-of-definition.   mac_get_drdn 'http://www.aa.com'.   mac_get_drdn 'http://www.airberlin.com'.   mac_get_drdn 'http://www.aircanda.ca'.   mac_get_drdn 'http://www.airfrance.ca'.   mac_get_drdn 'http://www.alitalia.it'.   mac_get_drdn 'http://www.british-airways.com'.   mac_get_drdn 'http://www.continental.com'.   mac_get_drdn 'http://www.delta-air.com'.   mac_get_drdn 'http://www.airpacific.com'.   mac_get_drdn 'http://www.jal.co.jp'.   mac_get_drdn 'http://www.lufthansa.com'.   mac_get_drdn 'http://www.laudaair.com'.   mac_get_drdn 'http://www.nwa.com'.   mac_get_drdn 'http://www.gantas.com.au'.   mac_get_drdn 'http://www.saa.co.za.de'.   mac_get_drdn 'http://www.singaporeair.com'.   mac_get_drdn 'http://www.swissair.com'.   mac_get_drdn 'http://www.ual.com'.   call method gr_grid_d0100->set_drop_down_table     exporting       it_drop_down_alias = lt_dral. *... auf Spaltenebene *    In Feldkatalog wird für das entsprechende Spalte der Ausgabetabelle *    in der ein Link erfolgen soll HREF_HDNL mit handle der Link gefüllt   read table ct_fcat assigning <ls_fcat>              with key fieldname = 'DROPDOWN_F4'.   if sy-subrc eq 0.     <ls_fcat>-drdn_field = 'HANDLE_DRDN'.     <ls_fcat>-drdn_alias = con_true.   endif.   loop at gt_outtab assigning <ls_outtab>.     <ls_outtab>-handle_drdn = 1.   endloop. endform.                    " d0100_set_grid_drdn *&---------------------------------------------------------------------* *&      Form  d0100_set_grid_butt *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_set_grid_butt changing ct_fcat type lvc_t_fcat.   field-symbols: <ls_fcat>   type lvc_s_fcat. *... Spalten *    In Feldkatalog wird für entsprechende Spalte das Feld STYLE mit *    StyleInformation gefuellt   read table ct_fcat assigning <ls_fcat>              with key fieldname = 'BUTTON'.   if sy-subrc eq 0.     <ls_fcat>-style =        <ls_fcat>-style + cl_gui_alv_grid=>mc_style_button.   endif. endform.                    " d0100_set_grid_butt *&---------------------------------------------------------------------* *&      Form  d0100_set_grid_onf4 *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_set_grid_onf4 .   data: l_field type lvc_fname,         lt_f4   type lvc_t_f4,         ls_f4   type lvc_s_f4.   if gs_test-onf4 ne space.     loop at gs_test-onf4_fields into l_field.       ls_f4-fieldname  = l_field.       ls_f4-register   = gs_test-onf4-register.       ls_f4-getbefore  = gs_test-onf4-get_before.       ls_f4-chngeafter = gs_test-onf4-change_after.       ls_f4-internal   = gs_test-onf4-internal_format.       insert ls_f4 into table lt_f4.     endloop.   endif.   check not lt_f4 is initial.   call method gr_grid_d0100->register_f4_for_fields     exporting       it_f4 = lt_f4. endform.                    " d0100_set_grid_onf4 *&---------------------------------------------------------------------* *&      Form  d0100_set_grid_events *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_set_grid_events .   create object gr_events_d0100.   set handler gr_events_d0100->data_changed               for gr_grid_d0100. endform.                    " d0100_set_grid_events *&---------------------------------------------------------------------* *&      Form  d0100_set_grid_edit *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_set_grid_edit changing cs_layo type lvc_s_layo                                   ct_fcat type lvc_t_fcat.   field-symbols: <ls_fcat> type lvc_s_fcat.   data: ls_edit   type lvc_s_styl,         lt_edit   type lvc_t_styl,         ls_field  type lvc_fname,         ls_outtab type g_ty_s_outtab.   data: l_index   type i,         l_erg     type i.   case gs_test-edit_type.     when con_edit_grid. *... Grid Editerbar *    In Layout wird Feld EDIT auf 'X' gesetzt       cs_layo-edit = con_true.     when con_edit_column. *... Spalteneditierbar *    In Feldkatalog wird Feld EDIT auf 'X' gesetzt für Spalte CARRID       loop at gs_test-edit_fields into ls_field.         read table ct_fcat assigning <ls_fcat>                    with key fieldname = ls_field.         if sy-subrc eq 0.           <ls_fcat>-edit = con_true.         endif.       endloop.     when con_edit_cell. *... Zellen-Editierbar *    In Layout wird Feld SYTLEFNAME auf 'HANDLE_STYLE' gesetzt       cs_layo-stylefname = 'HANDLE_STYLE'.       loop at gt_outtab into ls_outtab.         l_index = sy-tabix.         l_erg   = l_index mod 2.         if l_erg eq 0.           loop at gs_test-edit_fields into ls_field.             ls_edit-fieldname = ls_field.             ls_edit-style     = cl_gui_alv_grid=>mc_style_enabled.             ls_edit-style2    = space.             ls_edit-style3    = space.             ls_edit-style4    = space.             ls_edit-maxlen    = 8.             insert ls_edit into table lt_edit.           endloop.           insert lines of lt_edit into table ls_outtab-handle_style.           modify gt_outtab index l_index from ls_outtab                            transporting handle_style.         endif.       endloop.     when others.       exit.   endcase.   case gs_test-edit_event.     when con_edit_event_enter. *... hiermit erfolgt eine Prüfung nach Eingabe wenn ENTER gedrückt wird       call method gr_grid_d0100->register_edit_event         exporting           i_event_id = cl_gui_alv_grid=>mc_evt_enter.     when con_edit_event_modify. *... hiermit erfolgt eine Prüfung nach jeder Änderung       call method gr_grid_d0100->register_edit_event         exporting           i_event_id = cl_gui_alv_grid=>mc_evt_modified.   endcase.   case gs_test-edit_mode.     when con_edit_mode_change. *... hier wird alles was editierbar sein kann auch editierbar gemacht       call method gr_grid_d0100->set_ready_for_input         exporting           i_ready_for_input = 1.     when con_edit_mode_display. *... hier wird alles was editierbar sein kann nicht editierbar gemacht       call method gr_grid_d0100->set_ready_for_input         exporting           i_ready_for_input = 0.   endcase.   cs_layo-no_rowins   = gs_test-no_row_ins.   cs_layo-no_rowmove  = gs_test-no_row_move. endform.                    " d0100_set_grid_edit *&---------------------------------------------------------------------* *&      Form  d0100_get_outtab *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_get_outtab .   field-symbols: <ls_outtab> type g_ty_s_outtab.   data: l_excp_mod  type i,         l_excp_div  type i,         l_excp_amnt type i value 4,         l_excp      type i.   data: lt_icon        type table of icon,         ls_icon        type icon,         lt_icont       type table of icont,         ls_icont       type icont,         lt_symbol      type table of icon,         ls_symbol      type icon,         lt_hype        type lvc_t_hype,         ls_hype        type lvc_s_hype,         lt_fcat        type lvc_t_fcat,         l_index_icon   type i,         l_index_symbol type i,         l_index_hype   type i.   l_excp_amnt = gs_test-excp_amount.   if gs_test-select_amount gt 0.     select * from (con_sflight) into corresponding fields                of table gt_outtab up to gs_test-select_amount rows                order by primary key.   endif.   gs_test-select_amount = sy-dbcnt.   perform d0100_set_grid_hype changing lt_fcat lt_hype.   perform d0100_get_icon      changing lt_icon lt_icont.   perform d0100_get_symbol    changing lt_symbol.   loop at gt_outtab assigning <ls_outtab>.     clear: ls_icon, ls_icont, ls_symbol, ls_hype. *... Exception     l_excp_mod = sy-tabix mod l_excp_amnt.     if l_excp_mod eq 0.       l_excp_div = 1.     else.       l_excp_div = 0.     endif.     l_excp = ( l_excp_amnt * l_excp_div ) + l_excp_mod.     if l_excp_amnt eq 4.       subtract 1 from l_excp.     endif.     <ls_outtab>-lights = l_excp.     add 1 to l_index_icon. *... Icon     read table lt_icon into ls_icon index l_index_icon.     if sy-subrc eq 0.       <ls_outtab>-icon = ls_icon-id.     else.       <ls_outtab>-icon = space.       clear l_index_icon.     endif. *... Icon with QuickInfo     read table lt_icont into ls_icont                with key langu = sy-langu                            id = ls_icon-id                binary search.     if sy-subrc eq 0.       concatenate ls_icont-id+0(3)                   '/Q'                   ls_icont-quickinfo                   '@'                   into <ls_outtab>-icon_qinfo.     else.       <ls_outtab>-icon_qinfo = space.     endif.     add 1 to l_index_symbol. *... Symbol     read table lt_symbol into ls_symbol index l_index_symbol.     if sy-subrc eq 0.       <ls_outtab>-symbol = ls_symbol-id.     else.       <ls_outtab>-symbol = space.       clear l_index_symbol.     endif. *... Button     <ls_outtab>-button = <ls_outtab>-icon_qinfo.     add 1 to l_index_hype. *... Hyperlink     read table lt_hype into ls_hype index l_index_hype.     if sy-subrc eq 0.       <ls_outtab>-hyperlink = ls_hype-href.     else.       <ls_outtab>-hyperlink = space.       clear l_index_hype.     endif. *... Hotspot     <ls_outtab>-hotspot = <ls_outtab>-hyperlink. *... Dropdown     <ls_outtab>-dropdown_f4 = ls_hype-handle. *... others     <ls_outtab>-char   = random=>string( len = 10 ).     <ls_outtab>-string = random=>string( len = 20 ).     <ls_outtab>-dats   = random=>dats( ).     <ls_outtab>-tims   = random=>time( ).     <ls_outtab>-numc   =                        random=>numc( low = 0 high = 9999999999 ).     <ls_outtab>-int4   =                        random=>i( low = -2147483648 high = 2147483647 ).     <ls_outtab>-int2   = random=>int2( low = -32768 high = 32767 ).     <ls_outtab>-int1   = random=>int1( low = 0 high = 255 ).     <ls_outtab>-fltp   =                        random=>f( low = -2147483648 high = 2147483647 ).   endloop. endform.                    " d0100_get_outtab *&---------------------------------------------------------------------* *&      Form  d0100_get_icon *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_get_icon changing ct_icon  type g_ty_t_icon                              ct_icont type g_ty_t_icont.   select * from icon into table ct_icon            up to gs_test-select_amount rows order by primary key.   select * from icont into table ct_icont            for all entries in ct_icon where id eq ct_icon-id            order by primary key. endform.                    " d0100_get_icon *&---------------------------------------------------------------------* *&      Form  d0100_get_symbol *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_get_symbol changing ct_symbol type g_ty_t_icon.   data: ls_symbol type icon.   define mac_get_symbol.     ls_symbol-id   = &2.     ls_symbol-name = &1.     append ls_symbol to ct_symbol.   end-of-definition.   mac_get_symbol sym_space              ' ' ."  SPACE   mac_get_symbol sym_plus_box           '!' ."  box with plus inside   mac_get_symbol sym_minus_box          '"' ."  box with minus inside   mac_get_symbol sym_plus_circle        '#' ."  circle with plus inside   mac_get_symbol sym_minus_circle       '$' ."  circle with minus inside   mac_get_symbol sym_filled_square      '%' ."  filled square   mac_get_symbol sym_half_filled_square '&' ."  half-filled square   mac_get_symbol sym_square            '''' ."  empty square   mac_get_symbol sym_filled_circle      '(' ."  filled circle   mac_get_symbol sym_half_filled_circle ')' ."  half-filled circle   mac_get_symbol sym_circle             '*' ."  empty circle   mac_get_symbol sym_filled_diamond     '+' ."  filled diamond   mac_get_symbol sym_diamond            ',' ."  empty diamond   mac_get_symbol sym_bold_x             '.' ."  diagonal cross (cancel)   mac_get_symbol sym_note               '/ '."  word balloon, note   mac_get_symbol sym_document           '0' ."  document   mac_get_symbol sym_checked_document   '1' ."  document with checkmark   mac_get_symbol sym_documents          '2 '."  double documents   mac_get_symbol sym_folder             '3 '."  folder   mac_get_symbol sym_plus_folder        '4 '."  folder with plus inside   mac_get_symbol sym_minus_folder       '5 '."  folder with minus inside   mac_get_symbol sym_open_folder        '6 '."  open folder   mac_get_symbol sym_bold_minus         '7' ."  bold minus sign   mac_get_symbol sym_bold_plus          '8' ."  bold plus sign   mac_get_symbol sym_checkbox           '9 '."  selected checkbox   mac_get_symbol sym_radiobutton        ': '."  selected radiobutton   mac_get_symbol sym_left_triangle      ';' ."  triangle pointing left   mac_get_symbol sym_right_triangle     '<' ."  triangle pointing right   mac_get_symbol sym_up_triangle        '=' ."  triangle pointing up   mac_get_symbol sym_down_triangle      '>' ."  triangle pointing down   mac_get_symbol sym_left_hand          '? '."  hand pointing left   mac_get_symbol sym_left_arrow         'A' ."  left arrow   mac_get_symbol sym_right_arrow        'B' ."  right arrow   mac_get_symbol sym_up_arrow           'C' ."  up arrow   mac_get_symbol sym_down_arrow         'D' ."  down arrow   mac_get_symbol sym_check_mark         'E' ."  check mark   mac_get_symbol sym_pencil             'F' ."  pencil   mac_get_symbol sym_glasses            'G '."  glasses   mac_get_symbol sym_locked             'H' ."  closed padlock   mac_get_symbol sym_unlocked           'I' ."  open padlock   mac_get_symbol sym_phone              'J '."  telephone   mac_get_symbol sym_printer            'K '."  printer   mac_get_symbol sym_fax                'L '."  fax machine   mac_get_symbol sym_asterisk           'M' ."  asterisk   mac_get_symbol sym_right_hand         'N '."  hand pointing right   mac_get_symbol sym_sorted_up          'O '."  sorted ascending   mac_get_symbol sym_sorted_down        'P '."  sorted descending   mac_get_symbol sym_cumulated          'Q '."  cumulated   mac_get_symbol sym_delete             'R' ."  delete mark   mac_get_symbol sym_executable         'S '."  executable   mac_get_symbol sym_workflow_item      'T '."  workflow-object   mac_get_symbol sym_caution            'U '."  caution   mac_get_symbol sym_flash              'V' ."  express, urgent   mac_get_symbol sym_large_square       'W '."  large empty square   mac_get_symbol sym_ellipsis           'X'"  ellipsis (...) endform.                    " d0100_get_symbol *&---------------------------------------------------------------------* *&      Form  d0100_f4_fcode *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_f4_fcode changing c_value type lvc_s_fcat-fieldname.   data: lt_fcat type lvc_t_fcat,         ls_fcat type lvc_s_fcat.   perform d0100_set_grid_fcat changing lt_fcat.   data: lt_values type table of seahlpres,         lt_fields type table of dfies,         lt_return type table of ddshretval,         ls_value  type seahlpres,         ls_field  type dfies,         ls_return type ddshretval.   clear ls_field.   ls_field-fieldname = 'FIELDNAME'.   ls_field-intlen    = 30.   ls_field-leng      = 30.   ls_field-outputlen = 30.   ls_field-scrtext_s = ls_field-fieldname.   ls_field-scrtext_m = ls_field-fieldname.   ls_field-scrtext_l = ls_field-fieldname.   ls_field-reptext   = ls_field-fieldname.   append ls_field to lt_fields.   loop at lt_fcat into ls_fcat where tech eq space.     ls_value-string = ls_fcat-fieldname.     append ls_value to lt_values.   endloop.   call function 'F4IF_INT_TABLE_VALUE_REQUEST'    exporting *     DDIC_STRUCTURE         = ' '      retfield               = 'FIELDNAME' *     PVALKEY                = ' ' *     DYNPPROG               = ' ' *     DYNPNR                 = ' ' *     DYNPROFIELD            = ' ' *     STEPL                  = 0 *     WINDOW_TITLE           = *     VALUE                  = ' ' *     VALUE_ORG              = 'C' *     MULTIPLE_CHOICE        = ' '      display                = space *     CALLBACK_PROGRAM       = ' ' *     CALLBACK_FORM          = ' '    tables      value_tab              = lt_values      field_tab              = lt_fields      return_tab             = lt_return *     DYNPFLD_MAPPING        =    exceptions      parameter_error        = 1      no_values_found        = 2      others                 = 3.   if sy-subrc <> 0 and sy-subrc ne 3.     message id sy-msgid type sy-msgty number sy-msgno             with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.   endif.   read table lt_return into ls_return              with key fieldname = 'FIELDNAME'.   if sy-subrc eq 0.     c_value = ls_return-fieldval.   endif. endform.                    " d0100_f4_fcode *&---------------------------------------------------------------------* *&      Form  d0100_event_data_changed *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_event_data_changed using er_data_changed                                     e_onf4                                     e_onf4_before                                     e_onf4_after.           "#EC *   data: l_text1 type string,         l_text2 type string,         l_text3 type string.   concatenate text-102 e_onf4 into l_text3.   concatenate text-100 e_onf4_before into l_text1.   concatenate text-101 e_onf4_after into l_text2.   data: l_event type lvc_fname.                             "#EC NEEDED   if gs_test-info_popup_once eq con_true.     read table gs_test-events_info_popup into l_event                with key table_line = 'DATA_CHANGED'.     if sy-subrc ne 0.       insert 'DATA_CHANGED'              into gs_test-events_info_popup index 1.       message i000(0k) with text-004                             l_text3                             l_text1                             l_text2.     endif.   elseif gs_test-no_info_popup eq space.     message i000(0k) with text-004                           l_text3                           l_text1                           l_text2.   endif. *... die Ausgabetabelle ist noch nicht aktualisiert *    hier sollen semantische Prüfungen zunächst erfolgen über *      er_data_changed->mt_good_cells *    Fehler können dann dem Fehlerprotokoll angehängt werden *      er_data_changed->add_protocol_entry *    Es darf an dieser Stelle kein Refresh erfolgen! endform.                    " d0100_event_data_changed *&---------------------------------------------------------------------* *&      Form  d0100_event_data_changed_finis *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_event_data_changed_finis .                       "#EC *   data: l_event type lvc_fname.                             "#EC NEEDED   if gs_test-info_popup_once eq con_true.     read table gs_test-events_info_popup into l_event                with key table_line = 'DATA_CHANGED_FINISHED'.     if sy-subrc ne 0.       insert 'DATA_CHANGED_FINISHED'              into gs_test-events_info_popup index 1.       message i000(0k) with text-005.     endif.   elseif gs_test-no_info_popup eq space.     message i000(0k) with text-005.   endif. *... die Ausgabetabelle ist nun aktualisiert endform.                    " d0100_event_data_changed_finis *&---------------------------------------------------------------------* *&      Form  d0100_event_double_click *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_event_double_click using e_row    type lvc_s_row                                     e_column type lvc_s_col."#EC *   data: l_text type string.   concatenate text-001               text-100 e_row-index               text-101 e_column-fieldname               into l_text separated by space.   data: l_event type lvc_fname.                             "#EC NEEDED   if gs_test-info_popup_once eq con_true.     read table gs_test-events_info_popup into l_event                with key table_line = 'DOUBLE_CLICK'.     if sy-subrc ne 0.       insert 'DOUBLE_CLICK' into gs_test-events_info_popup index 1.       message i000(0k) with l_text.     endif.   elseif gs_test-no_info_popup eq space.     message i000(0k) with l_text.   endif. endform.                    " d0100_event_double_click *&---------------------------------------------------------------------* *&      Form  d0100_event_hotspot_click *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_event_hotspot_click using e_row_id    type lvc_s_row                                      e_column_id type lvc_s_col."#EC *   data: l_text type string.   concatenate text-002               text-100 e_row_id-index               text-101 e_column_id-fieldname               into l_text separated by space.   data: l_event type lvc_fname.                             "#EC NEEDED   if gs_test-info_popup_once eq con_true.     read table gs_test-events_info_popup into l_event                with key table_line = 'HOTSPOT_CLICK'.     if sy-subrc ne 0.       insert 'HOTSPOT_CLICK' into gs_test-events_info_popup index 1.       message i000(0k) with l_text.     endif.   elseif gs_test-no_info_popup eq space.     message i000(0k) with l_text.   endif. endform.                    " d0100_event_hotspot_click *&---------------------------------------------------------------------* *&      Form  d0100_event_button_click *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* form d0100_event_button_click using es_col_id type lvc_s_col                                     es_row_no type lvc_s_roid."#EC *   data: l_text type string,         l_row  type char10.   l_row = es_row_no-row_id.   concatenate text-003               text-100 l_row               text-101 es_col_id-fieldname               into l_text separated by space.   data: l_event type lvc_fname.                             "#EC NEEDED   if gs_test-info_popup_once eq con_true.     read table gs_test-events_info_popup into l_event                with key table_line = 'BUTTON_CLICK'.     if sy-subrc ne 0.       insert 'BUTTON_CLICK' into gs_test-events_info_popup index 1.       message i000(0k) with l_text.     endif.   elseif gs_test-no_info_popup eq space.     message i000(0k) with l_text.   endif. endform.                    " d0100_event_button_click


    最新回复(0)