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

Selection-screen disabling

Hi all,

I have 10 selection screen fields, in that 3 date fields which r given with select-options.

Now If one date field is given, then rest of the rwo date fields should be disabled.

How to do that with clear example.

Thanks,

Rohith.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Posted on Jan 07, 2009 at 05:21 AM

    This will sove your problem.

    
    parameters: date1 type sy-datum.
    parameters: date2 type sy-datum.
    parameters: date3 type sy-datum.
    
    at selection-screen output.
    
    if date1 is not initial.
    
    loop at screen.
    if screen-name = 'DATE2' or screen-name = 'DATE3'.
    screen-input = 0.
    modify screen.
    endif.
    endloop.
    
    endif.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Suhas Saha

      Hi,

      With this, the fields will get disable only when the user press 'Enter'.

      If he goes with mouse click or Tab button then this will not work.

      So for event, after entering one of the fields in the three dates, it should get disable.

      <<removed_by_moderator>>

      Thank You,

      Rohith.

      Edited by: Vijay Babu Dudla on Jan 15, 2009 4:47 AM

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2009 at 05:22 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2009 at 05:23 AM

    Hi Rohit,

    Try to use the SCREEN internal table logic.

        LOOP AT SCREEN.
    
         if so_date is not initila.
        then enabling that button
          IF screen-group1 = c_date. "'date.
            screen-required = c_1.                              "'1'.
            screen-output   = c_1.                              "'1'.
            screen-input    = c_1.                              "'1'.
            MODIFY SCREEN.
          ENDIF.
        endif.
    
         if so_date is not initial.
        then enabling that button
          IF screen-group1  = c_date1.                            "'date1'.
            screen-required = c_1.                              "'1'.
            screen-output   = c_1.                              "'1'.
            screen-input    = c_1.                              "'1'.
            MODIFY SCREEN.
          ENDIF.
         ENDIF.
    
         if so_date is not initila.
        then enabling that button
          IF screen-group1  = c_date2.                            "'date2'.
            screen-required = c_1.                              "1'.
            screen-output   = c_1.                              "'1'.
            screen-input    = c_1.                              "'1'.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
    
        ENDLOOP.
    

    mention the group properties of that filed in your screen as the DATE ,DATE1 and DATE2 as per your requiremnt.

    Thanks!

    Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 4:29 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2009 at 05:27 AM

    Hi,

    if any one of the date field on the slection screen is filled with value then do it like that.

    at selection-screen.

    if date1 = 'X'.

    display the other 2 with no display option as given in the following format.

    [OBLIGATORY|NO-DISPLAY]

    [VISIBLE LENGTH vlen]

    [NO-EXTENSION]

    [NO INTERVALS]

    [MODIF ID modid] ... .

    hope it will help.

    Regards

    Rajesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2009 at 05:32 AM

    Hi,

      AT SELECTION-SCREEN OUTPUT .
    LOOP AT SCREEN.
      If screen-name = date2.
        if date1 IS NOT INITIAL.
          screen-invisible = 1.
           endif.
          endif.
         modify screen.
       If screen-name = date3.
        if date1 IS NOT INITIAL.
          screen-invisible = 1.
           endif.
          endif.
        modify screen.
    ENDLOOP.
    

    Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 4:29 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 07, 2009 at 05:39 AM

    Hi,

    SELECT-OPTIONS : s_date1 FOR sy-datum,
                     s_date2 FOR sy-datum,
                     s_date3 FOR sy-datum.
    
    AT SELECTION-SCREEN OUTPUT.
    
        IF s_date1 IS NOT INITIAL AND s_date2 IS  INITIAL AND s_date3 IS  INITIAL.
        LOOP AT SCREEN.
          IF screen-name = 'S_DATE2-LOW' OR screen-name = 'S_DATE2-HIGH'
           OR screen-name = 'S_DATE3-LOW' OR screen-name = 'S_DATE3-HIGH'.
            screen-input = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF s_date2 IS NOT INITIAL  AND s_date1 IS  INITIAL AND s_date3 IS  INITIAL.
        LOOP AT SCREEN.
          IF screen-name = 'S_DATE1-LOW' OR screen-name = 'S_DATE1-HIGH'
           OR screen-name = 'S_DATE3-LOW' OR screen-name = 'S_DATE3-HIGH'.
            screen-input = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF s_date3 IS NOT INITIAL AND s_date1 IS  INITIAL AND s_date2 IS  INITIAL.
        LOOP AT SCREEN.
          IF screen-name = 'S_DATE1-LOW' OR screen-name = 'S_DATE1-HIGH'
           OR screen-name = 'S_DATE2-LOW' OR screen-name = 'S_DATE2-HIGH'.
            screen-input = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    

    Thanks & REgards

    Edited by: Always Learner on Jan 7, 2009 7:07 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2009 at 05:54 AM

    Hi,

       LOOP AT SCREEN.
    *Put if condition* 
    
                  MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
    

    this will work out for you

    fareed

    Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 4:30 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2009 at 09:13 AM

    Problem solved

    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.