2006 Apr 10 2:54 PM
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
2006 Apr 10 3:02 PM
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
2006 Apr 10 2:57 PM
2006 Apr 10 3:16 PM
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
2006 Apr 10 3:23 PM
2006 Apr 10 3:30 PM
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.
2006 Apr 10 3:33 PM
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
2006 Apr 11 10:13 AM
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
2006 Apr 11 1:50 PM
2006 Apr 10 3:02 PM
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.
2006 Apr 10 3:24 PM
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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |