English 中文(简体)
ALV Grid工具bar在全屏幕上失踪
原标题:ALV Grid toolbar is missing in fullscreen

I ve created a simple ALV grid and populated the grid with data, now the grid is displayed after the selection screen. I m not using custom container and display the grid in full screen.

Is there a property of ALV grid object that enables toolbar with buttons filter, sort, etc, that is normally on top of the grid?

到目前为止,这是我拥有的:

TRY.
  cl_salv_table=>factory(
    IMPORTING
      r_salv_table   = gr_alv
    CHANGING
      t_table        = tbl_data
      ).
CATCH cx_salv_msg.
ENDTRY.

* initialize the alv settings - nothing done here for the moment.
PERFORM define_settings USING gr_alv.

* Display the ALV
gr_alv->display( ).
最佳回答

每一ALV功能作为单独的CLLASS在简单的ALV中执行,因此你必须单独处理。 你不需要习俗控制。

为了增加工具障碍:

data: lr_func TYPE REF TO CL_SALV_FUNCTIONS_LIST.
"Functions
lr_func = gr_alv->get_functions( ).
lr_func->set_all( ).

完整的ALV显示:

form display_results.

  data: ls_key        type salv_s_layout_key,

        lo_table      type ref to cl_salv_table,
        lo_cols       type ref to cl_salv_columns_table,
        lo_events     type ref to cl_salv_events_table,
        lo_funcs      type ref to cl_salv_functions_list,
        lo_layout     type ref to cl_salv_layout,
        lo_display    type ref to cl_salv_display_settings,
        lo_selections type ref to cl_salv_selections.

  try.
      call method cl_salv_table=>factory
        exporting
          list_display = abap_false
        importing
          r_salv_table = lo_table
        changing
          t_table      = gt_list.
    catch cx_salv_msg .                                 "#EC NO_HANDLER
  endtry.
  "Events
  create object go_events.
  lo_events = lo_table->get_event( ).
  set handler go_events->double_click for lo_events.

  "Layouts
  ls_key-report = sy-repid.
  lo_layout = lo_table->get_layout( ).
  lo_layout->set_key( ls_key ).
  lo_layout->set_default( abap_true ).
  lo_layout->set_save_restriction( ).
  lo_layout->set_initial_layout( p_var ).

  lo_cols = lo_table->get_columns( ).
  perform change_columns changing lo_cols.

  "Functions
  lo_funcs = lo_table->get_functions( ).
  lo_funcs->set_all( ).

  "Display Settings
  lo_display = lo_table->get_display_settings( ).
  lo_display->set_striped_pattern( abap_true ).

  "Selections
  lo_selections = lo_table->get_selections( ).
  lo_selections->set_selection_mode( if_salv_c_selection_mode=>row_column ).

  lo_table->display( ).
endform.                   " DISPLAY_RESULTS
问题回答

在你使用ALV物体模型时,这首先令人困惑。 如果你以完全筛选的方式使用ALV,那么你就必须在你的节目中援引德国马克的地位,并利用SET_SCREEN_。 STATUS 载于您的电网。 在SAP求助网站here上作了解释。

它有助于复制SALV_TABLE_ashDARD从功能类别SALV_METADATA_STATUS获得的地位。 在你的报告中,作为起点,你可以取消你不需要的任何职能。 例如,如果你将现状作为ALV_方案加以复制的话。 页: 1

gr_alv->set_screen_status( report   = sy-repid
                           pfstatus =  ALV_STATUS  ).

如果你想要使用按类别划分的设置杀伤人员地雷功能的模式,你就必须将电网标放在一个定制集装箱内。

你们需要做的事情是获得CL_SALV_FUNCTIONS-LIST。 摘自您的电网物体:

data: lr_func TYPE REF TO CL_SALV_FUNCTIONS_LIST.
lr_func = gr_alv->get_functions( ).
lr_func->set_all( ).

但从那里看,你似乎需要做一点工作。 我的建议:查阅关于CL_SALV_TABLE和CL_SALV_FUNCTIONS_LIST的文件 (即,当你在SSE24交易中显示这一类别时,点击文件纽芬兰。) 后者完全告诉你需要做什么。

(Also, a small hint: Put You加权逻辑,因为如果初始化失败,你可以追捕这一例外,但继续试图用一种方法处理未经证实的或未开始的类别。)

  • add a customer container to your gui
  • create an object of the class cl_gui_custom_container and supply the name of your container
  • create an instance of the class cl_gui_alv_grid and supply the custom container object
  • use the method set_table_for_first_display

这将为所有县展示工具。 您可以控制在工具箱中你想要的电离层(IT_TOOLBAR_EXCLUDING)参数到固定的“表_for_first_display方法”。





相关问题
Helicopterview of ABAP [closed]

I don t know a thing about ABAP, apart from it has an OO side, and I would like to have some kind of helicopterview of it before I start to look at it in detail. I know I can find all of this when ...

How to round a sum for the swiss currency (francs)

here in switzerland our currency is francs and the smallest coin is 5 centimes which is 0.05 francs. what is the best way to round amounts to be payable with our money using the programming language ...

ABAP select performance hints?

Are there general ABAP-specific tips related to performance of big SELECT queries? In particular, is it possible to close once and for all the question of FOR ALL ENTRIES IN vs JOIN?

Determine current MM periods?

The standard SAP MM advice is that only two periods can be open simultaneously. How to determine them from within the program (FM to call/table to read)?

ABAP create object

Below is a code snippet that is creating object. Form userexit_save_document_prepare. data: /bks/exitmanager type ref to /bks/exit_manager. create object /bks/exitmanager exporting ...

Parsing XML with other solution than XSLT

My company is working on a project that needs to read XML files within ABAP. When the XML file has no data for a particular tag it omits that data. Some tags are self closing. e.g. <tag /> The ...

热门标签