2006 Apr 05 10:39 AM
hi all,
i have a problem i have to read data from a <b>FLAT FILE </b> and save it into <b>ZTABLE</b>.
but one problem is there..DATE field in flat file has data in form of dd/mm/yyyy and domain taken in ztable is in format yyyy/dd/mm.
how to do this conversion.
regards.
2006 Apr 05 10:43 AM
Hi,
Try to use this FM <b>CONVERT_DATE_TO_INTERNAL</b> to convert it to internal format.
Regards
vijay
2006 Apr 05 10:45 AM
DATA date1(8) VALUE '31012006'.
DATA date2(8).
DATA date LIKE sy-datum.
date2+4(2) = date1+0(2).
date2+0(4) = date1+4(4).
date2+6(2) = date1+2(2).
WRITE date2 TO date.
Regards,
Wenceslaus.
2006 Apr 05 10:45 AM
use <b>SHIFT</b> command and store it into 3 variable and then finally update in to ztable
or use FM <b>CONVERT_DATE_TO_INTERNAL</b>
Regards,
Srinu
2006 Apr 05 10:45 AM
hi,
Try this function module
CONVERT_DATE_TO_INTERN_FORMAT
regards,
srinivasarao.oleti
2006 Apr 05 10:46 AM
Hi Shraddha,
reshuffle using concatenate statement.
data: v_date(10).
concatenate file_date+6(4) '/'
file_date+0(2) '/'
file_date+3(2)
into v_date.
ztable-date = v_date.
Regards,
Ravi
2006 Apr 05 10:50 AM
convert the date to character and using concatenate
manipulate as u want.
ex: d type date. (let it be of type dd/mm/yyyy),
data: d1(10).
concatenate d6(4) '/' d1(2) '/' d+3(2) into d1.
2006 Apr 05 11:31 AM
Hi Sharadha,
You can use the function module CONVERT_DATE_TO_INTERNAL
Consider a sample code implementation.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = v_date " dd/mm/yyyy
IMPORTING
date_internal = v_date "yyyyddmm
EXCEPTIONS
date_external_is_invalid = 1
OTHERS = 2.
Hope this solves your problem.
Regards,
Arun Sambargi.