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

Press enter using code or func. module

Former Member
0 Likes
928

Hello All,

We have a situation. We are throwing an express message. it is just for information. We are throwing it cause it is generating in different LUW and we can not throw normal message from different LUW (my previous post).

The problem we are facing is that the message only appear after user does some action. We want to throw it immediately.

Is there any code or function module that performs an event (just enter event is also good).

We have already tried SAPGUI_SET_FUNCTIONCODE. It is not solving the problem.

My question is simple. Is there any way that we can press enter by using code or function module.

Thanking you in advance.

Regards

Apoorv Lohani

6 REPLIES 6
Read only

Former Member
0 Likes
876

Hi Apoorv,

If suppose the function code of your enter key is 'ENTER', use the following code

CALL METHOD cl_gui_cfw=>set_new_ok_code

      EXPORTING

        new_code = 'ENTER'.

Read only

0 Likes
876

Tried it. It is not working. Thanks for the input.

Regards

Apoorv Lohani

Read only

former_member219162
Contributor
0 Likes
876

Hello Apoorv,

Did you try using;

SET USER-COMMAND fcode

Read only

0 Likes
876

We have tried this but it is not working.

Thanks for the answer.

Regard

Apoorv Lohani

Read only

Former Member
0 Likes
876

DATA: ls_sotxtinfo          TYPE sotxtinfo,           "To show message

      ls_soos7              TYPE soos7,

      lt_soos7              TYPE STANDARD TABLE OF soos7.

CLEAR ls_sotxtinfo.

ls_sotxtinfo-msgid = 'ZTNC'.

ls_sotxtinfo-msgno = '002'.

CLEAR ls_soos7.

ls_soos7-recnam = sy-uname.

APPEND ls_soos7 TO lt_soos7.

" Func to throw message

CALL FUNCTION 'SO_EXPRESS_FLAG_SET'

EXPORTING

   client                   = sy-mandt

   text_info                = ls_sotxtinfo

   procdirect               = 'X'

   singlentry               = ' '

   inbox                    = ' '

   popup_title              = 'Account'

   call_at_once             = 'X'

*       IMPORTING

*         SENT_TO_ALL              =

  TABLES

    rec_tab                  = lt_soos7

EXCEPTIONS

   no_receiver_exist        = 1

   office_name_error        = 2

   OTHERS                   = 3

          .

IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

After this some thing should be there to stop and pop up the express message.

Read only

alejandro_mejias
Active Participant
0 Likes
876

Use TH_POPUP fm instead.