‎2020 Mar 09 8:28 PM
I know this sounds weired, but is there a command that executes keyboard-keypresses?
Like i got some code (Dynpro pai) and after its execution i need to press enter to continue. If i could execute the enter-command automatically the usability would increase. (Since i dont have full access to the System i cant change that the entercommand is needed.)
Is there a way to do this?
Best regards
‎2020 Mar 09 8:40 PM
Hi,
I'm afraid an automatic enter is not possible from within ABAP. It wouldn't make any sense as well. Because the system would never know when the user is done with entering his value.
For example if your input field would be an order number, valid order numbers are 1,11,111,1111. There's no way you can ever determine when the system needs to trigger the enter command.
There is however one exception, in case this is a transaction for an RF scanner. The scanner can be programmed to scan a barcode, enter the value in the field and trigger an enter command. But all of that is programmed in the scanners itself.
Best regards,
Geert-Jan Klaps
‎2020 Mar 10 2:17 PM
... because the scanner driver is a keyboard driver and simulates real keystrokes. You can't do this within ABAP.
‎2020 Mar 10 9:01 PM
I agree - in dynpro, to trigger pai you have to press either <enter> or <function key>. The requirement doesn't make sense or we don't understand it.
‎2020 Mar 10 12:35 AM
Yes. It's been discussed a "lot" in the forum. There are several solutions. Search things like refresh screen automatically, or CL_GUI_TIMER, SET USER-COMMAND, CL_GUI_CFW=>SET_NEW_OK_CODE.
‎2020 Mar 10 2:23 PM
Please put the following code - to force enter key as you asked. (in the user-command section)
I am using this for the same situation you asked for
Example :
WHEN 'XXXX'.
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
EXPORTING
functioncode = '='.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.This will force the enter key internally
Regards,
Venkat
‎2020 Mar 11 1:35 AM
It has to be combined with CL_GUI_TIMER or aRFC so that to execute it automatically at regular intervals to refresh the screen every X second(s).
Note that SAPGUI_SET_FUNCTIONCODE is equivalent to the officially-released method CL_GUI_CFW=>SET_NEW_OK_CODE.