Refresh ALV Grid Output in OOPs
Refresh ALV Grid Output in OOPs
Former Member
02-20-2009 4:53 AM
0 Kudos
Hi all..
To refresh the ALV Grid, i have used REFRESH_TABLE_DISPLAY. The Grid is alone refreshed but not the actual
output.
I have searched all the threads, but dint find any methods to refresh the output.
grid->set_table_for_first_display.
Thanks in advance.
Reply 10 REPLIES
Former Member
02-20-2009 5:01 AM
0 Kudos
Hi,
Thanks,
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 1/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
Neelima.
SAP Managed Tags:
ABAP Development
Reply
Former Member
02-20-2009 5:03 AM
0 Kudos
HI
Here on double click ,the grid will be refreshed and the correspondung data will be displayed on
REPORT zalv.
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 2/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
*----------------------------------------------------------------------*
* CLASS lcl_event_handler DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS on_double_click FOR EVENT double_click
OF cl_gui_alv_grid
IMPORTING es_row_no.
ENDCLASS. "lcl_event_handler DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_event_handler IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_event_handler IMPLEMENTATION.
METHOD on_double_click.
w_check = 'X'.
IF w_check = 'X'.
CALL METHOD r_grid->refresh_table_display
EXPORTING
is_stable = stbl.
* i_soft_refresh = soft.
ENDIF.
CREATE OBJECT r_container
EXPORTING
container_name = 'CONTAINER'.
CREATE OBJECT r_grid
EXPORTING
i_parent = r_container.
wa_fcat-fieldname = 'W_CHECK'.
wa_fcat-coltext = 'CHECK'.
wa_fcat-checkbox = 'X'.
wa_fcat-edit = 'X'.
wa_fcat-col_pos = 1.
APPEND wa_fcat TO t_fcat.
CLEAR wa_fcat.
wa_fcat-fieldname = 'CARRID'.
wa_fcat-ref_table = 'SFLIGHT'.
wa_fcat-ref_field = 'CARRID'.
wa_fcat-col_pos = 2.
APPEND wa_fcat TO t_fcat.
CLEAR wa_fcat.
wa_fcat-fieldname = 'CONNID'.
wa_fcat-ref_table = 'SFLIGHT'.
wa_fcat-ref_field = 'CONNID'.
wa_fcat-col_pos = 3.
APPEND wa_fcat TO t_fcat.
CLEAR wa_fcat.
* EXPORTING
* i_structure_name = 'SFLIGHT'
*
* is_layout = wa
CHANGING
it_fieldcatalog = t_fcat
it_outtab = t_itab.
Regards
Hareesh.
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 4/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
Reply
Former Member
02-20-2009 5:04 AM
1 Kudo
Hi Tharani,
while u set the table for display check whether the grid' is initial' ..if true thn display orelse refresh the grid..this way..it
works.....
in pbo..
if container is initial.
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 5/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
changing
it_outtab = <output table>
* it_fieldcatalog =
* it_sort =
* it_filter =
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4
.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
else.
call method grid->refresh_table_display
* EXPORTING
* is_stable = is_stable
* i_soft_refresh =
exceptions
finished = 1
others = 2.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endif.
Regards,
Mdi.Deeba
SAP Managed Tags:
ABAP Development
Reply
Former Member
02-20-2009 5:05 AM
1 Kudo
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 6/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
Hi,
IF gv_grid IS INITIAL.
CREATE OBJECT gv_custom_container
EXPORTING
container_name = gc_container.
CREATE OBJECT gv_grid
EXPORTING
i_parent = gv_custom_container.
IF gv_set IS INITIAL.
CALL METHOD gv_grid->set_table_for_first_display
ELSE.
CALL METHOD gv_grid->refresh_table_display
EXCEPTIONS
finished = 1
others = 2.
ENDIF.
Refer the above code for refreshing alv grid.Hope it will be helpful to you.
Thanks,
Srilakshmi.
SAP Managed Tags:
ABAP Development
Reply
I355602
Advisor
02-20-2009 5:07 AM
0 Kudos
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 7/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
Hi,
Try using:-
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
Tarun Gambhir
SAP Managed Tags:
ABAP Development
Reply
dev_parbutteea
Active Contributor
02-20-2009 5:07 AM
0 Kudos
Hi,
Modify your final internal table which you are displaying in your output first then call method:
wa_stable-row = e_row-index.
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 8/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
exporting
is_stable = wa_stable.
SAP Managed Tags:
ABAP Development
Reply
Former Member
02-20-2009 6:38 AM
0 Kudos
Hi,
I have used all the methos you all specified, but it refreshing only the grid not the output.
In debugging, I am getting a new data into the internal table before grid display
Anyother suggestions??
SAP Managed Tags:
ABAP Development
Reply
Former Member
02-20-2009 11:03 AM
0 Kudos
Hi,
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 9/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
Regards,
Anki Reddy
SAP Managed Tags:
ABAP Development
Reply
Former Member
02-20-2009 11:04 AM
0 Kudos
TYPE-POOLS : SLIS.
----
Tables *
----
TABLES:
VBRK,
VBRP.
----
----
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 10/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
SELECT-OPTIONS:
----
Internal Tables *
----
work areas
----
Variables *
----
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 11/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
***********************************************************************
Start of Program *
***********************************************************************
----
INITIALIZATION. *
----
INITIALIZATION.
----
S_VBELN-LOW = 1.
S_VBELN-HIGH = 1000000000.
S_VBELN-OPTION = 'EQ'.
S_VBELN-SIGN = 'I'.
APPEND S_VBELN.
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 12/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
----
SELECTION-SCREEN *
----
AT SELECTION-SCREEN.
----
PERFORM VALIDATION.
----
START-OF-SELECTION *
----
START-OF-SELECTION.
----
PERFORM GET_DATA.
----
END-OF-SELECTION *
----
END-OF-SELECTION.
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 13/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
----
----
TOP-OF-PAGE *
----
TOP-OF-PAGE.
----
----
END-OF-PAGE *
----
END-OF-PAGE.
----
----
AT USER-COMMAND *
&----
&----
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 14/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
text
----
--> p1 text
<-- p2 text
----
FORM VALIDATION .
FROM VBRK
INTO VBRK-VBELN
IF SY-SUBRC <> 0.
ENDIF.
&----
&----
text
----
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 15/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
--> p1 text
<-- p2 text
----
FORM GET_DATA .
SELECT VBELN
POSNR
UEPOS
FKIMG
NETWR
MEINS
FROM VBRP
&----
&----
text
----
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 16/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
IF V_FLAG = 'X'.
PERFORM DISPLAY_ALV.
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'VBRP'
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT = GS_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 17/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
CHANGING
IT_OUTTAB = IT_VBRP[]
IT_FIELDCATALOG = GT_FIELDCAT
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
IF SY-SUBRC <> 0.
EXPORTING
I_READY_FOR_INPUT = 1.
ELSE.
EXPORTING
IS_STABLE =
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 18/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
I_SOFT_REFRESH =
EXCEPTIONS
FINISHED = 1
OTHERS = 2
IF SY-SUBRC <> 0.
ENDIF.</b>
ENDIF.
CLEAR V_FLAG.
ENDIF.
&----
&----
text
----
--> p1 text
<-- p2 text
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 19/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
----
FORM DISPLAY_ALV .
IF GR_ALVGRID IS INITIAL.
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = GR_CCONTAINER
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5
IF SY-SUBRC 0.
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 20/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
ENDIF.
ENDIF.
&----
&----
text
----
<--P_GT_FIELDCAT text
----
L_POS TYPE I.
L_POS = L_POS + 1.
LS_FCAT-FIELDNAME = 'VBELN'.
LS_FCAT-TABNAME = 'IT_VBRP'.
LS_FCAT-COL_POS = L_POS.
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 21/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
LS_FCAT-OUTPUTLEN = '10'.
CLEAR LS_FCAT.
L_POS = L_POS + 1.
LS_FCAT-FIELDNAME = 'POSNR'.
LS_FCAT-TABNAME = 'IT_VBRP'.
LS_FCAT-COL_POS = L_POS.
LS_FCAT-OUTPUTLEN = '6'.
CLEAR LS_FCAT.
L_POS = L_POS + 1.
LS_FCAT-FIELDNAME = 'UEPOS'.
LS_FCAT-TABNAME = 'IT_VBRP'.
LS_FCAT-COL_POS = L_POS.
LS_FCAT-OUTPUTLEN = '6'.
CLEAR LS_FCAT.
L_POS = L_POS + 1.
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 22/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
LS_FCAT-FIELDNAME = 'FKIMG'.
LS_FCAT-TABNAME = 'IT_VBRP'.
LS_FCAT-COL_POS = L_POS.
LS_FCAT-OUTPUTLEN = '13'.
CLEAR LS_FCAT.
L_POS = L_POS + 1.
LS_FCAT-FIELDNAME = 'NETWR'.
LS_FCAT-TABNAME = 'IT_VBRP'.
LS_FCAT-COL_POS = L_POS.
LS_FCAT-OUTPUTLEN = '15'.
CLEAR LS_FCAT.
L_POS = L_POS + 1.
LS_FCAT-FIELDNAME = 'MEINS'.
LS_FCAT-TABNAME = 'IT_VBRP'.
LS_FCAT-COL_POS = L_POS.
LS_FCAT-OUTPUTLEN = '3'.
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 23/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
CLEAR LS_FCAT.
L_POS = L_POS + 1.
&----
&----
text
----
<--P_GS_LAYOUT text
----
P_GS_LAYOUT-ZEBRA = 'X'.
P_GS_LAYOUT-SMALLTITLE = 'X'.
P_GS_LAYOUT-EDIT = 'X'.
&----
&----
text
----
&----
&----
text
----
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 25/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
WHEN 'CHANGE'.
IF GR_ALVGRID->IS_READY_FOR_INPUT( ) = 0.
EXPORTING
I_READY_FOR_INPUT = 1.
ELSE.
EXPORTING
I_READY_FOR_INPUT = 0.
ENDIF.
ENDCASE.
SAP Managed Tags:
ABAP Development
Reply
Former Member
06-30-2009 11:24 AM
0 Kudos
HI,
It got solved. The Refresh Table Display is checked only if the Grid as value.
Where else i have called Refresh Table Display even before the grid is filled.
SAP Managed Tags:
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 26/27
10/6/24, 18:28 Refresh ALV Grid Output in OOPs - SAP Community
ABAP Development
Reply
https://community.sap.com/t5/application-development-discussions/refresh-alv-grid-output-in-oops/td-p/5239913 27/27