<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ALV Object model dump when calling method cl_salv_table-set_data by button in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-object-model-dump-when-calling-method-cl-salv-table-set-data-by-button/m-p/3392199#M814504</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Herbert, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry, i havent seen your posting. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I only set a new okcode in this event so that i come into PAI and check the new okcode:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;class lcl_handle_events_post implementation.
  method on_user_command.
    data:
      rc         type sysubrc.

    b_list_button = true.
    call method cl_gui_cfw=&amp;gt;set_new_ok_code
      exporting
        new_code = e_salv_function
      importing
        rc       = rc.

  endmethod. "on_user_command
endclass. "lcl_handle_events IMPLEMENTATION


module init_alv output.

* PBO is sent by function when pressing button in OO ALV
* to set new table assignment to OO ALV.
  if b_list_button = true.
    perform:
      alv_fill_top,
      alv_oo_fill_bottom.
...

form alv_oo_fill_bottom.
  if ref_salvtab_post is initial.
...
  else.

    try.
        ref_salvtab_post-&amp;gt;set_data(
          changing t_table = &amp;lt;lv_tab&amp;gt; ).
      catch cx_salv_no_new_data_allowed.
    endtry.

    ref_salvset_post-&amp;gt;set_list_header( lv_header ).
    ref_salvcols_post = ref_salvtab_post-&amp;gt;get_columns( ).
    ref_salvcols_post-&amp;gt;set_optimize( true ).

    case v_list_type.
      when const_total.
        perform alv_oo_rename_cols.

      when const_lines.
        perform alv_oo_rename_col_name using:
           'TYPE' text-a15 text-a16.
    endcase.

    free ref_salfun_post.
    ref_salfun_post   = ref_salvtab_post-&amp;gt;get_functions( ).
    ref_salfun_post-&amp;gt;set_all( ).

