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

How to trigger "Enter" event programmatically?

Former Member
0 Likes
10,284

<Subject line changed>


Hi experts,

I have a simple question ...

There are two fields on screen. Some calculations are made while pressing enter on both field. I can press enter only on first field.

How to trigger pressing enter event on second field (from code) ?

thanks in advance.

Moderator Message - Please use informative subject line for your question.

Message was edited by: Suhas Saha

1 ACCEPTED SOLUTION
Read only

Former Member
4,210

try to use

CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'

by passing function code of enter '/00'

<Subject line changed>


Hi experts,

I have a simple question ...

There are two fields on screen. Some calculations are made while pressing enter on both field. I can press enter only on first field.

How to trigger pressing enter event on second field (from code) ?

thanks in advance.

Moderator Message - Please use informative subject line for your question.

Message was edited by: Suhas Saha

7 REPLIES 7
Read only

JonathanM
Contributor
0 Likes
4,210

Hi Daniel,

It depends where you are webdynpro, module pool or report.

But if you're in a Z report, you can set the "AT SELECTION-SCREEN ON myfield" event.

Best regards,

Jonathan

Read only

Former Member
0 Likes
4,210

I forgot about details.

This case concern VA02 transaction. When user change delivery date it trigger userexit_move_field_to_vbak. It influences on the data on sales order items. After that I want to save SO. But data related to items will not be saved, because user didn't press enter on items area .

When user press enter there will be triggered some specific PAI, modules .etc and after that data will be saved and this is OK. But like I said before I want to avoid  of pressing enter in items area - just save data...

thanks again.

Read only

Former Member
0 Likes
4,210

PARAMETER : p_par1 type ebeln,

            p_par2 type ebelp.


AT SELECTION-SCREEN on p_par1.

if p_par1 is INITIAL.
  MESSAGE i208(00) WITH 'Enter value for par1. '.
endif.

AT SELECTION-SCREEN on p_par2.

if p_par2 is INITIAL.
  MESSAGE i208(00) WITH 'Enter value for par2. '.
endif.

Read only

Former Member
4,211

try to use

CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'

by passing function code of enter '/00'

Read only

0 Likes
4,210

Yes, I am trying this FM , will see...

Read only

Former Member
0 Likes
4,210

Hi,

you can try below two methods,

1) *---------- after modification pressing enter
   call method gr_grid->register_edit_event
     exporting
       i_event_id = cl_gui_alv_grid=>mc_evt_enter
     exceptions
       error      = 1
       others     = 2.

2)  ** after modification, "moving to next cell
    call method gr_grid->register_edit_event
     exporting
       i_event_id = cl_gui_alv_grid=>mc_evt_modified
     exceptions
       error      = 1
       others     = 2.

regards

Read only

Former Member
0 Likes
4,210

Hi,

finally there was no need to program enter code.

But FM above seem to working fine.

thanks for help