Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8720

How to display ALV after Method 'SET_TABLE_FOR_FIRST_DISPLAY'

$
0
0

Hi to everyone,

 

It’s the first time I am using Method “SET_TABLE_FOR_FIRST_DISPLAY” and I would like to
know how to force the ALV to be displayed right after executing the method.

 

I’ve look at other discussions but I am more confused than anything else.

 

I was using the FM “REUSE_ALV_GRID_DISPLAY_LVC” and I was able to do some coding right
after it. I had some problems displaying some drop down field so that is why I switched
to Method “SET_TABLE_FOR_FIRST_DISPLAY”.

 

My coding was included in a BADI and I do not have much control on the PBO and PAI
modules.

 

       DATA: lt_dral TYPE lvc_t_dral,
            ls_dral
TYPE lvc_s_dral,
            g_grid 
TYPE REF TO cl_gui_alv_grid.

 

  CREATE OBJECT g_grid
   
EXPORTING
      i_parent
= cl_gui_container=>default_screen.

 

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
     
EXPORTING
        i_structure_name
= 'ZWM_REASON_MVT'
     
CHANGING
        ct_fieldcat     
= i_fieldcat_alv_lvc.

   
LOOP AT i_fieldcat_alv_lvc INTO wa_fieldcat_alv_lvc.
     
CASE wa_fieldcat_alv_lvc-fieldname.
       
WHEN 'GRUND'.
          wa_fieldcat_alv_lvc
-edit       = 'X'.
          wa_fieldcat_alv_lvc
-drdn_field = 'DROP_DOWN_HANDLE'.
          wa_fieldcat_alv_lvc
-drdn_alias = 'X'.
          wa_fieldcat_alv_lvc
-outputlen = 10.
     
ENDCASE.

     
MODIFY i_fieldcat_alv_lvc FROM wa_fieldcat_alv_lvc.
   
ENDLOOP.

    g_grid
->set_drop_down_table( it_drop_down_alias = lt_dral ).

   
CALL METHOD g_grid->set_table_for_first_display
     
EXPORTING
        i_structure_name             
= 'ZWM_REASON_MVT'
        is_layout                    
= gs_layout
     
CHANGING
        it_outtab                    
= gt_outtab
        it_fieldcatalog              
= i_fieldcat_alv_lvc
     
EXCEPTIONS
        invalid_parameter_combination
= 1
        program_error                
= 2
        too_many_lines               
= 3
       
OTHERS                        = 4.

   
CALL METHOD g_grid->set_ready_for_input
     
EXPORTING
        i_ready_for_input
= 1.

 

 

Please let me know what I should do to force the ALV display after the method is executed.

 

Thank you very much for providing any detailed help.

 

Sylvain


Viewing all articles
Browse latest Browse all 8720

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>