REFRESH ALV
HI
I WANT TO REFREAH ALV AFTER I PRES ON BUTTON.
WHEN I USE REUSE_ALV_GRID_DISPLAY
IN USER-COMMAND I USE
FORM USER_COMMAND USING P_UCOMM TYPE SYUCOMM
P_SELFIELD TYPE SLIS_SELFIELD.
P_SELFIELD-REFRESH = 'X'
how can i refresh when i use class
CL_SALV_TABLE?
thanks
have nice day
hi yossi,
check these links..
Refresh in ALV.
Alv Grid and Refresh Button
ALV grid Refresh.
http://www.sap-img.com/abap/how-to-refresh-alv-list-grid-once-it-is-displayed.htm
http://sap.ittoolbox.com/groups/career/SAP-CAREER/refresh-alv-report-421919
Re: Refresh ALV with a new value
Re: Update/refresh ALV grid
Similar Messages
-
Refreshing ALV when action is triggered using button
Hello Friends,
I have a drop down list having 3 values "Last 30 Days", "Last 60 Days" and "Last 90 Days". If I select Last 30 Days and click on button "Search" it gives me record for the last 30 days. But, if I click again on "Last 60 Days" it duplicates the record that was already in. So it does not refresh the previous result. I have added the code as below to refresh ALV but, it refresh the table but not the ALV. My View name is "MY PO INVOICES" and the context node name is 'MY_PO_INV' .
DATA ln_node type REF TO if_wd_context_node.
ln_node = wd_context->get_child_node( 'MY_PO_INV' ).
ln_node->invalidate( ).
Please let me know how do I refresth the result in the ALV display when I trigger the event.
Thks & Rgds,
HemalHello All,
Thanks very much for your responses. I tried to bind the alv table. But, I think I am doing some thing wrong here. Below is my code. Please let me know where I am doing wrong. Appreciate your help.
lv_thirtydays = 'LAST 30 DAYS'.
lv_sixtydays = 'LAST 60 DAYS'.
lv_ninetydays = 'LAST 90 DAYS'.
if ZDAYS = lv_thirtydays.
lv_zpostingdate = sy-datum - 30.
ENDIF.
lv_zpostingdate_to = sy-datum.
if ZDAYS = lv_sixtydays.
lv_zpostingdate = sy-datum - 60.
ENDIF.
if ZDAYS = lv_ninetydays.
lv_zpostingdate = sy-datum - 90.
ENDIF.
ln_node = wd_context->get_child_node( 'MY_PO_INV' ).
ln_node->invalidate( ).
LOOP AT lt_context_value_set INTO cocd_context_value_set.
lv_zcompany = cocd_context_value_set-text.
lv_zusername = username.
lv_zdays = ZDAYS.
CALL FUNCTION 'ZEBP_MY_PO_INV_SEARCH'
EXPORTING
bldat = lv_zpostingdate
bldat_to = lv_zpostingdate_to
bukrs = lv_zcompany
usnam = lv_zusername
ZDAYS = lv_zdays
tables
invsrch = zsearch.
ln_node->bind_table( zsearch ) .
SORT zsearch BY zcompany.
DATA lo_nd_get_po_inv TYPE REF TO if_wd_context_node.
lo_nd_get_po_inv = wd_context->get_child_node( name = wd_this->wdctx_my_po_inv ).
CALL METHOD lo_nd_get_po_inv->bind_table
EXPORTING
new_items = zsearch.
ENDLOOP.
Thks & Rgds,
Hemal -
Hi,
how to refresh an ALV LIST display?
Thanks.Hi,
Content and Structure Change
Use
You are able to change the internal data table in various ways. Depending on which type of change you use, you have to proceed differently to make the change visible on the front end in the ALV output as well.
You are able to make the following changes:
· You change content or the sequence of the individual data records
Afterwards you need to refresh the ALV output
· You replace the entire data table
Refresh Display of the ALV Output
If you have changed single values, added rows or deleted rows in the data table of list-type ALV outputs, you need to complete these changes in the ALV output as well by refreshing the ALV display.
For Changes in the Tree Structure you do not have to refresh the display. In the other ALV tools, you do not have to refresh the ALV output when you make the following changes:
§ Changes to the Display of Columns
§ Changes Sequence of Columns in the ALV display
§ Changes to the DDIC Reference of Columns
By default, the ALV output automatically scrolls to the beginning. However, you are able to determine that the current display (position on the screen) not be changed.
You are able to refresh the ALV output in two ways:
· All settings for filters and sorting remain.
This setting can lead to newly inserted data records not being displayed because the filter setting hid exactly these data records.
· All settings for filters and sorting remain.
Features
For changes to content and structure, you are able to make the following settings:
· Refresh ALV output
· Swap the data table of the ALV output
Refresh ALV output
With the refresh, you ensure that the changed values are available on the front end as well.
Display type
ALV Tool
Classic ABAP list
Full screen
In the Container
Simple, two-dimensional table
Yes
Yes
Yes
Hierarchical-sequential list
Yes
Tree structure
No
No
Methods
Function
Class
Method
Refresh ALV output without deleting filter and sort settings
CL_SALV_TABLE
CL_SALV_HIERSEQ_TABLE
REFRESH
(Parameter REFRESH_MODE: SOFT)
Refresh ALV output and delete filter and sort settings
REFRESH
(Parameter REFRESH_MODE: FULL)
Change the Structure of the Data Table with SET_DATA
Depending on which ALV tool you are using, the parameters of the SET_DATA method are different:
If you assign a new structure with SET_DATA, all objects that referred to the previous structure will be deleted such as all sort objects in list-type ALV outputs or all node objects in tree structures.
Methods
Function
Class
Method
Change structure and data table
CL_SALV_TABLE
CL_SALV_HIERSEQ_TABLE
CL_SALV_TREE
CL_SALV_HIERSEQ_LEVEL
SET_DATA
Change the Structure of the Data Table with the SET_DATA Method
ALV Tool
Parameter
Remarks
Simple, two-dimensional table
T_TABLE
Table for structure and contents of the ALV output
Hierarchical-sequential list
(in CL_SALV_HIERSEQ_TABLE)
LEVEL
Hierarchy level whose structure you wish to change
T_TABLE
New table of hierarchy level
T_BINDING
List of up to five foreign-key relationships
(in CL_SALV_HIERSEQ_LEVEL)
VALUE
New table of hierarchy level
T_BINDING
List of up to five foreign-key relationships
Tree structure
T_TABLE
Initial table
Empty table, only sets the structure -
Dear experts,
I have used REUSE_ALV_GRID_DISPLAY to display some data of an internal table. I modified it and I need to display the refreshed data again.
How can I do that?
Thank you...
RoxaniHi,
In ALV, to refresh the table you have to call the method "refresh_table_display".
It has the syntax very similar to creating the table.
It has two parameters. In the first one, you can mention if you want to refresh only the data (the icons are not refreshed)
or
if you want to refresh only the icons around the grid (the data is not refreshed - this option is mostly not used in day to day applications).
the synatx is :-
<b>call method grid (name of grid )->refresh_table_display
exporting
IS_STABLE = <STRUCT OF TYPE LVC_S_STBL> (THIS IS FOR DATA REFRESHING)</b>
<b>I_SOFT_REFRESH = <VARIABLE OF CHAR 01> (THIS IS FOR ICON REFRESHING).</b>
<b>Refresh grid display</b>
Use the grid method REFRESH_TABLE_DISPLAY
<b>Sample code:-</b>
http://www.erpgenie.com/sap/abap/controls/alvgrid.htm#Refresh%20grid%20display
TO refresh the ALV Lsit :
http://www.sap-basis-abap.com/abap/auto-refresh-alv-list.htm
Regards
Sudheer -
Refresh ALV ( Internal Table Will Be Change)
Hi friends
I am using 2 internal table. And they have their own field catalog. I can refresh alv grid.
If my refresh data have stuation 1 I am using Inta another stuation I am using Intb.
How can I refresh my ALV grid with different catalog and internal table?Hi,
yes you can do that,
Check this sample code, in your case you have to use two performs for display. with the help of SELFIELD-EXIT = 'X'. you can get what you want.
REPORT ZTEST_ALV.
type-pools:slis.
DATA: GT_SFLIGHT TYPE TABLE OF SFLIGHT.
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT type SLIS_FIELDCAT_ALV.
data: l_layout type SLIS_LAYOUT_ALV.
SELECT * FROM SFLIGHT INTO TABLE GT_SFLIGHT.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = sy-repid
I_STRUCTURE_NAME = 'SFLIGHT'
I_INCLNAME = sy-repid
CHANGING
CT_FIELDCAT = gt_fieldcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
perform alv_display.
*& Form status
* text
form status USING P_EXTAB TYPE SLIS_T_EXTAB .
set pf-status 'AAA' excluding p_extab.
endform. "status
*& Form USER_COMMAND
* text
* -->P_UCOMM text
* -->P_SELFIELD text
FORM USER_COMMAND USING P_UCOMM LIKE SY-UCOMM
P_SELFIELD TYPE SLIS_SELFIELD.
case p_ucomm.
when 'TEST'.
fieldcat-no_out = 'X'.
modify gt_fieldcat from fieldcat
transporting no_out where fieldname = 'PRICE'.
p_selfield-exit = 'X'.
perform alv_display.
endcase.
ENDFORM. "USER_COMMAND
*& Form alv_display
* text
FORM alv_display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_LAYOUT = l_layout
I_CALLBACK_PROGRAM = sy-repid
I_STRUCTURE_NAME = 'SFLIGHT'
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_FIELDCAT = GT_FIELDCAT[]
TABLES
T_OUTTAB = GT_SFLIGHT.
ENDFORM. " alv_display
Regards
vijay -
After refreshing ALV display, set it to the current cell that was modified.
Hello Experts,
I am currently using cl_gui_alv_grid for my ALV grid display. I have 1 editable column
which lets users input values. Now, When users press 'ENTER' in the keyboard I refresh
the ALV display to reflect the changes done. But the display always "moves back" to the first column
so it is tiresome to find the current cell that was modified. My question is, how do I set the ALV
display to just "stay put" in the current cell that was modified after pressing 'ENTER'?
Hope you can help me guys.Thank you and take care!Check this link
ALV scroll bar -
Saving Layout's attributes after refresh ALV
Hello,
I use CL_SALV_TABLE class for ALV printing.
I start the ALV with Layout variant which has sort & other attributes.
From the ALV screen I run other screens and when I go back to ALV screen,
I refresh the ALV table --> gr_table->refresh( ), to have updated data.
The problem is that after refreshing the table, it forgets the Layout attributes and
Don't sort as it requires in the specified layout.
What I have to do for save the layout attributes?
Thank you for your help,
FaribaIf you set
wa_layout-NO_TOOLBAR = 1.
it won't work
but try
wa_layout-NO_TOOLBAR = 'X'.
- it works -
Refresh alv grid after user clicks f4( value-request)
Hello Experts,
I am currently developing a module pool program wherein after the user selects a value via f4(value request),
my ALV grid(using custom control) should be refreshed to show the new records selected based
on the f4 value. How can this be achieved?
thank you guys and take care!Did you try a CALL METHOD [cl_gui_cfw=>set_new_ok_code|http://help.sap.com/saphelp_sm32/helpdata/en/06/3fa1b79f2811d2bd68080009b4534c/frameset.htm] and [=>flush|http://help.sap.com/saphelp_sm32/helpdata/EN/06/3fa1879f2811d2bd68080009b4534c/content.htm] in the POV section or in event onF4 handler method to force execution of PAI (either it works either it dumps)
Regards,
Raymond -
i have an alv grid with 4 rows
i mark 1 line and click on button and now i have 3 lines and i see it in debug
but when i get back to screen i see 4
i try refresh-table_display
any idea....,If line is deleted from internal table and you call refresh_table_display, it should refresh the table.
Please check you are not reselecting data in PBO.
Regards,
Mohaiyuddin -
Problem in refreshing ALV data in container (OOALV)
Hello Experts, Good Day.
I am developing a Modulepool program which is having two screens, one (101) is for Entering data (used TC with wizard) then saves it in database table and another screen (102) is to display saved data. Now I am facing problem in second screen (102).
The problem I am facing is when I am displaying/calling 102 screen for multiple times, the internal table is getting updated but the previous ALV data is not getting updated/modified.
I have searched the forum and found some methods/procedures for refreshing the data but I am not able to achieve this.
Methods I found and Problems with them:
1. FREE the Container and Grid objects usng FREE( ) method.
If I free boht the Container and Grid objects data getting updated but another all the columns are getting displayed twice for second time, thrice for third time and so on... I have coded for this in PBO of 102 Screen.
If I Free only Grid object, totally the table is getting disappeared when I display ALV Second time.
2. When I use Refresh the table using CALL METHOD LR_GRID->REFRESH_TABLE_DISPLAY( ) then only second time the ALV is getting refreshed but if I display further it is displaying 2nd ALV data from 3rd time onwards (not getting updated from 3rd time).
Coded as below in PBO OF 102 Screen:
IF LR_GRID IS BOUND.
CALL METHOD LR_GRID->REFRESH_TABLE_DISPLAY( ).
ENDIF.
CREATE OBJECT LR_GRID
EXPORTING
I_PARENT = LR_CONT
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
3. When I use FLUSH method: this is not at all working out, I have called this after displaying ALV in PBO.
CALL METHOD CL_GUI_CFW=>FLUSH( ).
CALL METHOD CL_GUI_CFW=>DISPATCH( ).
My code to display ALV which is written in PBO of 102 is attached, please find the attachment.
Experts, please let me know where I am going wrong. I wish to know the solution in all the above ways. Please help me.
Thanks & Regards,
VijayLR_GRID->SET_TABLE_FOR_FIRST_DISPLAY(
* EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER = 'X'
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME = 'ZGVK_MP_DEMO'
* IS_VARIANT =
* I_SAVE = 'X'
* I_DEFAULT = 'X'
* IS_LAYOUT =
CHANGING
IT_OUTTAB = GT_DATA[]
IT_FIELDCATALOG = LT_FCAT
* 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. -
Hi Experts,
I have a module pool screen, in which I have an input field and under that I have OOPS alv grid control.
I want to select a value from search help for that input field. The moment I select the value in that input field,
according to the input field value, the content of ALV should be changed and it should be refreshed.
How to get it, when PBO is not called, as we call POV.
Thanks and regards,
Venkat.Hi,
Well actually SAPGUI_SET_FUNCTIONCODE is ok as soon as you are correctly refreshing your ALV in PBO...
MODULE pbo.
IF gr_alv IS NOT BOUND.
"Create ALV object
ELSE.
gr_alv->refresh( ).
ENDIF.
ENDMODULE.
MODULE pov.
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
ENDMODULE.
works perfectly on my side...
This is also working with the use of CL_GUI_CFW=>SET_NEW_OK_CODE indeed...
Cheers,
m.
Edited by: Manu D'Haeyer on Oct 14, 2011 1:45 PM -
I am using call method cl_salv_table=>factory to display an ALV report. How to add a refresh button and then add functionality to it.
Hi,
In ALV, to refresh the table you have to call the method "refresh_table_display".
It has the syntax very similar to creating the table.
It has two parameters. In the first one, you can mention if you want to refresh only the data (the icons are not refreshed)
or
if you want to refresh only the icons around the grid (the data is not refreshed - this option is mostly not used in day to day applications).
the synatx is :-
call method grid (name of grid )->refresh_table_display
exporting
IS_STABLE = <STRUCT OF TYPE LVC_S_STBL> (THIS IS FOR DATA REFRESHING)
I_SOFT_REFRESH = <VARIABLE OF CHAR 01> (THIS IS FOR ICON REFRESHING).
Regards,
Bhaskar -
Refresh ALV Report after return from dialog screen
Hi All,
I have developed an alv report which lists new products, when user clicks on a product it will take to custom dialog screen where user makes neccessary changes. Once the changes are done user clicks back the control comes back to the ALV report.
My question is when they come back to ALV report it should refresh and list the new products. Basically I want to know is it possible to refresh the report when control is coming back from dialog screen to ALV report.
Pls provide me a best way to handle this scenario.
Regards,
AnandHi Archna
This is the code I am using
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_grid_title = i_title
it_fieldcat = it_fcat
it_events = v_events
i_save = 'A'
TABLES
t_outtab = it_alv_cvg.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
READ TABLE it_alv_map INTO wa_alv INDEX rs_selfield-tabindex.
IF sy-subrc = 0.
SET PARAMETER ID 'ZCR' FIELD wa_alv-product.
CALL TRANSACTION 'ZSD_PRODUCT_DIV' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
After it goes to dialog when I clcik back it comes back to the alv report.
Now can you Pls tell me where to use the refresh.
Regards,
Anand -
REFRESH ALV WITHOUT ABAP OBJECTS
Hi, I am interested in refreshing an alv created WITHOUT ABAP OBJECTS; I use functions like REUSE_ALV_GRID_DISPLAY and I was wondering if is there any function like this to refresh an ALV when I make changes in the data inside of it.
Thanx!Here is what you need to do.
*-- Call the ALV function module
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE = ' '
i_callback_program = v_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
is_layout = i_layout
it_fieldcat = i_fieldcat[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE = ' '
* I_DEFAULT = 'X'
* I_SAVE = 'X'
* IS_VARIANT =
* it_events = i_events[]
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IT_ALV_GRAPHICS =
* IT_ADD_FIELDCAT =
* IT_HYPERLINK =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = alvtab
EXCEPTIONS
program_error = 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.
*-- then in your USER_COMMAND routine
* FORM USER_COMMAND *
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
CASE ucomm.
WHEN 'ABC'.
PERFORM do_abc.
WHEN 'XYZ'.
PERFORM do_xyz.
WHEN OTHERS.
ENDCASE.
<b>MOVE '&REFRESH' TO ucomm. "<-- this is what you need</b>
ENDFORM. " USER_COMMAND
Srinivas -
hi,
i am calling a alv-screen with FM REUSE_ALV_GRID_DISPLAY
as the output-table changes in some situations, is it possible to 'refresh' the alv-out-tab automaticly in ABAP ?
reg, MartinTry this way
Pl. check for rs_selfield-refresh = 'X' in the below mentioned code
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = i_fieldcat[]
is_layout = pt_grplayout2
i_callback_program = 'YATTU0007'
i_callback_html_top_of_page = p_header
i_callback_user_command = f_user_command1
it_events = i_events[]
tables
t_outtab = i_yatthdr.
* Form f_user_command1 *
* This form will handle the user command from fm REUSE *
form f_user_command1 using p_ucomm type sy-ucomm
rs_selfield type slis_selfield.
data p_ref1 type ref to cl_gui_alv_grid.
call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
importing
e_grid = p_ref1.
call method p_ref1->check_changed_data.
case p_ucomm.
endcase.
rs_selfield-refresh = 'X'. " Grid refresh
endform. " F_user_command1
a®
Maybe you are looking for
-
LimeChat in OSX Mavericks update, 08 May 2014?
Just installed an update, and LimeChat is listed as a recent install? Wha? I never identified this as something I want, did Apple put this on my machine, or is it eveidence of a virus/torjan problem? Signed, Confused.
-
Hey, I took my sim card out of my iPhone 3GS earlier to try it in someones phone, It all came out fine without me becoming suspicious of any hardware issues. Now I'm trying to put it in it simply isn't going in at all, it looks as if the catch that i
-
Setting size of Label!!!
I have problem in setting size of label. Actually I have atttached some labels in a pannel. I want to set different size for each label. I there any way i can explicitly set the size of labels. Thanx in advance.
-
Why does my Firefox not have a Java plug-in?
My question is similar to "Java Plug-in for JRE7u21?" but all the suggestions there that worked are for Windows, and I'm on a Mac, and I don't want to hijack that thread. <sub> For the record, that thread is [/questions/958847]. aw </sub> I have Mac
-
ApplicationLoader - Icon specified in the Info.plist not found
Fellow developers, Have any of you seen this error when trying to upload the app using the ApplicationLoader: Icon specified in the Info.plist not found: iconplus The icon file is there and has always loaded just fine on the emulator. I entered the f