cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to create a custom event on double click for a View table created with TMG

0 Likes
645

Hello guys, 

I want to make a feature that goes like this: on a double click of a field in a custom view of a table, i want to call another transaction(se80) that will display a method stored inside that field (that's my configuration table that has the names of the methods). How to implement something like this ? I've found in a screen painter that there is an option for field where I can implement a respond on double click, but nothing on where to actually implement the logic for an event. Please help.

double click event from a screen painterdouble click event from a screen painter

Accepted Solutions (0)

Answers (1)

Answers (1)

rhj09
Discoverer
0 Likes

Hi,

To create a double-click event for a field in a custom table view using TMG in SAP:

  • Navigate to your screen in SE51.
  • Double-click the field and set the double-click event.
  • Implement the event logic in your ABAP code using CALL TRANSACTION to execute SE80 and display the method stored in your configuration table.

Example:

DATA: lv_method_name TYPE string.

MODULE user_command_XXX INPUT.

  CASE sy-ucomm.
    WHEN 'DOUB'.
      READ TABLE it_table INTO wa_table INDEX sy-tabix.
      lv_method_name = wa_table-method_name. "Fetch method name from config table
      CALL TRANSACTION 'SE80' AND SKIP FIRST SCREEN.
  ENDCASE.

ENDMODULE.

 

Replace 'XXX' with your module name and adjust variables as needed.

Hope this helps!

 

 

0 Likes

I did what you've told me but I'm guessing that I've missed something. I did implement the logic in PAI, but I got the error: Unable to interpret INPUT. 

MODULE user_command_00v1 INPUT.
  datalv_method_name type string.
  case sy-ucomm.
    when 'DOUB'.
      read table mapping assigning FIELD-SYMBOL(<fv_read>)
      index sy-tabix.
      lv_method_name <fv_read>-method"Fetch method name from config

      CALL transaction 'SE80' and skip first screen.
  endcase.

ENDMODULE.