0% found this document useful (0 votes)
178 views8 pages

Add Custom Button in TMG Screen

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
178 views8 pages

Add Custom Button in TMG Screen

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Add Custom in TMG (Table maintance Generator )

Step 1

➢ Go to Table maintenance Generator


Step 2

➢ Click on Modification and Events


Step 3

➢ Go to F4 and Select Event number ST Give name of Event with prefix SAPL (Table name ) then enter then we
redirect to SE41 Screen automatically .

Step 4
➢ Select the user interface from application bar .

Step 5

Step 6
➢ Give name of standard pf status name then edit go to change mode of user interface and
add our button in menu bar .

Step 7

➢ Go to system status of TMG screen .

Step 8
➢ Double click on Screen number .

Step 9

➢ Create Module in PAI Event of Screen for our button logic implement .

Step 10
Necessary Code require

DATA : gt_ztest TYPE STANDARD TABLE OF zaop1_fi.


DATA : table_control_col TYPE LINE OF scxtab_column_it.
DATA : col_sel TYPE scxtab_column, lv_col_pos TYPE int4.

DATA lt_tab_agent TYPE STANDARD TABLE OF zaop1_fi.

FIELD-SYMBOLS: <lfs_xfrom> TYPE x, "Hexadecimal value of from value


<lfs_xto> TYPE x. "Hexadecimal value of to value

IF sy-ucomm = 'SORT'.
CLEAR lt_tab_agent[].
LOOP AT extract.
APPEND INITIAL LINE TO lt_tab_agent ASSIGNING <lfs_xto> CASTING.
ASSIGN extract TO <lfs_xfrom> CASTING.
<lfs_xto> = <lfs_xfrom>.
ENDLOOP.

* READ TABLE tctrl_zaop1_fi-cols INTO table_control_col WITH KEY selected = 'X'.


* IF sy-subrc = 0.
* CASE table_control_col-index .
* WHEN '1'.
* SORT lt_tab_agent[] ASCENDING BY gjahr.
* WHEN '2'.
* SORT lt_tab_agent[] ASCENDING BY resp.
* WHEN '3'.
* SORT lt_tab_agent[] ASCENDING BY monat.
* ENDCASE.

REFRESH extract.
SORT lt_tab_agent[] BY gjahr DESCENDING.
LOOP AT lt_tab_agent INTO DATA(zmrp).
APPEND INITIAL LINE TO extract ASSIGNING <lfs_xto> CASTING.
ASSIGN zmrp TO <lfs_xfrom> CASTING.
<lfs_xto> = <lfs_xfrom>.
ENDLOOP.
* ENDIF.

ELSEIF sy-ucomm = 'SORT_DOWN'.


CLEAR lt_tab_agent[].
LOOP AT extract.
APPEND INITIAL LINE TO lt_tab_agent ASSIGNING <lfs_xto> CASTING.
ASSIGN extract TO <lfs_xfrom> CASTING.
<lfs_xto> = <lfs_xfrom>.
ENDLOOP.
* READ TABLE tctrl_zaop1_fi-cols INTO table_control_col WITH KEY selected = 'X'.
* IF sy-subrc = 0.
* CASE table_control_col-index .
* WHEN '1'.
* SORT lt_tab_agent[] DESCENDING BY gjahr.
* WHEN '2'.
* SORT lt_tab_agent[] DESCENDING BY resp.
* WHEN '3'.
* SORT lt_tab_agent[] DESCENDING BY monat.
* ENDCASE.

REFRESH extract.
SORT lt_tab_agent[] BY gjahr ASCENDING.
LOOP AT lt_tab_agent INTO DATA(zmrp1).
APPEND INITIAL LINE TO extract ASSIGNING <lfs_xto> CASTING.
ASSIGN zmrp1 TO <lfs_xfrom> CASTING.
<lfs_xto> = <lfs_xfrom>.
ENDLOOP.
* ENDIF.
ELSEIF SY-ucomm = 'BACK' OR SY-ucomm = 'EXIT' OR SY-ucomm = 'CANCEL' OR SY-UCOMM = 'EABR' OR SY-UCOMM = 'ENDE'.
LEAVE TO SCREEN 0.
ENDIF.
CLEAR sy-ucomm.

You might also like