SM30 Dinamic buttons
Dear,
Sometimes we need either hide or display some buttons in maintain tables.
I’ve decided to make a sample document to easily find where to do such maintain.
1) In PBO from its screen, create a new module, consequently a new include.
2) WIthin of new module, insert the ABAP code below, for each button that you need to manipulate, here you can insert any logic in order to your process, I ‘ve decided to insert the main buttons to exclude from screen.
MODULE YM_SET_PF OUTPUT.
* Buttons to exclude
MOVE ‘ANZG’ TO excl_cua_funct–function. COLLECT excl_cua_funct. ” Modify
MOVE ‘NEWL’ TO excl_cua_funct–function. COLLECT excl_cua_funct. ” New entry
MOVE ‘ORGI’ TO excl_cua_funct–function. COLLECT excl_cua_funct. ” Undo
MOVE ‘KOPE’ TO excl_cua_funct–function. COLLECT excl_cua_funct. ” Copy
MOVE ‘DELE’ TO excl_cua_funct–function. COLLECT excl_cua_funct. ” Delete
ENDMODULE. ” YM_SET_PF OUTPUT
3) Now you have your maintain table only displaying data for end user, although it seems unnecessary, I’ve had to do it least three times, and every time I thought that I never will need to do it again.
4) It’s importante say, if you regenerate you maintain table, you’ll lose your custom code. So be careful.
I hope it can ease your routine.
Best regards.