Skip to Content
avatar image
Former Member

data validation

Hi Gurus,

I need to pass one of my date which is stored in v_date to the range of my dates stored in v_01 and v_02 and see if the v_date lies in between v_01 and v_02 using between syntax, can you help me out how to do it.

Thanks

Rajeev Gupta

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 22, 2007 at 02:39 PM

    DATA : v_fdate TYPE sy-datum,

    v_ldate TYPE sy-datum.

    IF sy-datum BETWEEN v_fdate AND v_ldate.

    write 'Is between'.

    ENDIF.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 02:36 PM

    Hi Rajeev,

    Try this way,

    Data: Begin of it_date occurs 100,

    date type sy-datum.

    End of it_date.

    if v_date ge v_01 and v_date le v_02.

    it_date-date = v_date

    append it_date.

    endif.

    Sort it_date.

    Hopes it will help you.

    Ali

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks for the reply Ali

      Can you tell me how to achieve this thing using Between syntax.

      Tahnks

      Rajeev Gupta

  • avatar image
    Former Member
    Aug 22, 2007 at 02:40 PM

    Hi,

    You can create a ranges table of the date and then use this:

    v_date in lr_date where lr_date is the ranges tabel for the date.

    Hope it works.

    Thanks,

    Sandeep.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 02:40 PM

    selection screen validation we can achieve using the at selection-screen event...

    U can check the conditionthere by writing query or as per ur wish

    REWARD IF USEFUL

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 02:41 PM

    LOOP AT ztab WHERE mahns = ztab-mahns

    ...

    AND date BETWEEN ztab-date1 and ztab-date2.

    ENDLOOP.

    IF sy-subrc = 0.

    MESSAGE e000(yp) WITH text-e02.

    regards,

    srinivas

    <b>*reward for useful answers*</b>

    Add comment
    10|10000 characters needed characters exceeded