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

Dialog programming: making standard input field sensitive to double-click

Former Member
0 Likes
1,508

Hello,

I'd like make standard input field sensitive to double-click. I know that I should register double-click event to input field class and write handler. But I can't find out from what class I should derive. What is class of standard input field? Can I derive from that class? Or is there another way to accomplish my requirements?

Best regards,

Josef Motl

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,296

go to the definition of the screen in screen painter(se51) when you double click on the screen element, the screen painter attributes popup allows you to specify that the element can responf to double click.

Hello,

I'd like make standard input field sensitive to double-click. I know that I should register double-click event to input field class and write handler. But I can't find out from what class I should derive. What is class of standard input field? Can I derive from that class? Or is there another way to accomplish my requirements?

Best regards,

Josef Motl

9 REPLIES 9
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,296

I don't believe that this functionality is supported. If it does exists, I would really be interested in seeing it.

What is the purpose for this? What exactly is the requirement, maybe you can put a button next to the field instead.

Regards,

Rich Heilman

Read only

0 Likes
1,296

Hello Rich,

my original requirement was to fire event (transformed to OK_CODE in started PAI) when F4 was pressed and selection from this value help was made. After this selection I'd like to change content of screen (precisely content of an ALV grid) immediately without any click to button or pressing enter.

Regards,

Josef

Read only

0 Likes
1,296

Oh yes, you can use the "Responds on Double Click" attribute in screen painter. I did not think that this worked for regular input fields(thought only for checboxes). You must also set the gui status F2 function code, I usually use PICK.

Regards,

Rich Heilman

Read only

0 Likes
1,296

Hello Josef,

It's not clear from your description why you need a field to respond to double click.

Search this forum for the terms DYNP_VALUES_UPDATE to get the answer to your question. You can also refer to the documentation of this Function Module.

Regards,

Kinshuk Saxena.

Read only

0 Likes
1,296

I agree with Kinshuk, Not sure why you need this functionality. Please implement this sample program do F4 help on the BURKS field and select a company code. Notice that is populates all the rest of the fields. Is this the functionality that you require?



report zrich_0002 .

parameters: p_bukrs type t001-bukrs,
            p_butxt type t001-butxt,
            p_ort01 type t001-ort01,
            p_land1 type t001-land1.

data: dynfields type table of dynpread with header line.
data: return type table of ddshretval with header line.

at selection-screen on value-request for p_bukrs.

  call function 'F4IF_FIELD_VALUE_REQUEST'
       exporting
            tabname           = 'T001'
            fieldname         = 'BUKRS'
            dynpprog          = sy-cprog
            dynpnr            = sy-dynnr
            dynprofield       = 'P_BUKRS'
       tables
            return_tab        = return
       exceptions
            field_not_found   = 1
            no_help_for_field = 2
            inconsistent_help = 3
            no_values_found   = 4
            others            = 5.

  read table return with key fieldname = 'P_BUKRS'.

* Add it back to the dynpro.
  dynfields-fieldname = return-retfield.
  dynfields-fieldvalue =  return-fieldval.
  append dynfields.

* Get the company code from db and add to dynpro
  data: xt001 type t001.

  clear xt001.
  select single * into xt001
         from t001
        where bukrs = return-fieldval.

  dynfields-fieldname = 'P_BUTXT'.
  dynfields-fieldvalue = xt001-butxt.
  append dynfields.

  dynfields-fieldname = 'P_ORT01'.
  dynfields-fieldvalue = xt001-ort01.
  append dynfields.

  dynfields-fieldname = 'P_LAND1'.
  dynfields-fieldvalue = xt001-land1.
  append dynfields.

* Update the dynpro values.
  call function 'DYNP_VALUES_UPDATE'
       exporting
            dyname     = sy-cprog
            dynumb     = sy-dynnr
       tables
            dynpfields = dynfields
       exceptions
            others     = 8.

start-of-selection.

Regards,

Rich Heilman

Read only

0 Likes
1,296

Hi Kinshuk and Rich,

thank you for your replies. It solved my problem. But I'm still curious about class of input field, I can't locate it.

Regards,

Josef

Read only

0 Likes
1,296

I have never seen, or heard about a class to manipulate an input field.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,297

go to the definition of the screen in screen painter(se51) when you double click on the screen element, the screen painter attributes popup allows you to specify that the element can responf to double click.

Read only

0 Likes
1,296

Hi,

I'd like to elaborate on my answer.

1. Have a program with a screen.

2. Using the screen painter, insert an element on the screen and double click on the element. this will give you a pop-up where you can specify the element attributes.

3. In the bottom half of this pop-up, there are three kinds of attributs you can specify on various tabs. choose the tab "Display".

4. On the above tab, there's a checkbox called "Responds to Double Click". Select this checkbox. This will enable the screen field to respond to double click (in case you make the field "display only", then it will be a hotspot on the screen!! Isn't that a cool one? ).

5. Now, we are not done yet. For this screen, in the PBO you need to specify a GUI status. And in that GUI status, there should be a Function Code called "PICK". (FYI, PICK is the function code that gets triggerred when you double click a list line).

6. And Lo! when you call the screen, you can see that the field responds to double click. Of course, in your PAI event, you need to write some code for the Function Code PICK.

Regards,

Kinshuk Saxena.

Further Hints: In case you have several fields on your screen which you want to respond to double click, you can find out which field was clicked on by using the statement GET CURSOR FIELD.