Skip to Content
-3

Automatically filled out the parameter based on Select Option

Hi,

I want my parameter to copy the value in the select option low. for example, I have a hidden parameter that will appear and replaced the select option if a certain radio button is ticked. If I input a single value in the select option before ticking the radio button, I want my parameter to have the same value as in the select option without re-entering it.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on May 20, 2020 at 12:13 PM

    Hi Gerard A

    Below is the code for your requirement:

    DATA:
      gv_per TYPE i.
    
    PARAMETERS: p_per TYPE i DEFAULT 5.
    SELECT-OPTIONS: s_per FOR gv_per.
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_chk TYPE flag USER-COMMAND chk.
    
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-name CS 'P_PER'.
          screen-active = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    
    AT SELECTION-SCREEN.
      CASE sy-ucomm.
        WHEN 'CHK'.
          CHECK p_chk = abap_true.
          IF s_per[] IS INITIAL.
            s_per-low = p_per.
            APPEND s_per.
          ELSE.
            p_per = s_per[ 1 ]-low.
          ENDIF.
        WHEN OTHERS.
          " do nothing.
      ENDCASE.

    Your parameter's value will be update only if the user selects the checkbox.

    Regards,

    Mateusz

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.