Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

2 seperate alv grid in total different environment, why display the same thing?

$
0
0

Hi  friends,

 

I have use one alv grid to edit some line items, then a second alv grid to display line items after simulation.

 

Once I called the first alvgrid, then when I call the 2nd alv grid, it will display the same content in the first alv grid, though they are using different instances which are declared different function groups.

 

The alv grid must have a buffer, otherwise how 2 different alv grid connected together.

 

The alv grid is created in a container. My first try is to change the container name below, once I change something to ALVSUB1, the alv grid will not display anything.

 

 

CREATE OBJECT GR_CONTAINER_SUB

                 EXPORTING

                    CONTAINER_NAME = 'ALVSUB'.

 

1st alv grid calling code:

 

 

ls_variant-report = 'GR_ALVGRID_ITEM_S2I'.

 


CALL METHOD gr_alvgrid_itm_s2i->set_table_for_first_display

EXPORTING

       is_variant           = ls_variant

        i_save               = 'A'

        is_layout            = ls_layout

      i_buffer_active      = 'X'

        it_toolbar_excluding = lt_exc_func

CHANGING

        it_fieldcatalog      = lt_fieldcat_items[]

        it_outtab            = gt_output_items[].

 

 

2nd alv grid calling code:

 

 

CALL METHOD GR_ALVGRID_ITM->SET_TABLE_FOR_FIRST_DISPLAY

    EXPORTING

      IS_VARIANT           = LS_VARIANT                     
      I_SAVE                   = 'A'                            
      IS_LAYOUT            = LS_LAYOUT

      I_BUFFER_ACTIVE      = 'X'

      IT_TOOLBAR_EXCLUDING = LT_EXC_FUNC

    CHANGING

      IT_FIELDCATALOG      = LT_FIELDCAT_ITEMS[]

      IT_OUTTAB            = GT_ITEMS[].

 

 

In 2nd alv grid, it will ignore GT_ITEMS and will display GT_OUTPUT_ITEMS instead. If 2nd alv grid is called first, then the first will display the GT_ITEMS instead of GT_OUTPUT_ITEMS.

 

Who can tell me what I did wrong, that 2 alv grids are linked somehow together?

 

Thank you

 

Swing

 




Viewing all articles
Browse latest Browse all 8332

Trending Articles



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