Skip to Content
author's profile photo Former Member
Former Member

Hide/Show parameter based on another parameter

Hi All,

Is there a way to hide the parameters initially on the screen and only showing them when another field is selected?

For example, when I click on "range" then I want to to display two fields....start date and end date.

Thanks,

~Mark

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 12:46 AM

    Hi Mark

    If the click you are referring to is on a check box or radio button, yes we can do it. But if selection are to be invoked when you click on label, i think it may not be possible.

    An example on a possible scenario is:

    parameters: p_rd1 radiobutton group rad1 default 'X' user-command but,
                p_rd2 radiobutton group rad1,
                p_text type char128 obligatory.
    
    at selection-screen output.
    
      loop at screen.
         if screen-name CP '*P_TEXT*'.
            if not p_rd1 is initial.
               screen-active = 1.
               screen-required = 1.
            else.
               screen-active = 0.
               screen-required = 0.
            endif.
            modify screen.
         endif.
      endloop.
    

    Regards

    Eswar

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      *SELECT-OPTIONS

      SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE frametxt.

      Parameter: cttyp type p0016-cttyp.

      SELECT-OPTIONS: s_date for p0016-aedtm NO-extension.

      SELECTION-SCREEN END OF BLOCK block1.

      SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE frame.

      parameters: Test as checkbox.

      parameters: m_run as checkbox.

      Parameters: st_date type p0016-begda MODIF ID MOD.

      Parameters: en_date type p0016-endda.

      SELECTION-SCREEN END OF BLOCK block2.

      *AT SELECTION-SCREEN OUTPUT.

      Loop at Screen.

      if m_run is initial.

      if Screen-name CP 'st_date'.

      Screen-active = 0.

      screen-required = 0.

      ELSE.

      screen-active = 1.

      Endif.

      modify screen.

      endif.

      Endloop.

  • Posted on Jan 30, 2008 at 12:41 AM

    Hi Mark

    In the selection screen

    you can use the code

    AT SELECTION-SCREEN OUTPUT.
    
    IF pa_equip <> 'X'.
    LOOP AT SCREEN.
    IF screen-group1 = 'I1'.
    screen-active = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    
    IF pa_logic <> 'X'.
    LOOP AT SCREEN.
    IF screen-group1 = 'I2'.
    screen-active = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    
    

    You will get many examples if you search the forum.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 03:02 AM

    MArk,

    EX:

    PARAMETERS: p_chb AS CHECKBOX USER-COMMAND chb,

    p_sdate LIKE sy-datum MODIF ID mod,

    p_edate LIKE sy-datum MODIF ID mod.

    AT SELECTION-SCREEN OUTPUT.

    IF p_chb NE 'X'.

    LOOP AT SCREEN.

    IF screen-group1 EQ 'MOD'.

    screen-active = 0.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ELSE.

    IF p_chb NE 'X'.

    LOOP AT SCREEN.

    IF screen-group1 EQ 'MOD'.

    screen-active = 1.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDIF.

    Don't forget to reward if useful...

    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.