Some times we might have to enhance the table maintenace generator to add additional button .
While creating TMG for table, system generates own set of codes which we need to enhance .
There is some events who especially handle PF status.
Following are the steps to create our own push button on TMG.

1. Create Table maintenance generator for the table.

2. Go to the Event tab on table maintenance generator as shown in below screen shot.
Environment->modification->events.

3. Enter the event name and form routine name and press enter .you will get error because it takes form routine name only starts with SAPL.

4. Now enter the correct routine name and press on editor button in front of routine name.

5. On clicking editor tab, menu Painter screen will open.

6. Click on copy interface and copy the interface from SAPLSVIM to SAPLZSD_CUST_ROFF.

7. Add one more button.

8. Now go to the maintenance screen.

9. Create a module in PAI.

10. Double click on the module name and create the include program as shown in below screen shot.


11. Write the below code in the include.
For demo purpose, we would display Hello in pop up window.
*----------------------------------------------------------------------*
***INCLUDE LZSD_CUST_ROFFI01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module SET_PF INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE SET_PF INPUT.
data count_er type i.
CASE function.
WHEN 'POP'.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = 'Information'
txt1 = 'HELLOOOOOOOOOO............'
txt2 = count_er.
ENDCASE.
ENDMODULE. " SET_PF INPUT
***INCLUDE LZSD_CUST_ROFFI01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module SET_PF INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE SET_PF INPUT.
data count_er type i.
CASE function.
WHEN 'POP'.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = 'Information'
txt1 = 'HELLOOOOOOOOOO............'
txt2 = count_er.
ENDCASE.
ENDMODULE. " SET_PF INPUT
12. Now activate all development including function group. After activating you can see the pushbutton ‘POPUP’.

13. Click on pushbutton to display popup window.

No comments:
Post a Comment