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

Checking for values in a check table with an interval

Hi experts,

I have a Z table with a check table(T706B1) for the field SPKZL, it also has a BEGDA(Begin date) and ENDDA(end date). What I want to do is when inserting new data the table would verify if the fields BEGDA and ENDDA in my Z table are in the corresponding intervals of the field SPKZL in the check table(T706B1- also named BEGDA and ENDDA), if they aren't in the interval it should not allow the new entry to be inserted.

Is there any way to do this?

Thank You

David Pereira

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jun 16, 2008 at 03:10 PM

    Try this:

    select single *
       from T706B1
       where MOREI = ztable-MOREI
           and SPKZL = ztable-SPKZL.
    if sy-subrc = 0.
    if T706B1-BEGDA <> ZTABLE-BEGDA or 
       T706B1-ENDDA <> ZTABLE-ENDDA.
    message e001(zz) with 'Invalid entry'.
    endif.
    endif.

    Regards,

    Ravi

    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.