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

Selection Screen

Hi ,

I have a requirment like this , at the moment i have a selection screen like

plant (parameter) , date (select-option) range , time (select-option) range.

when i enter plant , given date : 13.01.2007 to 15.01.2007 , time range : 6AM to 6PM , it gives me the out put as date 13th from 6am to 6pm , 14th from 6am to 6pm and 15 from 6am to 6pm as it should do according to the code...

My Requirment is if user give for the above following dates and with the same time range 6am to 6pm it should take the full 24 hrs period of each day till 14th 6pm.

Note : Can ' Time ' be taken as parameter ??

pls suggest on this ...

Thxs,

Vind.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2007 at 05:35 PM

    Hi,

    Yes..Time can be take as parameter as long as you were able to filter the data using the time..

    Meaning..The table in which you filtering should have the time also...

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Vind,

      One option is to not give time in the select statement.. And then loop through your output internal table .

      SELECT * FROM ZTABLE

      INTO TABLE ITAB1

      WHERE DATE IN S_DATE

      date is defined as select option

      Now if V_TIME is your time parameter

      LOOP AT ITAB1.

      IF ITAB1-DATE = S_DATE-LOW .

      • This will remove all entries before the time on first date.

      CHECK ITAB1-TIME >= V_TIME.

      ELSEIF ITAB1-DATE = S_DATE-HIGH.

      • This will remove all entries after the time on the second date range. .

      CHECK ITAB1-TIME <= V_TIME.

      ENDIF.

      APPEND ITAB1 TO ITAB2.

      ENDLOOP.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2007 at 06:19 PM

    Hi,

    Check this example..

    SELECTION-SCREEN BEGIN OF LINE.

    • From date

    SELECTION-SCREEN COMMENT 1(10) v_text.

    PARAMETERS: p_fdate TYPE sydatum OBLIGATORY.

    • To date

    SELECTION-SCREEN COMMENT 25(10) v_text1.

    PARAMETERS: p_tdate TYPE sydatum OBLIGATORY.

    SELECTION-SCREEN END OF LINE.

    SELECTION-SCREEN BEGIN OF LINE.

    • From date

    SELECTION-SCREEN COMMENT 1(10) v_text2.

    PARAMETERS: p_ftime TYPE syuzeit OBLIGATORY.

    • To date

    SELECTION-SCREEN COMMENT 25(10) v_text3.

    PARAMETERS: p_ttime TYPE syuzeit OBLIGATORY.

    SELECTION-SCREEN END OF LINE.

    INITIALIZATION.

    v_text = 'From Date'.

    v_text1 = 'To Date'.

    v_text2 = 'From Time'.

    v_text3 = 'To Time'.

    AT SELECTION-SCREEN.

    IF p_fdate > p_tdate.

    MESSAGE e208(00) WITH 'TO date cannot be greater'.

    ENDIF.

    IF p_ftime > p_ttime.

    MESSAGE e208(00) WITH 'TO Time cannot be greater'.

    ENDIF.

    START-OF-SELECTION.

    DATA: T_VBRK LIKE VBRK OCCURS 0 WITH HEADER LINE.

    SELECT * FROM VBRK

    INTO TABLE T_VBRK

    WHERE ERDAT > P_FDATE AND ERDAT < P_TDATE.

    LOOP AT T_VBRK.

    IF T_VBRK-ERDAT = P_TDATE AND T_VBRK-ERZET > P_TTIME.

    DELETE T_VBRK.

    ENDIF.

    IF T_VBRK-ERDAT = P_FDATE AND T_VBRK-ERZET < P_FTIME.

    DELETE T_VBRK.

    ENDIF.

    ENDLOOP.

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2007 at 06:20 PM

    hi are u fetching the entries from the database table whichas time field when the records are entered into the database... if thats so then u can do like this...

    first fetch the records into Internal table & then follow something like what Kris has explained

    just modifying some part of his code

    loop at itab where date = <select option lower date>.

    if time < '6AM'." u may have ur own format of time here

    delete itab.

    endif.

    endloop.

    loop at itab where date = <select option higher date>.

    if time > '6PM'.

    delete itab.

    endif.

    endloop.

    This will do ur required work, award points if found helpful

    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.