Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

Dear all,

below is description how to enhance standard classes to get Detail popup displaying the blank fields.

Class CL_SALV_CONTROLLER_METADATA

--------------------------------------------------------------------

Method COMPLETE_METADATA_SLIS_TO_LVC() – Post-Exit

    if r_display_settings is bound.
      s_layout
-detailinit = r_display_settings->get_detail_initial( ).
   
endif
.

Endmethod.

Method GET_SLIS_LAYOUT – Post-Exit.

  if r_display_settings is bound.
    s_layout
-detail_initial_lines = r_display_settings->get_detail_initial( ).
  endif
.

Endmethod.

Method GET_LVC_LAYOUT – Post-Exit.

    if r_display_settings is bound.
      s_layout
-detailinit = r_display_settings->get_detail_initial( ).
   
endif
.

Endmethod.

Class CL_SALV_DISPLAY_SETTINGS

--------------------------------------------------------------------

Description: Create new enhancement and create below attribute with GET and SET methods.

Instance Private: DETAIL_INITIAL type LVC_DETINI default FALSE

Public Methods:

Method GET_DETAIL_INITIAL.

  result = detail_initial.

Endmethod.

Method SET_DETAIL_INITIAL.

  if detail_initial ne i_value.

    detail_initial = i_value.

if r_controller is bound.
  r_controller
->set_changed(
  name       
= name
  ref          = me
  flavour     
= if_salv_c_changelist_flavour=>setter
  refresh_mode
= if_salv_c_refresh=>soft
  method      = 'SET_DETAIL_INITIAL' ).
endif.
endif.

Endmethod.

Usage:

data: mo_salv_table    type ref to cl_salv_table.

data: mt_result        type tt_result.

    call method cl_salv_table=>factory
      exporting
        list_display
= abap_false
      importing
        r_salv_table
= mo_salv_table
      changing
        t_table     
= mt_result.

    lr_display_settings = mo_salv_table->get_display_settings( ).
    lr_display_settings
->set_list_header( l_title ).
    lr_display_settings
->set_detail_initial( abap_true ).  “ Enhanced method
    mo_salv_table
->display
( ).

Then after press of Detail icon (the first icon in below image) on ALV report, you will also see empty fields in the Detail popup.

2 Comments