10-19-2007 4:51 AM
Hi,
I collected some data in an internal table. when i am trying to display the
Output through REUSE_ALV_GRID_DISPLAY.
I included the statement
SET PF-STATUS 'VIEW_ORDERS'.
But this statement is not executed. Y what's the problem.
10-19-2007 4:53 AM
Hi,
You have to create a subroutine SET_PF_STATUS..Then pass the subroutine name in the parameter
i_callback_pf_status_set ..
Check this example
TYPE-POOLS: slis.
DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
DATA: s_layout TYPE slis_layout_alv.
DATA: BEGIN OF itab OCCURS 0,
icon TYPE icon-id,
vbeln TYPE vbeln,
kunnr TYPE kunnr,
erdat TYPE erdat,
box TYPE c,
END OF itab.
DATA: v_repid TYPE syrepid.
START-OF-SELECTION.
* Get the data.
SELECT vbeln kunnr erdat UP TO 100 ROWS
FROM vbak
INTO CORRESPONDING FIELDS OF TABLE itab.
IF sy-subrc <> 0.
MESSAGE s208(00) WITH 'No data found'.
LEAVE LIST-PROCESSING.
ENDIF.
* Modify the record with red light.
itab-icon = '@0A@'.
MODIFY itab TRANSPORTING icon WHERE NOT vbeln IS initial.
v_repid = sy-repid.
* Get the field catalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'ICON'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-seltext_l = 'Status'.
s_fieldcatalog-icon = 'X'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-rollname = 'VBELN'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '3'.
s_fieldcatalog-fieldname = 'KUNNR'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-rollname = 'KUNNR'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '4'.
s_fieldcatalog-fieldname = 'ERDAT'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-rollname = 'ERDAT'.
APPEND s_fieldcatalog TO t_fieldcatalog.
* Set the layout.
s_layout-box_fieldname = 'BOX'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
is_layout = s_layout
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = t_fieldcatalog[]
TABLES
t_outtab = itab.
*---------------------------------------------------------------------*
* FORM SET_PF_STATUS *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> EXTAB *
*---------------------------------------------------------------------*
FORM set_pf_status USING extab TYPE slis_t_extab.
SET PF-STATUS 'TEST2'.
ENDFORM.
*---------------------------------------------------------------------*
* FORM user_command *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> UCOMM *
* --> SELFIELD *
*---------------------------------------------------------------------*
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
* Check the ucomm.
IF ucomm = 'DETAIL'.
LOOP AT itab WHERE box = 'X'.
itab-icon = '@08@'.
MODIFY itab TRANSPORTING icon.
ENDLOOP.
ENDIF.
selfield-refresh = 'X'.
ENDFORM.
Thanks
Naren
10-19-2007 5:04 AM
Thanks for ur reply.
i have a doubt here.
what is this extab here.
FORM set_pf_status USING extab TYPE slis_t_extab.
SET PF-STATUS 'TEST2'.
ENDFORM.
10-19-2007 5:06 AM
Hi,
If you want you can exclude some of the function codes from the GUI status
Thanks
Naren
10-19-2007 5:09 AM
Hi when i tried ur solution.
I am not getting any push button which i placed in the PF-STATUS.
Why it is like that,
10-19-2007 5:10 AM
10-19-2007 5:12 AM
10-19-2007 5:19 AM
Hi,
Did you activate the GUI status..
What is showing in the output screen
Thanks
Naren
10-19-2007 5:21 AM
ya i activated. nothing iam not getting any of my pushbuttons there.
1 more thing y we have to include USER-COMMAND form ther.
we can use AT USER-COMMAND, itself right.
10-19-2007 5:23 AM
Hi,
If you display ALV grid...AT USER-COMMAND will not be required..and will not even trigger .. I guess..
Thanks
naren
10-19-2007 5:58 AM
10-19-2007 6:07 AM
Hi,
The field catalog is for displaying the columns..You cannot give any write statement
Thanks
Naren