2013 Oct 22 8:13 PM
Hello Experts,
I'm working with ALV and trying to refresh data with new values. Following is my code but it doesn't refresh ALV table. If I'm making any mistake then can somebody please rectify it?
case r_ucomm.
when '&IC1'.
if rs_selfield-fieldname = 'ZRERATE'.
read table lt_zrerate_hdr into lw_zrerate_hdr index rs_selfield-tabindex.
if sy-subrc = 0.
read table lt_zrerate_dtl into lw_zrerate_dtl
with key invoice = lw_zrerate_hdr-vbeln
zrerate = lw_zrerate_hdr-zrerate.
if sy-subrc = 0 and lw_zrerate_dtl-zvbeln_pr is not initial.
set parameter id 'AUN' field lw_zrerate_dtl-zvbeln_pr.
call transaction 'VA02' and skip first screen.
endif.
endif.
endif.
endcase.
IF sy-subrc = 0.
call function 'ZCED_RERATE_SHIPMENT_IDOCS'
exporting
vbeln = lw_zrerate_dtl-zvbeln_pr
* EXCEPTION_MATNR =
importing
pe_idoc_number = gv_idoc_ship
pe_error_prior_to_application = gv_error_prior_to_app
exceptions
invalid_doc_number = 1
no_entries_found = 2
no_partners_found = 3
others = 4.
if sy-subrc = 0.
lw_output-idocnum = gv_idoc_ship. ( lw_output is my table which I display in ALV and trying to update it's field lw_output-idocnum with a new value but it doesn't work ).
endif.
rs_selfield-refresh = 'X'.
ENDIF.
Many thanks in advance.
2013 Oct 22 8:22 PM
Hi.
Try to add this, i worked for me when refresh didnt want to work.
rs_selfield-refresh = 'X'.
rs_selfield-col_stable = 'X'.
rs_selfield-row_stable = 'X'.
also try this if that one doesnt work
DATA : e_grid TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = e_grid.
CALL METHOD e_grid->check_changed_data.
"update_alv_tab
CALL METHOD e_grid->refresh_table_display.
and at the end, write the frist method inside a do 10 times.
Regards
Miguel
2013 Oct 22 8:22 PM
Hi.
Try to add this, i worked for me when refresh didnt want to work.
rs_selfield-refresh = 'X'.
rs_selfield-col_stable = 'X'.
rs_selfield-row_stable = 'X'.
also try this if that one doesnt work
DATA : e_grid TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = e_grid.
CALL METHOD e_grid->check_changed_data.
"update_alv_tab
CALL METHOD e_grid->refresh_table_display.
and at the end, write the frist method inside a do 10 times.
Regards
Miguel
2013 Oct 22 8:46 PM
Thanks for your input Miguel. I've tried your suggestions but nothing works.
2013 Oct 22 8:54 PM
Have you tried calling CL_GUI_CFW=>FLUSH() after the refresh method ?.
Thanks,
Venkat.
2013 Oct 22 8:55 PM
Hi,
what is the table of the ALV, you said that it is "lw_output is my table which I display in ALV and trying to update it's field lw_output-idocnum with a new value but it doesn't work ".
need to be sth like this:
wa_output-idocnum = gv_idoc_ship.
modify lw_output from wa_output.
The problem is not in the refresh, it is on the update of the table.
Check whether the table gets update or not.
Regards
Miguel
2013 Oct 22 9:23 PM
2013 Oct 22 9:48 PM
Did you tried like this?
CALL METHOD g_grid->refresh_table_display
EXPORTING
i_soft_refresh = 'X'.
I could able to refresh my ALV grid output like this.
2013 Oct 23 1:23 AM
Why you put "IF sy-subrc = 0" After the CASE statements, I think you should remove and try it agian.
2013 Oct 23 2:22 AM
lw_output must be just the workarea. You must modify output table from this workarea.
Also put rs_selfied-refresh = 'X' outside endif statement.
2013 Oct 23 5:21 AM
Hi,
You can also try submit report ..... with .... and return. in your ucomm for your refresh button.
Regards,
Madhumahesh.
2013 Oct 23 8:07 AM
VA02 is a SAP program not a report. You can't use submit statment.
2013 Oct 23 5:35 AM
Hello Cool,
add append or modify statement based on ur requirement
if sy-subrc eq 0.
lw_output-idocnum = gv_idoc_ship.
append or modify
endif.
rs_selfield-refresh = 'X'.
ENDIF.
2013 Oct 23 6:08 AM
Dear Zero ,
You output internal table used for Grid Display will be refreshed with the Data which you require.
In order to refresh the data in front end of Grid display.
Try calling the Function Module REUSE_ALV_GRID_DISPLAY once again the user command form routine
As you mentioned in your query
case r_ucomm.
when '&IC1'
call transaction .....
**call this Function Module
REUSE_ALV_GRID_DISPLAY
endcase
I hope the above mentioned will be helpful for you.
Thanks.
With Regards,
Sudhir S
2013 Oct 23 8:41 AM
Hi,
Try with SALV . You can find sample reports in se84 with title LC10BLISALVI* .
WBR/shakti