2007 Jul 19 7:24 AM
Hi
i want to check the date format how can i?
2007/09/23 like this format or not
2007 Jul 19 7:27 AM
If it is a report you can put a break-point where ever that field is being poputaled and check in debugger.
Regards,
Himanshu
2007 Jul 19 7:28 AM
Hi
Check the date related fun modules
CONVERT_DATE_TO_INTERNAL
CONVERT_DATE_TO_EXTERNAL
CONVERT_FIELD_TOEXTERN_FORMAT
<b>Reward points for useful Answers</b>
Regards
Anji
2007 Jul 19 7:28 AM
HI,
you can try like this,
first validate the year
date+0(4) should be greater and 1000 and less than 9999
and date+4(1) = '/'.
and date+5(2) should be between 01 and 12
and date+7(1) = '/'.
and date 8(2) should be between 01 and 31.
if any one of these conditions are failed
then your date format is wrong.
reward points if helpful,
thanks & regards,
venkatesh
2007 Jul 19 7:29 AM
Hello Ramesh,
Using sub-strings you can check for the position of the '/' character
eg... if field+2(3) = '/'.
2007 Jul 19 7:30 AM
2007 Jul 19 7:32 AM
hi
DATA: e_date(10) type c VALUE <b>'02/02/2006',</b>" specify wrong date format here
i_date(10).
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = e_date
IMPORTING
date_internal = i_date
EXCEPTIONS
date_external_is_invalid = 1
OTHERS = 2.
case sy-subrc.
when 0.
WRITE : / 'CONVERT_DATE_TO_INTERNAL',
/ 'My Date:' , e_date ,
'Conv Date:', i_date,
'System Date:', sy-datum.
when 1.
<b>write: 'date_external_is_invalid'.</b>
when 2.
write:' some error occured'.
endcase.
regards
ravish
<b>plz dont forget to reward points if helpful</b>
2007 Jul 19 7:32 AM
HI Ramesh
try like thi s
data: begin of int_bseg occurs 0,
BELNR LIKE BSEG-BELNR,
ZUONR LIKE BSEG-ZUONR,
GJAHR LIKE BSEG-GJAHR,
end of int_bseg.
start-of-selection.
data: lv_date type sy-datum.
data: lv_date1 type sy-datum.
data: lv_formatdate(10) type c.
data: lv_formatdate1(10) type c.
data: var1(4) type c,
var2(2) type c,
var3(2) type c.
data: 2days_out type sy-datum.
lv_date = 2days_out.
var1 = lv_date+(4).
var2 = lv_date+4(2).
var3 = lv_date+6(2).
concatenate var3 var2 var1 into lv_formatdate separated by '/'.
select zuonr belnr bukrs GJAHR from bseg into
corresponding fields of table int_bseg
where bukrs = 'company code' and
ZUONR = lv_formatdate.
Reward all helpfull answers
Regards
Pavan
2007 Jul 19 7:34 AM
Function Module is -><b>DATE_CHECK_PLAUSIBILITY</b> for
Date plausibility check
reward points if it is usefull.
Girish
2007 Jul 19 7:35 AM
Hi,
Use CP (ContainPattern) as below :
<b>if Date CP '//*'.</b>
statement....................
endif.
reward points, if helpful,
sandeep kaushik