Application Development 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: 

How to enable a field in selection screen based on the value, selected from a drop down list?

former_member308418
Participant
0 Kudos

Dear All,

In my selection screen, by default a field is made disable. I want to make this field enable if user chooses a specific condition from a drop down list. Please suggest how to do that.

Thanks.

With regards.

9 REPLIES 9

raymond_giuseppi
Active Contributor
0 Kudos

Just manage it in the PBO (AT SELECTION-SCREEN OUTPUT) trigger this event by assigning some dummy function code to the drop-down list.

Regards,

Raymond

0 Kudos

Dear Raymond,

Thanks a lot. I am using this event to make my fields enable or disable. This event not captures the selected condition.

For example,

AT SELECTION-SCREEN OUTPUT.

   LOOP AT SCREEN.

     IF p1 = 'X'.

       IF r1 = 'X'.

         IF screen-group1 = 'M1'.

           screen-input = 0.

         ENDIF.

         IF screen-group1 = 'M2'."

           screen-input = 0.

         ENDIF.

...............................

............................

ENDLOOP.


I want this group M2 to be enabled after user selects a specific condition from the drop down list.

0 Kudos

Hello,

It is not working because you are not using MODIFY SCREEN before ENDLOOP.

Bests.

0 Kudos

I have not posted the whole code here. Actually Modify Screen is there in my coding. I use breakpoint here and saw this event not captures the selected condition value.

0 Kudos

Dd you miss my


trigger this event by assigning some dummy function code to the drop-down list.

Try a code like


PARAMETERS: p_field1 TYPE text20 AS LISTBOX VISIBLE LENGTH 50 USER-COMMAND dummy, " trigger PAI/PBO cycle

            p_field2 TYPE text20 MODIF ID m2.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.

    CASE screen-group1.

      WHEN 'M2'.

        IF p_field1 EQ 'SOMEVALUE'. " internal format!

          screen-input = '1'.

        ELSE.

          screen-input = '0'.

        ENDIF.

    ENDCASE.

    MODIFY SCREEN.

  ENDLOOP.

Regards,

Raymond

0 Kudos

Hello,

You can adjust below code according to your requirement.

Regards.

SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-000.

SELECT-OPTIONS : s_default FOR vbak-erdat  MODIF ID S2.

PARAMETERS : p_dropdwn type spmon MODIF ID S1.

SELECTION-SCREEN END OF BLOCK a1.

AT SELECTION-SCREEN OUTPUT.

 

    LOOP AT SCREEN.

      IF p_dropdwn = 'X' AND screen-group1 = 'S2'.
        screen-active = '0'.
      ENDIF.

      MODIFY SCREEN.
    ENDLOOP.

0 Kudos

Dear Ekrem,

Thanks a lot. AT SELECTION-SCREEN OUTPUT not catches the value of selection screen fields. Though I tried with this logic and failed.

Regards.

Clemenss
Active Contributor
0 Kudos

Hi Mr. anonymous,

use PARAMETER addition USER-COMMAND fcode for the listbox parameter. This triggers PAI and then PBO. In PBO you can use the LOOP AT SCREEN as suggested.

Regards

Clemens

P.S.: Although this is not facebook (albeit looking like) you may use your real name.

0 Kudos

Thanks all for your valuable replies.