Quantcast
Channel: SCN : Document List - ABAP Development
Viewing all articles
Browse latest Browse all 935

Very simple ALV in pop-up window

$
0
0

Hello, colleagues!

It may be useful in everyday programming to use quick and simple solutions.

So, I wrote a function module 'Z_VERY_SIMPLE_ALV' which allows you to display an ALV grid in a pop-up window at railway speed.

Here you can see the FM:

FUNCTION z_very_simple_alv.

*"----------------------------------------------------------------------

*"*"Local interface:

*"  IMPORTING

*"    REFERENCE(I_START_COLUMN) TYPE  I DEFAULT 25

*"    REFERENCE(I_START_LINE) TYPE  I DEFAULT 6

*"    REFERENCE(I_END_COLUMN) TYPE  I DEFAULT 100

*"    REFERENCE(I_END_LINE) TYPE  I DEFAULT 10

*"    REFERENCE(I_TITLE) TYPE  STRING DEFAULT 'ALV'

*"  TABLES

*"      IT_ALV TYPE  STANDARD TABLE

*"----------------------------------------------------------------------

 

  DATA:

    go_popup  TYPEREFTO cl_reca_gui_f4_popup,

    gf_choice TYPE flag.

 

 

  CALLMETHOD cl_reca_gui_f4_popup=>factory_grid

    EXPORTING

      it_f4value    = it_alv[]

      if_multi      = abap_false

      id_title      = i_title

    RECEIVING

      ro_f4_instance = go_popup.

 

  CALLMETHOD go_popup->display

    EXPORTING

      id_start_column = i_start_column

      id_start_line  = i_start_line

      id_end_column  = i_end_column

      id_end_line    = i_end_line

    IMPORTING

      et_result      = it_alv[]

      ef_cancelled    = gf_choice.

 

ENDFUNCTION.

You can use it like this:

REPORT z_very_simple_alv.

 

DATA gt_tab TYPESTANDARDTABLEOF sflights.

 

SELECT * FROM sflights INTOTABLE gt_tab.

 

CALLFUNCTION'Z_VERY_SIMPLE_ALV'

  TABLES

    it_alv = gt_tab.

As a result, you can see the ALV pop-up window:

1.png

ABAP source code in this document was coloured using the ABAP code lighter for SCN.

 

Best regards,

George Shlyahov


Viewing all articles
Browse latest Browse all 935

Trending Articles



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