2008 May 29 3:27 PM
Hi,
I have written the following code. I am not getting the buttons which I have created using SE41.
Please look into the following code and suggest.
Thanks in davance,
Ishaq.
START-of-selection.
........
Perform Display_GRID_Output Using 'SET_PF_STATUS'.
........
FORM DISPLAY_GRID_OUTPUT USING PV_STATUS.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'GT_OUTPUT'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = GT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
.
IF SY-SUBRC = 0.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 1
IMPORTING
ET_EVENTS = GT_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2
.
IF SY-SUBRC = 0.
READ TABLE GT_EVENTS WITH KEY name = slis_ev_pf_status_set
INTO GS_EVENTS.
IF sy-subrc = 0.
MOVE 'SET_PF_STATUS' TO GS_EVENTS-FORM.
MODIFY GT_EVENTS FROM GS_EVENTS index sy-tabix.
CLEAR GS_EVENTS.
ENDIF.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = PV_STATUS
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = GT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = GT_OUTPUT
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.
ENDIF.
ENDFORM. " DISPLAY_GRID_OUTPUT
&----
*& Form SET_PF_STATUS
&----
SET PF STATUS
----
FORM SET_PF_STATUS.
Set Pf-Status 'DELETE'.
ENDFORM. " SET_PF_STATUS
2008 May 29 3:34 PM
Hi,
Here you are paasing the PF STATUS NAME.
But, that is not the way.
You need to pass the form name. In that form you need to define your status. and No need of perfrom statement as it is dynamically called.
Wil give sample code .....use it.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'AT_USER_COMMAND1'
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = wa_layout
it_fieldcat = it_fieldcat
it_sort = it_ekposortinfo[]
it_events = it_events
IMPORTING
E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER
TABLES
t_outtab = it_ekpo
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 SET_PF_STATUS
*&----
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD' excluding rt_extab. "Copy from SALV .
ENDFORM.
Reward points if helpful
Regards
Sandeep REddy
Hi,
Here you are paasing the PF STATUS NAME.
But, that is not the way.
You need to pass the form name. In that form you need to define your status. and No need of perfrom statement as it is dynamically called.
Wil give sample code .....use it.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'AT_USER_COMMAND1'
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = wa_layout
it_fieldcat = it_fieldcat
it_sort = it_ekposortinfo[]
it_events = it_events
IMPORTING
E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER
TABLES
t_outtab = it_ekpo
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 SET_PF_STATUS
*&----
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD' excluding rt_extab. "Copy from SALV .
ENDFORM.
Reward points if helpful
Regards
Sandeep REddy
2008 May 29 3:34 PM
Hi,
Here you are paasing the PF STATUS NAME.
But, that is not the way.
You need to pass the form name. In that form you need to define your status. and No need of perfrom statement as it is dynamically called.
Wil give sample code .....use it.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'AT_USER_COMMAND1'
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = wa_layout
it_fieldcat = it_fieldcat
it_sort = it_ekposortinfo[]
it_events = it_events
IMPORTING
E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER
TABLES
t_outtab = it_ekpo
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 SET_PF_STATUS
*&----
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD' excluding rt_extab. "Copy from SALV .
ENDFORM.
Reward points if helpful
Regards
Sandeep REddy
2008 May 29 3:34 PM
Hello,
To output a button in the ALV:
call function module reuse_alv_grid_display.
exporting.
programname = gd_repid.
t_fieldcatalog = d_fieldcat.
set pf_status = 'SET_PF_STATUS'. "USE THAT SETS THE PF-STATUS
importing.
t_outtab = itab.
exceptions.
form set_pf_status using rt_extab type slis_t_extab.
SET PF_STATUS 'NEWSTATUS'.
endform.
Regards.
2008 May 29 3:46 PM
This is what, I am doing. Still not working.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PF_STATUS_SET
= 'SET_PF_STATUS'
IT_FIELDCAT = GT_FIELDCAT
TABLES
T_OUTTAB = GT_OUTPUT
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
ENDIF.
ENDFORM. " DISPLAY_GRID_OUTPUT
FORM SET_PF_STATUS using rt_extab type slis_t_extab.
Set Pf-Status 'DELETE'.
ENDFORM. " SET_PF_STATUS
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |