Skip to Content
avatar image
Former Member

Triggering Events on List Box dropdown

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....

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Jan 22, 2007 at 01: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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 22, 2007 at 01: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 22, 2007 at 02: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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.

  • avatar image
    Former Member
    Feb 28, 2007 at 09: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 09, 2010 at 12:22 AM

    ok

    Add comment
    10|10000 characters needed characters exceeded