‎2006 Sep 03 10:29 PM
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
‎2006 Sep 03 10:36 PM
‎2006 Sep 03 10:36 PM
‎2006 Sep 03 10:37 PM
could you please tell me how can we do that with list box.
Thanks for ur reply
‎2006 Sep 03 10:49 PM
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
‎2006 Sep 03 10:55 PM
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
‎2006 Sep 03 11:02 PM
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
‎2006 Sep 03 11:29 PM