Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

How to respond to double-click on the record of table-control?

Former Member
0 Kudos

If I double-click on the record of the table-control,no matter which fields of this record,

I want to show detail information of this record.

What should I do?

Thank you!


Former Member
0 Kudos

Wow, there is something new that I learnt as well. For

your screen , say 9000, go to <b>Element List</b> tab.

Click on the <b>Display Attributes</b> tab, the last checkbox is (hold your breath) - <b>Respond to DoubleClick</b>. It acts as a <i>hotspot</i> event. The function code is <b>PICK</b>. I guess, you can call another screen in this event, and display the required information.


Subramanian V.

0 Kudos

thank you _

and I give you a very help rank

0 Kudos

Thanks Minghan Song.


Subramanian V.

0 Kudos

Hi Minghan

It seems your problem is solved. It is your decision to give points, however, you should mark the thread as solved.

Kind regards...


Former Member
0 Kudos

Hello Minghan,

There's another solution to your question. This can be used if you do not want to display the HOTSPOT. If you want to display the information no matter where the user clicks on the table-control, then you would have to make the entire content of the table control as a HOTSPOT. This might be undesirable from a good-UI design perspective. Also the user will no longer be able to place the cursor in the table control. The Detail information always keeps popping up.

So here's what I propose...

When you set the GUI status for the screen (on which you have the table control), you can assign a Function Code to the F2 Key. The action of Double Click is always linked to the F2 Key. So this way you are indirectly assigning a Function code to the Double Click event. You can show the detail information when the Function Code is set.

Trust this is a more elegant solution to your requirement.

Let us know what you think...


Anand Mandalika.

0 Kudos

I am quite sorry.

I could not still solve the problem.

The Dynpro requirements of our customer is as below:

1. there are three fields in the tablecontrol.

first field is Document No.

second field is Shipping type

the last field is Shipping type description

2. When the user double-click any field with value of the tablecontrol , It will start the batchinput VL02N

with the Document No. of the corresonding index of the field double-clicked.

All the methods, you have provided seemed to be no effect.

So, I really need your help!

_ Thank you

0 Kudos

Hi Minghan,

Sorry to hear that, our help was not useful enough. I still would want to know what went wrong, and you have not provided that information.

I am sure you have enabled the "Respond to Double-Click" checkbox in SE50 - Screen Editor. When you double click on any of these fields(fields for which you have enabled the above checkbox), there will be a user-command PICK. You have to capture the field position using GET CURSOR. This will give you the information of that record and then you can process the batch input VL02N as you want.

Please let us know where you are facing the problem,which area. I am sure one of us, would help you get through.


Subramanian V.

0 Kudos

Thank you very much!

for your help very time!

I will try my best!

Message was edited by: Minghan Song

0 Kudos

Hi Minghan,

The problem, I think, could be in either of the two areas:

1. Handling the Double-Click for the table-control and identifying the correct entry.

2. Starting the Batch Input Program wth the captured entry.

I shall assume that you have a problem with the first part and shall give you a code snippet which has worked for me.


controls tc type tableview using screen '0100'.

data : begin of itab occurs 0,
         f1  type vbeln,
         f2  type posnr,
       end of itab.

data clicked_line type i.


  select vbeln
     up to 40 rows
     from vbap
     into table itab.


  call screen 100.

*&      Module  PBO  OUTPUT
*       text
* this PF-Status has only one Function Code. The funcion code 'CLICK' has been 
*assigned to the Function Key F2.
  set pf-status 'TEST'.
*&      Module  PAI  INPUT
*       text

  if sy-ucomm eq 'CLICK'.
    clear sy-ucomm.
* Get the position on the screen where the user has double-clicked.
    get cursor line clicked_line.            
* The table control has the name TC. A structure called TC will contain the 
* information about the table control. TOP_LINE is the row of the 
* internal table which is displayed topmost in the table control in the current 
* view (after a possible scrolling)
    clicked_line = tc-top_line + clicked_line.
    clicked_line = clicked_line - 1.
* Clicked_line now has the index of the internal table row which has been 
* clicked on the screen.
    read table itab index clicked_line.
* Here you write your code which calls the BDC etc.,
    message i555(bc_bor) with itab-f1 itab-f2.
  elseif sy-ucomm ne space.
    leave to screen 0.


 loop at itab with control tc.





I believe that the above code will help you understand what's wrong with your table control and rectify it. If you have any doubts on this, please get back.

Hope to see your problem get solved soon.


Anand Mandalika.