10-18-2006 6:46 AM
Hello everyone,
Query:
Is it possible to display a custom push button in the application tool bar while displaying an ALV report(1st one)?
On pressing this custom push button will I be able to display another ALV report(2nd one) based on the selection made on the current ALV report(1st one)?
10-18-2006 6:53 AM
Yeah, its very much possible to add a custom pushbutton on the toolbar through GUI Status. That is you have to create a custom menu bar for your program where you may attach a button.
The second functionality is also possible by catching the SELFIELD event for ALV on the click of the pushbutton.
Regards,
Amit
10-18-2006 8:16 AM
HI,
Go thru this links.
http://www2.warwick.ac.uk/services/finance/sap/training/reporting4.7/output (alv report)
http://www.sapdevelopment.co.uk/reporting/alvhome.htm (Alv)
Thanks
Sunil
10-18-2006 8:18 AM
hi,
chk this sample standard pgm.
BCALV_EDIT_05 This example shows how to use checkboxes within an ALV Grid Control. You learn:
(1) how to define a column for editable checkboxes for an attribute of your list
(2) how to evaluate the checked checkboxes
(3) how to switch between editable and non-editable checkboxes
rgds
anver
if hlped pls mark points
10-18-2006 9:07 AM
hi,
we can do that.
for that you need to populate the event structure with USERCOMMAND and SET_PF_STATUS formnames.
In set_pf_status form ...endform write set pf-status.
define the buttons in menupainter with OKCODES.
in form USERCOMMAND capture the OKCODES and do whatever you want .
dont forget to pass the event structure to GRID/LIST DISPLAY FM of ALV.
REGARDS,
10-19-2006 5:22 AM
Hiii..
I have written a sample code for You
..
<b>"Call the below FunctionModule For Displaying The List
" And see the bolded line in the Below FunctionModule
" STANDARD_02 and USER_COMMAND are the subroutine Names</b>
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
<b>i_callback_pf_status_set = 'STANDARD_02'</b>
<b> i_callback_user_command = 'USER_COMMAND '</b>
i_structure_name = 'ZST_SCARR'
is_layout = is_layout
it_fieldcat = gt_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
is_sel_hide = is_sel_hide
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
it_events = e03_lt_events[]
IT_EVENT_EXIT =
is_print = t
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_scarr
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 PF_STATUS_SET
**----
<b>" Here Set A Button In Application Toolbar Using PF- Status</b>
FORM standard_02 USING extab TYPE slis_t_extab.
SET PF-STATUS 'STANDA02' EXCLUDING extab.
ENDFORM. "STANDARD_02
&----
*& Form USER_COMMAND
&----
text
----
-->R_UCOMM text
-->RS_SELFIELDtext
----
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
<b> "menubutton with functioncode GOTO's Action</b>
WHEN 'GOTO'.
READ TABLE it_scarr INDEX rs_selfield-tabindex. "cursorposit.
IF sy-subrc = 0.
WRITE:/ it_scarr-carrid,
/ it_scarr-carrname.
ENDCASE.
ENDFORM. "USER_COMMAND<b></b>
Hope it helps..
Regards,
Simy
10-19-2006 5:52 AM
You should copy the 'STANDARD' GUI status from program SAPLKKBL using transaction SE90 >Programming SubObjects> Gui Status.
Execute this transaction to get to next screen. select status using checkbox. click on GUI Status --> Copy.
Enter your Z program name and the name you what for this status - you can keep it as 'STANDARD' to be simple.
Then you can edit the new status to add or delete buttons. This will also bring in the standard SAP ALV functionality such as sorting/subtotaling etc...
When you call 'REUSE_ALV_GRID_DISPLAY' make sure you pass it the new status name.
an example of one of mine:
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZSDBOLST_REPORT'
i_callback_pf_status_set = 'STANDARD' <----
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'I_BOLACT'
i_grid_title = 'BOL Action Report'(031)
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
i_save = 'A'
is_variant = v_variant
TABLES
t_outtab = i_bolact
EXCEPTIONS
program_error = 1
others = 2.
Form Set_pf_status
Notes: Called by FM REUSE_ALV_GRID_DISPLAY
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZSTANDARD'.
ENDFORM. "Set_pf_status
Best Regards,
Vibha
*Please mark all the helpful answers