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

Trigger Events

Former Member
0 Likes
765

Hi All,

I need some help on module pool program. I need to recalculate and change the existing values of screen field( in a module pool ) when user enters data in one of the screen fields.( he is not supposed to press enter or a push button) it just needs to be done as soon as data is entered in a screen field .

please let me know how this can be done.!!!

thank you

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
725

THis sort of thing is not supported. The frontend(sapgui) does not trigger any event to the backend when enter data in a input field, this can be done using a listbox, but not a regular input field.

Regards,

Rich Heilman

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
726

THis sort of thing is not supported. The frontend(sapgui) does not trigger any event to the backend when enter data in a input field, this can be done using a listbox, but not a regular input field.

Regards,

Rich Heilman

Read only

0 Likes
725

could you please tell me how can we do that with list box.

Thanks for ur reply

Read only

0 Likes
725

All you need to do is assign an FCODE to the input field in screen painter, then when you select a value, the PAI is triggered. Double click on the field in the screen painter, in the dialog, there is a field for FCODE, enter a value here.

Of course you need to specify that the input field is a listbox too, in that same dialog after double clicking on the input field, select Listbox from the "Dropdown" field.

REgards,

RIch Heilman

Read only

0 Likes
725

thanks for ur time. ALso i need to fill values for drop down dynamically . I mean its value range depends on one of the above fields in the screen if i make it a drop down.

please suggest how can i fill values for drop down.

thanks for ur help

Read only

0 Likes
725

Sure. All you need to do is build this in the PBO of the screen. Here is some sample code. Here P_BNAME is the field on the screen. We want to build a listbox with all of the user names in the system.



report  zrich_0001.

<b>type-pools: vrm.</b>

data: p_BNAME type usr01-bname.

call screen 100.

*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module STATUS_0100 output.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.


<b>data: name type vrm_id,
        list type vrm_values,
        value like line of list.

  data: iusr01 type usr01 occurs 0 with header line.

  clear list. refresh list.
  name = 'P_BNAME'.

  select * into corresponding fields of table iusr01
             from usr01.

  sort iusr01 ascending by bname.

  loop at iusr01.
    clear value.
    value-key = iusr01-bname.
    value-text = iusr01-bname.
    append value to list.
  endloop.

* Set the values
  call function 'VRM_SET_VALUES'
       exporting
            id     = name
            values = list.</b>


endmodule.                 " STATUS_0100  OUTPUT

*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module USER_COMMAND_0100 input.

check sy-subrc = 0.



endmodule.                 " USER_COMMAND_0100  INPUT


REgards,

Rich Heilman

Read only

0 Likes
725

Thanks got the response I got it.