‎2006 Sep 20 12:53 PM
Please execute the coding below and see , we are not getting the standard menu bar. help needed.
Sathya
-
*
REPORT ZTEST_ALV5.
&----
*& TYPE-POOLS
&----
TYPE-POOLS:slis.
&----
*& FOR FIELD CATALOG
&----
DATA: is_layout TYPE slis_layout_alv,
t_fieldcat TYPE slis_t_fieldcat_alv,
t_sort TYPE slis_t_sortinfo_alv,
t_event TYPE slis_t_event,
i_grid_title(50) TYPE c,
wa_fieldcat TYPE slis_fieldcat_alv,
wa_sort TYPE slis_sortinfo_alv.
&----
*& INTERNAL TABLE DECLARATION *
&----
DATA: BEGIN OF itab OCCURS 0,
PSOZL TYPE BKPF-PSOZL,
XWVOF TYPE BKPF-XWVOF,
BRNCH TYPE BKPF-BRNCH,
BLIND TYPE BKPF-BLIND,
END OF itab.
&----
*& SELECTION SCREENS *
&----
SELECTION-SCREEN BEGIN OF BLOCK sel WITH FRAME TITLE text-001.
SELECTION-SCREEN END OF BLOCK sel.
&----
*& INITIALIZATIONS *
&----
INITIALIZATION.
&----
*& START-OF-SELECTION *
&----
START-OF-SELECTION.
PERFORM populate.
PERFORM populate_fieldcat.
PERFORM build_event_alv.
PERFORM display_list.
END-OF-SELECTION.
&----
*& POPULATE DATA INTO INTERNAL TABLE
&----
FORM populate .
*----
populate the internal table with data hat is to be displayed in
the grid control.
*----
ENDFORM. "populate
&----
*& Form ATTRIBUTES OF FIELD CATALOGUE
&----
FORM add_fcat USING col_pos
fieldname
tabname
seltext_m
outputlen.
wa_fieldcat-col_pos = col_pos.
wa_fieldcat-fieldname = fieldname.
wa_fieldcat-tabname = tabname.
wa_fieldcat-seltext_s = wa_fieldcat-seltext_l = wa_fieldcat-seltext_m = seltext_m.
wa_fieldcat-outputlen = outputlen.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. "ADD_FCAT
&----
EVENTS
FOR TOP-OF-PAGE
&----
FORM build_event_alv. " TABLES xt_evnt .
DATA : wa_evnt TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = t_event
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
wa_evnt-name = slis_ev_top_of_page.
wa_evnt-form = 'TOP_OF_PAGE'.
APPEND wa_evnt TO t_event.
ENDFORM. " build_even t_alv
&----
TOP OF PAGE
&----
FORM top_of_page.
ENDFORM. "top_of_page
&----
*& Form DISPLAY_ALV
&----
FORM display_list .
is_layout-info_fieldname = 'COLOR'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = is_layout
it_fieldcat = t_fieldcat
it_sort = t_sort
it_events = t_event
i_save = 'A'
TABLES
t_outtab = itab.
IF sy-subrc <> 0.
EXIT.
ENDIF.
ENDFORM. "display_list
&----
*& FORM POPULATE_FIELDCAT
&----
FORM populate_fieldcat.
PERFORM add_fcat USING '' 'PSOZL' 'ITAB' 'ACTUAL POSTING' '1' .
PERFORM add_fcat USING '' 'XWVOF' 'ITAB' 'B/EX.BEFORE DUE DATE' '1' .
PERFORM add_fcat USING '' 'BRNCH' 'ITAB' 'BRANCH NUMBER' '4' .
PERFORM add_fcat USING '' 'BLIND' 'ITAB' 'BUDGETARY LEDGER INDICATOR' '1' .
ENDFORM. "populate_fieldcat
‎2006 Sep 20 1:01 PM
hi,
To get the menu bar, we have to pass pf-status in the function module <b>REUSE_ALV_GRID_DISPLAY</b>.
Regards,
Sailaja.
‎2006 Sep 21 5:14 AM
How do we pass the pf status in the function module REUSE_ALV_GRID_DISPLAY.
Sathya
‎2006 Sep 21 5:29 AM
HI,
10. Slis_ev_pf_status_set TYPE slis_formname VALUE 'PF_STATUS_SET'.
If a user list status is to be set, it must be done in the form routine assigned to this event. The ALV function codes, which must not be active, are in the Parameter RT_EXTAB. This table must be passed with the SET PF-STATUS command (with inactive user function codes as well, if necessary).
The STANDARD status of the function group SALV should be used as a template for a user-specific status. As this is a frequently used Callback event, its form routine can also be passed directly in the interface in the IMPORTING parameter I_CALLBACK_PF_STATUS_SET.
Regards,
Sailaja.
‎2006 Sep 21 6:28 AM
we are not clear on what you have explained. can u please send as the coding part.
Sathya
‎2006 Sep 21 6:41 AM
Hi,
Here is how you do that.
1. Create a PF-status(e.g. MYSTATUS) in your program by copying STANDARD GUI status of Function Group SALV(or program SAPLSALV). Add any additional menu otions here.
2. In your call function 'REUSE_ALV_LIST_DISPLAY' add importing parameter
i_callback_pf_status_set = 'SET_PF_STATUS'
3. Code a FORM SET_PF_STATUS in your program as below.
form set_pf_status using rt_extab type slis_t_extab.
set pf-status 'MYSTATUS' excluding rt_extab.
endform.
Thanks,
Murali
‎2006 Sep 21 5:42 AM
Hi ,
You Can Do As Below
SET PF-STATUS 'CHECK' IMMEDIATELY.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZSNPR_VALIDATION_VSUMMARY'
i_callback_pf_status_set = 'CHECK'
is_layout = ls_layout
it_fieldcat = it_fieldcat
i_callback_user_command = 'USER_COMMAND12'
it_event_exit = gt_events_exit
i_callback_top_of_page
= 'TOP_OF_PAGE_VSUMMARY' "'top_of_page_vsummary'
TABLES
t_outtab = gt_vsum1.
Regards
Ahasan
‎2006 Sep 21 6:45 AM
Hi Mohammed,
Your reply was very useful. we got the menu bar correctly but the standard toolbar is not enabled. back, exit, cancel are not enabled? can u please help.
Sathya
‎2006 Sep 21 6:49 AM
Hi,
While creating the PF status. In The Standard Tool Bar option ie there Are Three options
Menu bar
Application toolbar
and Function keys
In Function keys detree it and
Type Back Cancel And Exit for the Respective Buttons And Activate Ur PF status.
Regards
Ahasan
Message was edited by: Mohammed Ahasanullah Mulla
‎2006 Sep 21 9:30 AM
‎2006 Sep 21 6:42 AM
Hi try this
steps:
1. Update 'REUSE_ALV_GRID_DISPLAY'
i_callback_pf_status_set = 'SET_PF_STATUS' statement.
2. Create 'SET_PF_STATUS' FORM
3. Create pf_status (i.e. 'ZNEWSTATUS').
- It is recommend that you copy standard status'STANDARD' from function group SALV
and modify it accordingly. ALV standard function codes always start with '&'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
i_callback_pf_status_set = 'SET_PF_STATUS' "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'PFSTATUS'.
"Copy of 'STANDARD' pf_status from fgroup SALV
ENDFORM.