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

Select-option

Hello,

I have a select-option for date and I need to add some functionality based on the selection date. Like if the date is below 07/07/2004 i need to add some functionality and if the date is above 07/07/2004 i need to add a different functionality. So when the user enters the date range how do i check on this date and write the functionality..

Thanks

Vicky

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Sep 27, 2006 at 05:15 PM

    hi vicky,

    try this.

    select-options: date for ztable-date_field.

    at selectionscreen output

    if date-low --chk ur condition.

    endif.

    if date-high -- chk ur condition.

    endif.

    in select options - first text box value is date-low

    similarly the other one is date-high.

    hope u got an idea.

    if hlped mark points

    rgds

    anver

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2006 at 05:16 PM

    Hi,

    if you want to do validation

    at selection-screen.

    if s_date-low < 07/07/2004

    message e000 with 'invalid date'.

    endif.

    start-of-selection

    if s_date-low < 07/07/2004

    perform fun1.

    else

    performs_fun

    endif.

    Regards

    amole

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2006 at 05:18 PM

    Hi Vicky,

    Your Question is not very much clear.

    What is ur requirement...

    Is it Select-Options Validation in selection screen

    or displaying output after input

    If its regarding validation then use the following logic.

    Select-options: sdate for sy-cdate.

    At-selection-screen on sdate-low.

    If sdate < sy-datum.

    message e044.

    Write ur own logic...

    endif.

    At-selection-screen on sdate-high.

    message e045.

    write ur own logic.

    endif.

    Or if you ant to display ouput then do code like below.

    start-of-selection.

    if sdate-low < sy-datum.

    write ur functionality.

    else.

    if sdate-high > sy-datum.

    write ur functionality.

    endif.

    endif.

    if helpful

    then reward me points.

    Regards

    Manas Ranjan Panda.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi,

      try this..

      data:begin of itab occurs 0,

      budat like mkpf-budat,

      end of itab.

      select-options: s_date for sy-datum.

      start-of-selection.

      select budat from mkpf into table itab where budat in s_date.

      loop at itab.

      if itab-budat < '20040707'.

      ur function

      elseif itab-budat = '20040707'.

      ur function

      else.

      ur function

      endif.

      endloop.

  • Posted on Sep 27, 2006 at 05:09 PM

    This could get a little tricky with a select-option because of all of the possibilties. But if you just want to check that the low value is before of after 07/07/2004, then you can simply do this.

    
    report zrich_0004.
     
    
    select-options: s_datum for sy-datum no-extension.
    
    
    start-of-selection.
    
    read table s_datum index 1.
    
    if s_Datum-low < '20040707'.
    
    else.
    
    
    endif.
    
    

    Regards,

    Rich Heilman

    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.