Professional Documents
Culture Documents
Shared code for the Table maintainence generator. Since long time, I was wondering how can I
add my own custom PF buttons in the table maintainence screen which comes in SM30. Today,
this discussion in the SDN form raised this point in my mind again – Adding Custon button on
Maintainance View.
I have started searching the GUI status in the Function Group which I have provided in the Table
maintainence generator, but I didn’t find it in the object browser (SE80) of the Function group. So,
I thought this must be taken care by the Events in the Table maintainence. I searched the list and
I found suitable one – ST (GUI Menu Main Program Name). Follow this link for mor information
on Table maintenace events – Extended Table Maintenance Events
There will be one popup of language compatability, which you can pass it on by pressing Enter.
In this code snippet, I am showing how to handle our user command. Here I am just giving
information popup when user interact with the button in the change mode.
Code Snippet for Handling custom button
***INCLUDE LZTEST_TABLESI01 .
*-------------------------------------------------------------------
---*
*&------------------------------------------------------------------
---*
*& Module CUSTOM_PF_BUTTON INPUT
*&------------------------------------------------------------------
---*
* Custom Button Handling
* Here TOTAL table is avliable with all the data.
* User command is stored in the field FUNCTION
*-------------------------------------------------------------------
---*
MODULE 0custom_pf_button INPUT.
*
DATA: l_count TYPE i.
* Table of the same structure of the TOTAL which can be exported
DATA: BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE ztest_pf_status.
INCLUDE STRUCTURE vimflagtab.
DATA: END OF itab.
*
CASE function.
WHEN '0POPUP'.
itab[] = total[].
*
DELETE itab WHERE mark IS INITIAL.
DESCRIBE TABLE itab LINES l_count.
*
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = 'Information'
txt1 = 'Selected number of entries'
txt2 = l_count.
*
CLEAR l_count.
*
ENDCASE.
*
ENDMODULE. " CUSTOM_PF_BUTTON INPUT
Don’t forget to activate the Function Group, since we have created a new include in it.