Conatiner refresh in alv
Hi all,
i am working on dynamic alv using grid. after processing i want blank or can say clear all editable fields in display after processing functionality. i have used refresh_display and free method of class cl_gui but alv display is coming as it previous, displaying with edit data.
how i can refresh table ?
Hi,
After calling Refresh display try using the below method
call method cl_gui_cfw=>flush
exceptions
cntl_system_error = 1
cntl_error = 2.
Similar Messages
-
hi masters,
i m working on alv report where i have to change the data. after changing the data i have to do the refresh for that i m using the method below
wa_STBL-ROW = 'X'.
wa_STBL-COL = 'X'.
CALL METHOD grid_obj->refresh_table_display
EXPORTING
IS_STABLE = wa_stbl
I_SOFT_REFRESH = 'X '
EXCEPTIONS
finished = 1
OTHERS = 2.
but after executing this method its giving run time error saying that ' Access via 'NULL' object reference not possible. You attempted to use a 'NULL' object reference (points to 'nothing') access a component (variable: "GRID_OBJ").'. can u plz help me where i m going wrong. and how to implement the refresh in alv report in details..
thanks in advance.
regards,
vickyhi,
when i clicked on refresh button it is going to pf-status after that as i shown in below code it goes to refresh_report. but in this 'form refresh_report' it won't display the data. it goes into the infinite loop. within that form- endform. plz can u give me solution for this problem?
set pf-status 'STANDARD_FULLSCREEN'.
case sy-ucomm.
when '&REFRESH'.
perform refresh_report.
endcase.
form refresh_report .
perform build_fieldcatlog.
perform event_call.
perform populate_event.
perform data_retrieval.
perform build_listheader using it_listheader.
perform display_alv_report_fm.
endform. " REFRESH_REPORT -
ALV OO and refreshing the ALV grid
Hi,
i have some problems with my ALV 00 program.
On screen 1 i have to fill in a material number.
For that material i'm getting some data and show in screen 2 in a ALV grid.
Via BACK-button i'm getting back to screen 1 and can fill in another material number.
But the 2nd (and 3rd, etc) time i fill a material, the ALV grid data from material 1 is shown. Even if the internal table I_ALV where the data is, is changed.
What should i do ?
I have initialized the customer container and the grid, but that didn't solved the problem.
regards,
HansHi,
Try clearing and refreshing the alv grid data table in screen 2.
Check with this code. this code is working fine. If we go back and change the input, it is showing the output corresponding to the second input only.
Have you use this method?
<b> GR_ALVGRID->REFRESH_TABLE_DISPLAY</b>
TYPE-POOLS : SLIS.
* Tables *
TABLES:
VBRK,
VBRP.
* Parameters and select options OR SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS:
S_VBELN FOR VBRK-VBELN.
SELECTION-SCREEN END OF BLOCK B1.
* Internal Tables *
* work areas
DATA: BEGIN OF IT_VBRP OCCURS 0,
VBELN LIKE VBRK-VBELN,
POSNR LIKE VBRP-POSNR,
UEPOS LIKE VBRP-UEPOS,
FKIMG LIKE VBRP-FKIMG,
NETWR LIKE VBRP-NETWR,
MEINS LIKE VBRP-MEINS.
DATA : END OF IT_VBRP.
* Variables *
DATA : GR_ALVGRID TYPE REF TO CL_GUI_ALV_GRID,
GC_CUSTOM_CONTROL_NAME TYPE SCRFNAME VALUE 'CC_ALV',
GR_CCONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
GT_FIELDCAT TYPE LVC_T_FCAT,
GS_LAYOUT TYPE LVC_S_LAYO,
V_FLAG VALUE 'X'.
* Start of Program *
* INITIALIZATION. *
INITIALIZATION.
S_VBELN-LOW = 1.
S_VBELN-HIGH = 1000000000.
S_VBELN-OPTION = 'EQ'.
S_VBELN-SIGN = 'I'.
APPEND S_VBELN.
* SELECTION-SCREEN *
AT SELECTION-SCREEN.
PERFORM VALIDATION.
* START-OF-SELECTION *
START-OF-SELECTION.
PERFORM GET_DATA.
CALL SCREEN 0100.
* END-OF-SELECTION *
END-OF-SELECTION.
* TOP-OF-PAGE *
TOP-OF-PAGE.
* END-OF-PAGE *
END-OF-PAGE.
* AT USER-COMMAND *
*& Form VALIDATION
* text
* --> p1 text
* <-- p2 text
FORM VALIDATION .
SELECT SINGLE VBELN
FROM VBRK
INTO VBRK-VBELN
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'no billing documents found'.
ENDIF.
ENDFORM. " VALIDATION
*& Form GET_DATA
* text
* --> p1 text
* <-- p2 text
FORM GET_DATA .
SELECT VBELN
POSNR
UEPOS
FKIMG
NETWR
MEINS
FROM VBRP
INTO TABLE IT_VBRP
WHERE VBELN IN S_VBELN.
ENDFORM. " GET_DATA
*& Module DISPLAY_ALV OUTPUT
* text
MODULE DISPLAY_ALV OUTPUT.
IF V_FLAG = 'X'.
PERFORM DISPLAY_ALV.
PERFORM PREPARE_FIELD_CATALOG CHANGING GT_FIELDCAT.
PERFORM PREPARE_LAYOUT CHANGING GS_LAYOUT.
CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
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 =
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
CALL METHOD GR_ALVGRID->SET_READY_FOR_INPUT
EXPORTING
I_READY_FOR_INPUT = 1.
ELSE.
<b>CALL METHOD GR_ALVGRID->REFRESH_TABLE_DISPLAY
* EXPORTING
* 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.</b>
ENDIF.
CLEAR V_FLAG.
ENDIF.
ENDMODULE. " DISPLAY_ALV OUTPUT
*& Form DISPLAY_ALV
* text
* --> p1 text
* <-- p2 text
FORM DISPLAY_ALV .
IF GR_ALVGRID IS INITIAL.
CREATE OBJECT GR_ALVGRID
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. " DISPLAY_ALV
*& Form PREPARE_FIELD_CATALOG
* text
* <--P_GT_FIELDCAT text
FORM PREPARE_FIELD_CATALOG CHANGING P_GT_FIELDCAT TYPE LVC_T_FCAT.
DATA : LS_FCAT TYPE LVC_S_FCAT,
L_POS TYPE I.
L_POS = L_POS + 1.
LS_FCAT-FIELDNAME = 'VBELN'.
LS_FCAT-TABNAME = 'IT_VBRP'.
LS_FCAT-COL_POS = L_POS.
LS_FCAT-SCRTEXT_M = 'Billing Document'.
LS_FCAT-OUTPUTLEN = '10'.
APPEND LS_FCAT TO P_GT_FIELDCAT.
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-SCRTEXT_M = 'Billing Item'.
LS_FCAT-OUTPUTLEN = '6'.
APPEND LS_FCAT TO P_GT_FIELDCAT.
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-SCRTEXT_M = 'Higher Level Item'.
LS_FCAT-OUTPUTLEN = '6'.
APPEND LS_FCAT TO P_GT_FIELDCAT.
CLEAR LS_FCAT.
L_POS = L_POS + 1.
LS_FCAT-FIELDNAME = 'FKIMG'.
LS_FCAT-TABNAME = 'IT_VBRP'.
LS_FCAT-COL_POS = L_POS.
LS_FCAT-SCRTEXT_M = 'Invoice Quantity'.
LS_FCAT-OUTPUTLEN = '13'.
APPEND LS_FCAT TO P_GT_FIELDCAT.
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-SCRTEXT_M = 'Net Value'.
LS_FCAT-OUTPUTLEN = '15'.
APPEND LS_FCAT TO P_GT_FIELDCAT.
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-SCRTEXT_M = 'Unit of Measure'.
LS_FCAT-OUTPUTLEN = '3'.
APPEND LS_FCAT TO P_GT_FIELDCAT.
CLEAR LS_FCAT.
L_POS = L_POS + 1.
ENDFORM. " PREPARE_FIELD_CATALOG
*& Form PREPARE_LAYOUT
* text
* <--P_GS_LAYOUT text
FORM PREPARE_LAYOUT CHANGING P_GS_LAYOUT TYPE LVC_S_LAYO.
P_GS_LAYOUT-ZEBRA = 'X'.
P_GS_LAYOUT-GRID_TITLE = 'INVOICE DETAILS'.
P_GS_LAYOUT-SMALLTITLE = 'X'.
P_GS_LAYOUT-EDIT = 'X'.
ENDFORM. " PREPARE_LAYOUT
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'CANCEL'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
CALL TRANSACTION 'SE38'.
WHEN 'CHANGE'.
IF GR_ALVGRID->IS_READY_FOR_INPUT( ) = 0.
CALL METHOD GR_ALVGRID->SET_READY_FOR_INPUT
EXPORTING
I_READY_FOR_INPUT = 1.
ELSE.
CALL METHOD GR_ALVGRID->SET_READY_FOR_INPUT
EXPORTING
I_READY_FOR_INPUT = 0.
ENDIF.
ENDCASE.
Regards,
Aswin -
Hi,
I have an ALV Tree report developed using the OOPS. In my ALV Tree output, I have some buttons which will update the database after clicking. The data is correctly updating in the database. But, it is not getting updated in the ALV Tree display. That means, it is not REFRESHing the ALV Tree display. We have to again execute the program in order to see the updated output.
Could anyone please suggest me how to Refresh the ALV Tree display..?
We can't use the method 'REFRESH_TABLE_DISPLAY' as it is a PRIVATE method is the class CL_GUI_ALV_TREE.
Please share your valuable thoughts.
Thanks & Regards,
Paddu.Hi paddu.
please check out the link mentioned below,this will help u.
How to Refresh data on ALV tree
Regards
Theres -
How to refresh the ALV Control
Hi Experts,
I have a selection screen and ALV control in webdydnpro report. If i enter valid input values in the selection screen the ALV contol is diplaying datas correctly but when i enter invalid data in the selection screen the ALV table control values still diplaying in the previous datas. I need to Refresh the ALV contol values once the incorrect data enter in the selection screen. How can i REFRESH the ALV control in Webdynpro report. I have Refreh button in the Selection screen when you press REFRESH button the ALV table control data should be initilize Kindly help me out this issue.
Thanks ,
KumarHi.
You have a selection screen where user can enter some data, with this data you
perform a selection and then you bind the result to the ALV, right?
Question is how you bind the result to ALV? Do you use external context mapping
or the set_data method ?
So I guess you have a method where you validate the select options and if they
are correct you perform the selction and bind the result to the node for the ALV. If
the select options are incorrect you just need to get the node for the ALV (which contains the
previous result )and call the invalidate method on that node which deletes all
elements of this node and after that the ALV should be empty again. -
Hi everybody,
I have done normal ALV report.I did not use any methods for displaying . now i want to refresh the normal ALV report. is there any command for refreshing the alv report....
thanks and regards,
varahagiri.Um mean to say u want to auto-refesh ur ALV list? If it is then try this sample code...
REPORT z_alv_auto_refresh.
TYPE-POOLS: slis. " ALV Global Types
DATA :
gt_user LIKE uinfo OCCURS 0 WITH HEADER LINE. " User info in SM04
START-OF-SELECTION.
PERFORM f_read_data.
PERFORM f_display_data.
Form F_LIRE_DATA
FORM f_read_data.
REFRESH gt_user.
Get User's info
CALL FUNCTION 'THUSRINFO'
TABLES
usr_tabl = gt_user.
Wait in a task
PERFORM f_call_rfc_wait.
ENDFORM. " F_READ_DATA
Form F_DISPLAY_DATA
FORM f_display_data.
DEFINE m_sort.
add 1 to ls_sort-spos.
ls_sort-fieldname = &1.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DEFINE m_event_exit.
clear ls_event_exit.
ls_event_exit-ucomm = &1.
ls_event_exit-after = 'X'.
append ls_event_exit to lt_event_exit.
END-OF-DEFINITION.
DATA :
ls_layout TYPE slis_layout_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
lt_event_exit TYPE slis_t_event_exit,
ls_event_exit TYPE slis_event_exit.
Build Sort Table
m_sort 'ZEIT'.
Build Event Exit Table
m_event_exit '&NTE'. " Refresh
ls_layout-zebra = 'X'.
ls_layout-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND'
is_layout = ls_layout
i_structure_name = 'UINFO'
it_sort = lt_sort
it_event_exit = lt_event_exit
TABLES
t_outtab = gt_user.
ENDFORM. " F_DISPLAY_DATA
FORM USER_COMMAND **
FORM user_command USING i_ucomm TYPE syucomm
is_selfield TYPE slis_selfield. "#EC CALLED
CASE i_ucomm.
WHEN '&NTE'.
PERFORM f_read_data.
is_selfield-refresh = 'X'.
SET USER-COMMAND '&OPT'. " Optimize columns width
ENDCASE.
ENDFORM. " USER_COMMAND
Form F_CALL_RFC_WAIT
FORM f_call_rfc_wait.
DATA lv_mssg(80). "#EC NEEDED
Wait in a task
CALL FUNCTION 'RFC_PING_AND_WAIT' STARTING NEW TASK '001'
PERFORMING f_task_end ON END OF TASK
EXPORTING
seconds = 5 " Refresh time
busy_waiting = space
EXCEPTIONS
RESOURCE_FAILURE = 1
communication_failure = 2 MESSAGE lv_mssg
system_failure = 3 MESSAGE lv_mssg
OTHERS = 4.
ENDFORM. " F_CALL_RFC_WAIT
Form F_TASK_END
FORM f_task_end USING u_taskname.
DATA lv_mssg(80). "#EC NEEDED
Receiving task results
RECEIVE RESULTS FROM FUNCTION 'RFC_PING_AND_WAIT'
EXCEPTIONS
RESOURCE_FAILURE = 1
communication_failure = 2 MESSAGE lv_mssg
system_failure = 3 MESSAGE lv_mssg
OTHERS = 4.
CHECK sy-subrc EQ 0.
SET USER-COMMAND '&NTE'. " Refresh
ENDFORM. " F_TASK_END
If u want normal refresh based on clicking on a button then follow these steps:
1. Pass the subroutine name for event user_command to ALV list like:
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND'
is_layout = ls_layout
i_structure_name = 'UINFO'
it_sort = lt_sort
it_event_exit = lt_event_exit
TABLES
t_outtab = gt_user.
2. In the routine USER_COMMAND trap the fcode and set the refesh field.
FORM USER_COMMAND **
FORM user_command USING i_ucomm TYPE syucomm
is_selfield TYPE slis_selfield. "#EC CALLED
CASE i_ucomm.
WHEN 'ABCD'.
is_selfield-refresh = 'X'.
ENDCASE.
ENDFORM. " USER_COMMAND
3. Attach custom pf-status and there define a button with fcode
ABCD.
So that whenever u press this button user_command routine will get called and ALV list get refreshed.
Regards,
Joy. -
Unable to display Refreshed editable alv
hi
I have developed editable alv which contains 7 colums. the final column is the addition of 4th n 5th cplumn. when i refresh after changing the values, the final column is not changing. but while debugging the changed values are reflected in internal table but its reflected in alv.
help me outin the user_comand form you have to put rs_selfield-refresh = 'X'.
like this:
*& Form user_comand
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
rs_selfield-refresh = 'X'. -
Logic for Refreshing the ALV Report (Very Urgent)
Hi Experts,
My <b>ALV report</b> needs a <b>refresh button</b> on the output.
The <b>Refresh button</b> should be available to allow user to keep this report on screen and <b>refresh regularly</b> rather than <b>going back</b> and <b>running it again.</b>
I am using <b>Function modules</b> and not <b>OOPS Concept</b> here.............As i am<b> unaware</b> of OOPS Please provide me solution in <b>FM's Only</b>.
Kindly send me <b>sample logic</b> for this, <b>Very urgent</b> if ur reply is helpfull.... u will be <b>rewarded heavily</b>.......................
THanks in advance.
Rajesh KumarHi,
This mean to say that if you have a 'refresh' push button in your gui status, every time you press the button, the list should get refreshed.
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 -
Automatic refresh in alv grids
Hi!
I've three containers with three alv grids on my screen.
I've a self made save-button on the toolbar of the first grid.
Now i insert data in grid2 and grid3 ...
When i press now the save-button from grid1 there's no data in the internal tables from grid2 and grid3.
When i first press the refresh-buttons on the toolbars from grid2 and grid3 and then the save-button from grid1 the internal tables from grid2 and grid3 are filled.
Is it possible to simulate first the pressed refresh-buttons from grid2/grid3 when pressing the save-button from grid1?
I've tried to set a "call method grid2->refresh_table_display" and "call method grid2->refresh_table_display" before the code for the save-button but this doesn't work.
Is there any help for me?
Thanks a lot in advance!
IngoHello Ingo
It is important to realise that pushing a toolbar button does <b>NOT </b>trigger PAI of the dynpro where the ALV list is displayed.
In order to refresh the display of the other two ALV grids you need to pass PAI (followed by PBO). How to do that? There are at least two possible ways:
(1) You handle the SAVE command in your method HANDLE_USER_COMMAND. Within this method you update the internal tables for grid2 and grid3 depending on the contents of grid1. At the end of this method you call method CL_GUI_CFW=>set_new_ok_code( 'REFRESH' ). This will trigger PAI of the dynpro. In the PAI module (e.g. USER_COMMAND_0100) you could write the following coding:
CASE gd_okcode.
WHEN 'REFRESH'.
go_grid2->refresh_table_display( ).
go_grid3->refresh_table_display( ).
ENDCASE.
(2) You handle the SAVE command in your method HANDLE_USER_COMMAND and call method CL_GUI_CFW=>set_new_ok_code( 'REFRESH' ) without updating the itab2 and itab3 here. The updating of these itabs occurs in the PAI module.
The following sample report shows you the second approach. On the first ALV grid customers are displayed. If you double-click on a single customer its sales areas (if any) are displayed in the second ALV list.
*& Report ZUS_SDN_TWO_ALV_GRIDS
REPORT zus_sdn_two_alv_grids.
DATA:
gd_okcode TYPE ui_func,
go_docking TYPE REF TO cl_gui_docking_container,
go_splitter TYPE REF TO cl_gui_splitter_container,
go_cell_top TYPE REF TO cl_gui_container,
go_cell_bottom TYPE REF TO cl_gui_container,
go_grid1 TYPE REF TO cl_gui_alv_grid,
go_grid2 TYPE REF TO cl_gui_alv_grid,
gs_layout TYPE lvc_s_layo.
DATA:
gt_knb1 TYPE STANDARD TABLE OF knb1,
gt_knvv TYPE STANDARD TABLE OF knvv.
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING
e_row
e_column
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_double_click.
* define local data
DATA:
ls_knb1 TYPE knb1.
CHECK ( sender = go_grid1 ).
READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
CALL METHOD go_grid1->set_current_cell_via_id
EXPORTING
* IS_ROW_ID =
* IS_COLUMN_ID =
is_row_no = es_row_no.
* Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ).
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT * FROM knb1 INTO TABLE gt_knb1
WHERE bukrs = '1000'.
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Create splitter container
CREATE OBJECT go_splitter
EXPORTING
parent = go_docking
rows = 2
columns = 1
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_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.
* Get cell container
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_cell_top.
CALL METHOD go_splitter->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = go_cell_bottom.
* Create ALV grids
CREATE OBJECT go_grid1
EXPORTING
i_parent = go_cell_top
EXCEPTIONS
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.
* Set event handler
SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.
CREATE OBJECT go_grid2
EXPORTING
i_parent = go_cell_bottom
EXCEPTIONS
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.
* Display data
gs_layout-grid_title = 'Customers'.
CALL METHOD go_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'KNB1'
is_layout = gs_layout
CHANGING
it_outtab = gt_knb1
EXCEPTIONS
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.
gs_layout-grid_title = 'Customers Details (Sales Areas)'.
CALL METHOD go_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'KNVV'
is_layout = gs_layout
CHANGING
it_outtab = gt_knvv " empty !!!
EXCEPTIONS
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.
* Link the docking container to the target dynpro
CALL METHOD go_docking->link
EXPORTING
repid = syst-repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
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.
* NOTE: dynpro does not contain any elements
CALL SCREEN '0100'.
* Flow logic of dynpro (does not contain any dynpro elements):
*PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
*PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0100.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'. " contains push button "DETAIL"
* SET TITLEBAR 'xxx'.
* Refresh display of detail ALV list
CALL METHOD go_grid2->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
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.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
* User has pushed button "Display Details"
WHEN 'DETAIL'.
PERFORM entry_show_details.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form ENTRY_SHOW_DETAILS
* text
* --> p1 text
* <-- p2 text
FORM entry_show_details .
* define local data
DATA:
ld_row TYPE i,
ls_knb1 TYPE knb1.
CALL METHOD go_grid1->get_current_cell
IMPORTING
e_row = ld_row.
READ TABLE gt_knb1 INTO ls_knb1 INDEX ld_row.
CHECK ( syst-subrc = 0 ).
SELECT * FROM knvv INTO TABLE gt_knvv
WHERE kunnr = ls_knb1-kunnr.
ENDFORM. " ENTRY_SHOW_DETAILS
Regards
Uwe -
Hi Friends,
I am having one editable ALV. I have one quanity field in which i want to change the values.
I am using FM REUSE_ALV_GRID_DISPLAY.
When i change the values, the changed values in the ALV are not getting reflected in the internal table and the ALV.
Any body having idea how to reflect the changed values in ALV and in internal table.
Many thanks in advance.
Regards,
TarunHi Check this code.
use the user_command form code from below code and check now.
REPORT ZTEST_ALV_CHECK MESSAGE-ID ZZ .
TYPE-POOLS: SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV,
X_EVENTS TYPE SLIS_ALV_EVENT,
IT_EVENTS TYPE SLIS_T_EVENT.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
CHK(1),
color(4),
END OF ITAB.
SELECT VBELN
POSNR
FROM VBAP
UP TO 20 ROWS
INTO TABLE ITAB.
X_FIELDCAT-FIELDNAME = 'CHK'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
X_FIELDCAT-INPUT = 'X'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-CHECKBOX = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'VBELN'.
X_FIELDCAT-HOTSPOT = 'X'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_LAYOUT-info_fieldname = 'COLOR'.
*L_LAYOUT-ZEBRA = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = L_LAYOUT
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = ITAB
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.
*& Form STATUS
text
-->P_EXTAB text
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
Pf status
SET PF-STATUS 'STATUS'.
ENDFORM. " STATUS
*& Form USER_COMMAND
text
-->R_UCOMM text
-->RS_SELFIELD text
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA: GD_REPID LIKE SY-REPID, "Exists
REF_GRID TYPE REF TO CL_GUI_ALV_GRID.
IF REF_GRID IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = REF_GRID.
ENDIF.
IF NOT REF_GRID IS INITIAL.
CALL METHOD REF_GRID->CHECK_CHANGED_DATA .
ENDIF.
loop at itab where chk = 'X'.
itab-color = 'C300'.
modify itab index sy-tabix transporting color.
endloop.
RS_SELFIELD-refresh = 'X'.
break-point.
ENDFORM. "USER_COMMAND -
Hi all.
When I'm using set_table_for_first_display method how can implement refreshing option after the user had pressed a button and activated a process ?
Thanks all,
Rebekahi,
use this code..
DATA: g_alv_grid TYPE REF TO cl_gui_alv_grid, " ALV Declaration
CALL METHOD g_alv_grid->refresh_table_display. -
How to REFRESH Normal ALV..
Hi Experts,
I have Display normal ALV REPORT using 'REUSE_ALV_GRID_DISPLAY'.
When Double Click on a Particular Field say EBELN I need to Modify the Text say TXZ01( In below Source Code I Cleared Text just for Example).
Using u2018&IC1u2019 I modified in Internal Table, but it is not visible in the Screen.
Can anyone Give Idea on This.
TYPE-POOLS slis.
DATA : it_ekpo TYPE STANDARD TABLE OF ekpo,
it_fcat TYPE slis_t_fieldcat_alv.
START-OF-SELECTION.
SELECT * FROM ekpo INTO TABLE it_ekpo UP TO 10 ROWS.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'EKPO'
CHANGING
ct_fieldcat = it_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = it_fcat
TABLES
t_outtab = it_ekpo
EXCEPTIONS
program_error = 1.
*& Form USER_COMMAND
text
-->SLIS_SELFIELD text
FORM user_command USING command TYPE sy-ucomm
field TYPE slis_selfield.
FIELD-SYMBOLS <lfs_fcat> TYPE ekpo.
IF command EQ '&IC1'.
IF field-fieldname EQ 'EBELN'.
READ TABLE it_ekpo ASSIGNING <lfs_fcat> INDEX field-tabindex.
IF sy-subrc EQ 0.
CLEAR <lfs_fcat>-txz01.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_REFRESH' .
ENDIF.
ENDIF.
ENDFORM. "USER_COMMAND
Regards,
KumarHi,
Try like below:
*& Form USER_COMMAND
* text
* -->SLIS_SELFIELD text
FORM user_command USING command TYPE sy-ucomm
field TYPE slis_selfield.
FIELD-SYMBOLS <lfs_fcat> TYPE ekpo.
IF command EQ '&IC1'.
IF field-fieldname EQ 'EBELN'.
READ TABLE it_ekpo ASSIGNING <lfs_fcat> INDEX field-tabindex.
IF sy-subrc EQ 0.
CLEAR <lfs_fcat>-txz01.
ENDIF.
ENDIF.
ENDIF.
field-refresh ' X'. <----Add this
ENDFORM. "USER_COMMAND
Regards,
Himanshu -
Refresh Editable ALV Grid inside a custom Container
Hello all,
I am having a screen with custom container in which i am populating datas and a entry screen which is going to have my
filtering condition for this custom container screen..
The problem i am facing is whenever i come out of the custom container screen after displaying and again give the
necessary filtering data in the previous screen...
the custom container screen displays wrong values...
But when i refresh the data with the refresh icon in the container right datas are coming...
I even used CALL METHOD C_ALVGD->REFRESH_TABLE_DISPLAY
EXPORTING
IS_STABLE = STABLE
EXCEPTIONS
FINISHED = 1
OTHERS = 2. after displaying the values using
CALL METHOD C_ALVGD->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = T_FUNC
IS_LAYOUT = IT_LAYOUT
I_SAVE = 'A'
CHANGING
IT_OUTTAB = IT_ZCAWNT_V
IT_FIELDCATALOG = IT_FCAT
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.
I have refreshed my internal table once when i display and again fetched from the DB according to the filtering conditions given
in the first screen.
I have tried clearing the Object created once when i display and again recreated it.But could not get the output.
solution would be really helpful...Hey all,
Thanks a lot for helping me...
The problem is solved....
i just used,
CALL METHOD C_ALVGD->FREE. 'Grid inside the container
CLEAR C_ALVGD.
CALL METHOD C_CCONT->FREE. "Container
CLEAR C_CCONT.
when i click BACK Button from screen 2 to screen1. -
Refreshing of ALV Grid(using class)
Hi all,
In my program, i found that the ALV grid is displaying the same data for different criteria's. when debugging i found that the data is populated correctly in the output table that is passed to the method SET_TABLE_FOR_FIRST_DISPLAY according to the criteria's, yet i could only see the grid with the previous data.Please suggest on what could be done to correct this.
Thanks,
saranHi Saran,
There is a lifetime attribute that you have to set .
Set this when you create object container at the first time .
Here is the sample syntax :
Variable definition
DATA: grid_pr1 TYPE REF TO cl_gui_alv_grid,
g_cconth TYPE REF TO cl_gui_custom_container,
gs_layout2 TYPE lvc_s_layo,
it_alv TYPE lvc_t_fcat .
DATA: it_pr1 type table of ZP119H. " custom structure
Create the object
IF g_cconth is INITIAL.
CREATE OBJECT g_cconth
EXPORTING
container_name = 'CCONTH'
lifetime = g_cconth->lifetime_dynpro.
CREATE OBJECT grid_pr1
EXPORTING
i_parent = g_cconth .
CALL METHOD grid_pr1->set_table_for_first_display
EXPORTING
is_layout = gs_layout2
CHANGING
it_outtab = it_pr1
it_fieldcatalog = it_alv.
ENDIF. " g_cconth
Message was edited by:
TUWUHSIH WINEDYA -
How to refresh an ALV (CL_SALV_TABLE) after a parallel process
Hello all,
I have created a list using CL_SALV_TABLE. When you click on a line, a new mode must be opened. There, the user will fill in some data that must be retrieved and shown in the main list when the user closes the new mode. To do so Iu2019ve used u201CCALL FUNCTION func STARTING NEW TASK task CALLING meth ON END OF TASKu201D statement.
Iu2019ve tried to refresh the list within meth (called on end of task) but it doesn't work. I've also tried to get all the data again, but it prompts a short dump, set a new ok code using method cl_gui_cfw=>set_new_ok_code, even a WAIT until process is finished (not valid because I need process 1 active all the timeu2026)
SAP help says u201CThe SET USER-COMMAND u2018OKCDu2019 statement replaces the REFRESH SCREEN commandu201D
CALL FUNCTION 'function'
STARTING NEW TASK w_taskname
PERFORMING end_of_creation ON END OF TASK
EXPORTING
i_zzta = ztztl_zzta
i_manual_order = space
EXCEPTIONS
communication_failure = 1 MESSAGE w_msg
system_failure = 2 MESSAGE w_msg.
[u2026]
FORM end_of_creation USING p_taskname.
RECEIVE RESULTS FROM FUNCTION 'function'
IMPORTING
e_zzta = ztztl_zzta
EXCEPTIONS
communication_failure = 1 MESSAGE w_msg
system_failure = 2 MESSAGE w_msg.
[Modify list]
SET USER-COMMAND 'OKCD'.
[u2026]
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'OKCD'.
Perform get_data.
How can I have the same behaviour when using CL_SALV_TABLE??
Thanks in advance!Hello Matt,<br><br>
does not work means that if I write the following within method ON END OF TASK, the report is not refreshed.
<br><br>
<pre>
o_alv->refresh( ).
</pre><br><br>
I've also tried:
<br><br>
<pre>
o_alv->refresh( ).
o_alv->display( ).
data: o_alv TYPE REF TO cl_salv_table</pre><br><br>
<pre>Short dump: RPERF_ILLEGAL_STATEMENT
Error analysis
There is probably an error in the program
"SAPLSLVC_FULLSCREEN".
The program was probably called in a conversion exit
or in a field exit. These are implemented by
function modules called CONVERSION_EXIT_xxxxx_INPUT/OUTPUT or
USER_EXIT_xxxxx_INPUT.
Conversion exits are triggered during screen field transports or
WRITE statements, field exits during field transports from the
screen to the ABAP/4 program.
In this connection, the following ABAP/4 statements are not allowed:
- CALL SCREEN
- CALL DIALOG
- CALL TRANSACTION
- SUBMIT
- MESSAGE W... and MESSAGE I...
- COMMIT WORK, ROLLBACK WORK
- COMMUNICATION RECEIVE
- STOP
- REJECT
- EXIT FROM STEP-LOOP
Moreover, conversion exits for output conversion
(implemented by function modules called
CONVERSION_EXIT_xxxxx_OUTPUT) do not allow
- MESSAGE E...
to be used.
Trigger Location of Runtime Error
Program SAPLSLVC_FULLSCREEN
Include LSLVC_FULLSCREENU01
Row 187
Module type (FUNCTION)
Module Name REUSE_ALV_GRID_DISPLAY</pre><br><br>
But this short dump is expected since CALL FUNCTION - STARTING NEW TASK help says u201CIn the callback routine, you are not allowed to execute statements that interrupt the program execution or terminate a SAP LUW. Statements for list output are not executed.u201D<br><br>
Thanks Matt, I'll take a look at that forum, but I also tried a self list refresh using a timer and that prompted another short dump: LIST_TOO_MANY_LPROS -> "Error analysis: At present, the maximum permitted number of nested screen levels is restricted to 50." <br><br>
If I find a solution I'll let you know.<br><br>
<br><br>
Thank you!!
Edited by: Matt on Aug 26, 2009 1:16 PM
Maybe you are looking for
-
Programatic creation of OLAP Levels?
While I can create an OLAP Level in Action Script. It seems a fruitless endeavor due to that fact that all the attributes of the object are read only. var myOlapDim2Level1:OLAPLevel = new OLAPLevel(); myOlapDim2Level1.name = "Product"; This creates a
-
Document Updates in a folder via FTP considered Publish Points?
Hello, We currently have a website that is deployed via IIS that we are planning to move to Azure Web Services. This web contains a folder in the web site directory that contains files and documents for users to download. The site itself contains cod
-
Can someone access your backups if you share a time capsule?
I share a time capsule with my boyfriend, and wasn't certain if I remembered correctly from school if he could access my backup on his Mac if we ever parted on less than friendly terms... 1.) There is nothing compromising on the backups, nor is there
-
Could not find installation information for this machine for lion
could not find installation information for this machine for lion after trying to reinstall lion ona new MacBook pro that come with lion
-
Trouble burning photos do disc
Hello! I am having all kinds of trouble saving my photos to a CD-RW. I was able to burn an album using iPhoto, but from what I understand, I will only be able to view these in iPhoto. I want to be able to back my images up with the ability to view th