‎2007 Jan 25 5:58 AM
hi
1)
is it possible to change parameter of alv o/p table in runtime if yes how.
2)
can we set the on gui status in case of ALV or ALV grid if yes plz explane with a example.
3)
what r the event in alv.
thanks
deepak
‎2007 Jan 25 9:58 AM
Hi Deepak,
Go through the example BCALV_GRID* you will get all ur answers.
Events are something when you click something on ALV GRID .
gui status is possible with your own user defined tool bar .
Please reward if useful.
‎2007 Jan 25 10:41 AM
Hi,
We can set the GUI status of the screen in which ALV is displayed by using PF status in the PBO of the screen.Further,if you want to remove a few buttons on the tool bar of the ALV,then you can use the following example for the same by passing values for IT_TOOLBAR_EXCLUDING parameter in the set_table_for_first_display method.In the example below,the Subtotal and the filter button has been removed from the toolbar:
DATA: alv type ref to cl_gui_alv_GRID,
cont type ref to cl_gui_custom_container,
itab_spfli type table of spfli,
ok_code type sy-ucomm,
itab_ui type UI_FUNCTIONS,
wa_ui type UI_FUNC.
START-OF-SELECTION.
select * from spfli into table itab_spfli.
WA_ui = CL_GUI_ALV_GRID=>MC_MB_FILTER. "static no
APPEND WA_ui TO Itab_ui.
WA_ui = CL_GUI_ALV_GRID=>MC_MB_SUBTOT.
APPEND WA_ui TO Itab_ui.
call screen 100.
END-OF-SELECTION.
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
MODULE STATUS_0100 OUTPUT.
seT PF-STATUS 'GUI'.
SET TITLEBAR 'xxx'.
if cont is initial.
CREATE OBJECT cont
EXPORTING
CONTAINER_NAME = 'CONTAINER'.
CREATE OBJECT ALV
EXPORTING
I_PARENT = CONT.
CALL METHOD ALV->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'SPFLI'
IT_TOOLBAR_EXCLUDING = itab_ui
CHANGING
IT_OUTTAB = itab_spfli
.
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.
ENDMODULE. " STATUS_0100 OUTPUT
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
MODULE USER_COMMAND_0100 INPUT.
case ok_code.
when 'BACK'.
leave to screen 0.
when 'EXIT'.
leave to screen 0.
when 'SAVE'.
MODIFY spfli from table itab_spfli.
ENDCASE.
endmodule.
<b>FOR EVENTS IN ALV</b>
Based on requirements,we can use the various events available in cl_gui_alv_grid.
For example,we can choose a particular row in ALV and fetch all the details using the event get_selected_row.You can check all the events available for ALV :Use transaction se24 and display the class cl_gui_alv_grid ->events tab.
To use any event,in your program you should set handler for the event,define a local class for event definition and in the implementation,write the event handling method based on your logic.
FOR MORE INFO ON ALV,check this link.
Regards,
Beejal
**PLEASE REWARD IF ANSWER HELPS