‎2009 Jan 07 4:57 AM
Hi
In a flat file a date and time fill in but user. And the data and time format should always be fill in with the format <DDMMYYYY> <HHMMSS>
is there a FM which check whether user has put the wrong date format such as <YYYYMMDD> or <MMDDYYYY> instead for the the one mention above.
Please advise whether there is a FM which check on the format on the time stamp also.
Note: the input of the data and time is done by the user.
Thank
‎2009 Jan 07 5:04 AM
Hi,
Please refer this thread. A similar issue is solved there.
https://forums.sdn.sap.com/click.jspa?searchID=20622434&messageID=6703772
Regards,
Anversha
‎2009 Jan 07 5:37 AM
‎2009 Jan 07 5:08 AM
Hi,
Use this FM, If user enter the wrong format , this FM convert it into correct internal format
CONVERT_DATE_TO_INTERNAL
‎2009 Jan 07 5:18 AM
hi
you can use this fm DATE_CHECK_PLAUSIBILITY and CONVERT_DATE_INPUT
hope this helps
regards
Aakash Banga
‎2009 Jan 07 5:21 AM
Hi,
use the new OOPs concept,
PARAMETERS dateTYPE c LENGTH 10.
DATA matcher TYPE REF TO cl_abap_matcher.
* For date
matcher = cl_abap_matcher=>create( pattern = `[0-9]{1,2}/[0-9]{1,2}/[0-9]{2,4}`
ignore_case = 'X'
text = date ).
IF matcher->match( ) IS INITIAL.
MESSAGE 'Wrong Format' TYPE 'I'.
ELSE.
MESSAGE 'Format OK' TYPE 'I'.
ENDIF.
like dis pattern for time :
[0-9]{1,2}:[0-9]{2}
pattern for timestamp:
[0-9]{1,2}/[0-9]{1,2}/[0-9]{2,4} [0-9]{1,2}:[0-9]{2}
Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 4:35 PM
‎2009 Jan 07 5:38 AM
hi i am not familiar with the OO concept could you just please explain to met a little bit
‎2009 Jan 07 5:51 AM
Hi,
For knowing more about OO- ABAP u cam search for detailed documentation and it wll take time to grasp...
for ur requirement normally RegEx ;ie regular expressions are used...which is now replaced with calss based search and find patterns...
for inf abt that see the Regular Expressions topic in the below ppt....