* enable / disable functions
    perform alv_oo_functions_status_set
      using ref_salfun_post.

    if b_color_table = true.
      try.
          ref_salvcols_post-&amp;gt;set_color_column( 'COLOR' ).
        catch cx_salv_data_error.
      endtry.
    endif.
    ref_salvtab_post-&amp;gt;refresh( refresh_mode = if_salv_c_refresh=&amp;gt;soft ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards Wolfgang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Oct 2008 15:08:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-08T15:08:47Z</dc:date>
    <item>
      <title>ALV Object model dump when calling method cl_salv_table-set_data by button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-object-model-dump-when-calling-method-cl-salv-table-set-data-by-button/m-p/3392197#M814502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have 2 container with 2 OO ALV. In one of this Grids i like to change the assigned internal table data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i do this with pushbuttons from the Dynrpo Gui status, it is running.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if i add Pushbuttons via method (-&amp;gt;add_function) in one of the ALV grids and try to change table assignment in the event method, i get a dump raising CX_SALV_NO_NEW_DATA_ALLOWED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In debugging i saw, that in case of calling the method via ALV pushbutton the attribute &amp;lt;function_call_active&amp;gt; is true, therefore no change in ALV is allowed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if r_adapter-&amp;gt;function_call_active eq abap_true.&lt;/P&gt;&lt;P&gt;    value = abap_false.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My method to change ALV assigning:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class lcl_handle_events_post implementation.&lt;/P&gt;&lt;P&gt;  method on_user_command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data:&lt;/P&gt;&lt;P&gt;      lv_header  type lvc_title.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    field-symbols:&lt;/P&gt;&lt;P&gt;      &amp;lt;lv_tab&amp;gt; type any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    case e_salv_function.&lt;/P&gt;&lt;P&gt;      when 'IFRS'.&lt;/P&gt;&lt;P&gt;        v_list_type = const_ifrs.&lt;/P&gt;&lt;P&gt;        assign t_ledger_ifrs  to &amp;lt;lv_tab&amp;gt;.&lt;/P&gt;&lt;P&gt;        lv_header = text-ifr.&lt;/P&gt;&lt;P&gt;      when 'LOCAL'.&lt;/P&gt;&lt;P&gt;        v_list_type = const_local.&lt;/P&gt;&lt;P&gt;        assign t_ledger_local to &amp;lt;lv_tab&amp;gt;.&lt;/P&gt;&lt;P&gt;        lv_header = text-lcl.&lt;/P&gt;&lt;P&gt;      when 'TOTAL'.&lt;/P&gt;&lt;P&gt;        v_list_type = const_total.&lt;/P&gt;&lt;P&gt;        assign t_ledger_total to &amp;lt;lv_tab&amp;gt;.&lt;/P&gt;&lt;P&gt;        lv_header = text-tot.&lt;/P&gt;&lt;P&gt;      when 'POST'.&lt;/P&gt;&lt;P&gt;        v_list_type = const_post.&lt;/P&gt;&lt;P&gt;        assign t_posting      to &amp;lt;lv_tab&amp;gt;.&lt;/P&gt;&lt;P&gt;        lv_header = text-pst.&lt;/P&gt;&lt;P&gt;    endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ref_salvset_post-&amp;gt;set_list_header( lv_header ).&lt;/P&gt;&lt;P&gt;    try.&lt;/P&gt;&lt;P&gt;        ref_salvtab_post-&amp;gt;set_data(&lt;/P&gt;&lt;P&gt;          changing t_table = &amp;lt;lv_tab&amp;gt; ).&lt;/P&gt;&lt;P&gt;      catch cx_salv_no_new_data_allowed.&lt;/P&gt;&lt;P&gt;    endtry.&lt;/P&gt;&lt;P&gt;    ref_salvtab_post-&amp;gt;refresh( refresh_mode = if_salv_c_refresh=&amp;gt;soft ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endmethod. "on_user_command&lt;/P&gt;&lt;P&gt;endclass. "lcl_handle_events IMPLEMENTATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anybody idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wolfgang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2008 13:10:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-object-model-dump-when-calling-method-cl-salv-table-set-data-by-button/m-p/3392197#M814502</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-22T13:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Object model dump when calling method cl_salv_table-set_data by button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-object-model-dump-when-calling-method-cl-salv-table-set-data-by-button/m-p/3392198#M814503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Wolfgang,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did you solve this problem? Doku of CL_SALV_TABLE-&amp;gt;SET_DATA says that it is not allowed in eventhandler. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing the same problem and tried to display new data in second grid with method REFRESH( full ) but it does not work. The grid does not change...&lt;/P&gt;&lt;P&gt;If you have a solution, please post it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Herbert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 09:46:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-object-model-dump-when-calling-method-cl-salv-table-set-data-by-button/m-p/3392198#M814503</guid>
      <dc:creator>103343</dc:creator>
      <dc:date>2008-04-17T09:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Object model dump when calling method cl_salv_table-set_data by button</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-object-model-dump-when-calling-method-cl-salv-table-set-data-by-button/m-p/3392199#M814504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Herbert, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry, i havent seen your posting. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I only set a new okcode in this event so that i come into PAI and check the new okcode:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;class lcl_handle_events_post implementation.
  method on_user_command.
    data:
      rc         type sysubrc.

    b_list_button = true.
    call method cl_gui_cfw=&amp;gt;set_new_ok_code
      exporting
        new_code = e_salv_function
      importing
        rc       = rc.

  endmethod. "on_user_command
endclass. "lcl_handle_events IMPLEMENTATION


module init_alv output.

* PBO is sent by function when pressing button in OO ALV
* to set new table assignment to OO ALV.
  if b_list_button = true.
    perform:
      alv_fill_top,
      alv_oo_fill_bottom.
...

form alv_oo_fill_bottom.
  if ref_salvtab_post is initial.
...
  else.

    try.
        ref_salvtab_post-&amp;gt;set_data(
          changing t_table = &amp;lt;lv_tab&amp;gt; ).
      catch cx_salv_no_new_data_allowed.
    endtry.

    ref_salvset_post-&amp;gt;set_list_header( lv_header ).
    ref_salvcols_post = ref_salvtab_post-&amp;gt;get_columns( ).
    ref_salvcols_post-&amp;gt;set_optimize( true ).

    case v_list_type.
      when const_total.
        perform alv_oo_rename_cols.

      when const_lines.
        perform alv_oo_rename_col_name using:
           'TYPE' text-a15 text-a16.
    endcase.

    free ref_salfun_post.
    ref_salfun_post   = ref_salvtab_post-&amp;gt;get_functions( ).
    ref_salfun_post-&amp;gt;set_all( ).

* enable / disable functions
    perform alv_oo_functions_status_set
      using ref_salfun_post.

    if b_color_table = true.
      try.
          ref_salvcols_post-&amp;gt;set_color_column( 'COLOR' ).
        catch cx_salv_data_error.
      endtry.
    endif.
    ref_salvtab_post-&amp;gt;refresh( refresh_mode = if_salv_c_refresh=&amp;gt;soft ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards Wolfgang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 15:08:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-object-model-dump-when-calling-method-cl-salv-table-set-data-by-button/m-p/3392199#M814504</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-08T15:08:47Z</dc:date>
    </item>
  </channel>
</rss>

