2007 Jun 20 5:59 PM
In the selection screen using select options the user enters a date. This field has to be compared to a 10 character field.
However in the debugging mode I see the date entered is 'IBT2007051020070512' How do i compare this with the character format...
2007 Jun 20 6:04 PM
Supposed that your screen field is called S_DATE....You would need to do this...
IF MY_DATE BETWEEN S_DATE-LOW AND S_DATE-HIGH.
*Do something...
ELSE.
*Show error...
ENDIF.
MY_DATE must be in DATE internal format....20070620.
Greetings,
Blag.
In the selection screen using select options the user enters a date. This field has to be compared to a 10 character field.
However in the debugging mode I see the date entered is 'IBT2007051020070512' How do i compare this with the character format...
2007 Jun 20 6:04 PM
As u know IBT2007051020070512 means date ranges from 05/10/2007 to 05/12/2007
Now which date u want to handle is the ques. may be lower date or higher
s_date-lower gives the lower date
s_date-higher gives the higher date.
make a temp var with char(10) and assing the correct value to it.
nd do the comparision.
Thanks & regards
vinsee
2007 Jun 20 6:04 PM
Supposed that your screen field is called S_DATE....You would need to do this...
IF MY_DATE BETWEEN S_DATE-LOW AND S_DATE-HIGH.
*Do something...
ELSE.
*Show error...
ENDIF.
MY_DATE must be in DATE internal format....20070620.
Greetings,
Blag.
2007 Jun 20 6:05 PM
Hi Alexander,
I need some more informations but i think I can help you.
"However in the debugging mode I see the date entered is 'IBT2007051020070512' "
It happens because you are using a select-options, and so, the entered values are organized in the structure of the select-options ( SIGN, OPTION, LOW, HIGH).
Double-Click on the selection-options field at debug screen to see it's structure.
What kind of comparison do you need to do?
Do you need to see if the date in character format was typed onm the selection-screen?
I need more details to write you a sample code.
Regards.
2007 Jun 20 6:07 PM
Hi
In select-options you see the output format, in debbug you see the real form used to store the date, u should use this format, so u should translate the char format to input format.
SELECT-OPTIONS SO_DATE FOR SY-DATUM.
DATA: DATE(10) VALUE '20.06.2007',
DATE_IN TYPE SY-DATUM.
DATE_IN(4) = DATE+6(4).
DATE_IN+4(2) = DATE+3(2).
DATE_IN+6(2) = DATE(2).
IF DATE_IN IN SO_DATE.
* do something
ENDIF.Max
2007 Jun 20 6:08 PM
Hi
you can create a var type string
x type string.
x = s_data-low.
X receive the LOW option. now you can compare with a var type character format.
Regards
2007 Jun 20 6:13 PM
You have opened a lot of posts for the same question. Please use one thread to continue and close the rest.
2007 Jun 20 6:14 PM
I agree that but still my question is unanswered.
Can you please help me.
2007 Jun 20 6:23 PM
Even if your question is not answer...You can't duplicate posts...
And maybe you need to reformulate your question...because you have recieve a lot of answers....None of them helps you to fulfill your need???
Greetings,
Blag.
2007 Jun 20 6:30 PM
Hi
See my answer above, you need to transform the char in a date format.
Max