Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid validation error

lferreira
Explorer
0 Kudos

Hi,

How can I avoid the message bellow:

The problem is:

The check shoud consider the date.

If I could just remove this check, it will help.

The code is:

DATA: WA_PERDATA  LIKE SY-DATUM,

              WA_PERHORA  LIKE SY-UZEIT.

       SELECTION-SCREEN BEGIN OF BLOCK B1_SEL WITH FRAME TITLE text-001.

            SELECT-OPTIONS:

               SPERDATA   FOR WA_PERDATA OBLIGATORY,

               SPERHORA   FOR WA_PERHORA OBLIGATORY.

        SELECTION-SCREEN END OF BLOCK B1_SEL.



Thank you!


5 REPLIES 5

FabioPagoti
Active Contributor
0 Kudos

This is a standard check for the select-options. It is telling you that the variable LOW is higher than the variable HIGH.

Could you please clarify why you need to remove this check? If you invert the dates it will stop bothering you.

0 Kudos

Hi thanks for helpping!

Answering the question:

It is because I do not have a field like DateTime. The user will input something like that:

Date: 01.04.2014 to 02.04.2014

Time: 23:59:59 to 08:00:00          ---> Here is the problem, the initial hour is greater then the final

I will have to use all of it in a SELECT like:

SELECT * FROM table WHERE iniDate >= '01.04.2014' and finalDate <= '02.04.2014' and iniHour >= '23:59:59' and finalHour <= '08:00:00'.

Actually I have already fixed using independent fields in order to avoid the standard check.

But, do you know a better solution?

Is is possible to have in ABAP a field DateTime (Date and time in the same field)... Something in the format: "DD/MM/AAAA HH:MM:SS.SSS" like some databases do like MySQL?

Thanks in advance!

0 Kudos

Hi Lindomar,

I was going to suggest exactly the same solution you have made.

There's no problem to do this way. I believe that even in standard tables/transactions you'll find an independent treatment for hour fields.

Rewardful points if useful.

João

0 Kudos

Hi Lino,

You just have to revert your time as we can see it is enteterd in the wrong column.

Regarding your second query as your looking to optimize your select where condition using 2 values(high and low date time stamp) instead of 4 fields separately i can suggest you one thing.

Concatenate low-date low-time  to a variable and do similarly for high.Finally use those variable in select.


But frankly i will go for 4 fields as it is one of the standard provided by SAP.Please let me know your findings.


Regards,

Kannan

Former Member
0 Kudos

hi,

U can resolve this issue by taking 2 different parameter for time.

i mean p_from _time  and p_to_time.

So , system wil not validate from time and to time.

and U can use the comment syntax for getting same layout with different variable. From_time and To_time.

Regards,

Satyen