01-22-2007 1:22 PM
Is there any possibility to trigger an event on selection of a particular item of a list-box?
The requirement is to Enable/Disable the fields of a Selection Screen depending on the values of the List-Box Dropdown.
Any pointers to this regard would be helpful.
Regards,
Vasant....
01-22-2007 1:29 PM
HI,
refer sample code:
SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-005.
PARAMETERS : p_field TYPE dd03l-fieldname AS LISTBOX
VISIBLE LENGTH 80 OBLIGATORY.
SELECTION-SCREEN END OF BLOCK c.
INITIALIZATION.
*-- Populate List Box
*-- TEMKSV - Legacy Value
wa_value-key = 'TEMKSV'.
wa_value-text = 'Legacy Key'.
APPEND wa_value TO i_value.
CLEAR: wa_value.
*-- Installation
wa_value-key = 'INSTLN'.
wa_value-text = 'Installation'.
APPEND wa_value TO i_value.
CLEAR: wa_value.
Setting the selection
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_FIELD'
values = i_value.
CASE p_field.
WHEN 'TEMKSV'.
*-- Delete Object
PERFORM delete_temksv.
WHEN 'INSTLN'.
*-- Delete Installation
PERFORM delete_installation.
endcase.
refer std prg if u need to do the same in Module pool program - RSDEMO_DROPDOWN_LISTBOX
Reward points if this Helps.
Manish
01-22-2007 1:35 PM
hi Vasanta Kumar,
please use the statement mentioned below to have an action triggered, while selecting a value from list box:
PARAMETERS p_carrid TYPE spfli-carrid
AS LISTBOX VISIBLE LENGTH 20
USER-COMMAND onli
DEFAULT 'LH'.
at selection-screen output.
if not lv_flag is initial.
loop at screen.
if screen-name = 'the one you want to enable/disable, in CAPS'.
screen-input = 0. " to disable or '1' to enable
modify screen.
endif.
endloop.
at selection-screen.
if sscrfields-ucomm = 'ONLI'." (or you can use SY_UCOMM).
lv_flag = 'X'.
else.
clear lv_flag.
endif.
Hope this helps,
Sajan Joseph.
01-22-2007 2:57 PM
I need the event to be triggered as and when when the option from the dropdown is selected in the report program(something like a radio-button).
The suggestions mentioned here doesnt trigger the event at that particular instant.
Your obsevations regarding this would be helpful.
01-25-2007 8:35 AM
Hi there. What you want is not possible as you need to trigger the PAI processing by pressing a button. There is no actual communication between your program and the SAP server becuase your program is in a "rolled out" state. The selection is only happening in your GUI but not yet reflected in your field.
02-27-2007 1:51 PM
all you have to do is assign a Function Code to the list box.... this way every time to make a selection in your list box...... PAI gets triggerd...... in pai u can check for the value of the list box and accordingly enable/disable the feilds.
02-28-2007 9:08 AM
Hey Vasant,
Assign function code for that text field.
and populate values through VRM_SET_VALUES.
then in PAI check for that function code and also the field value.
it means the VRM will set values to that field.
regards
Satish
11-09-2010 12:22 AM