‎2006 Oct 28 7:22 AM
i m trying to upload date from excel to SAP.Excel sheet is having DD/MM/YYYY ,while SAP hav yyyymmdd.So while uplaoding date is not getting upload properly.
Please tell how to handle this FROMATs......
‎2006 Oct 28 7:26 AM
hi,
from excel ur reading that field of date.
then use the below FM.
data: datum_in(10) type c value '6/7/2006'.
data: datum(10) type c.
data: datum_out type sy-datum.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
DATE_EXTERNAL = datum_in
IMPORTING
DATE_INTERNAL = datum_out
EXCEPTIONS
DATE_EXTERNAL_IS_INVALID = 1
OTHERS = 2.
*datum0(2) = datum_out4(2).
*datum2(2) = datum_out6(2).
*datum4(4) = datum_out0(4).
write:/ datum_out. "output in desired format
rgds
anver
if hlpful pls mark points
Message was edited by: Anversha s
‎2006 Oct 28 7:26 AM
hi,
from excel ur reading that field of date.
then use the below FM.
data: datum_in(10) type c value '6/7/2006'.
data: datum(10) type c.
data: datum_out type sy-datum.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
DATE_EXTERNAL = datum_in
IMPORTING
DATE_INTERNAL = datum_out
EXCEPTIONS
DATE_EXTERNAL_IS_INVALID = 1
OTHERS = 2.
*datum0(2) = datum_out4(2).
*datum2(2) = datum_out6(2).
*datum4(4) = datum_out0(4).
write:/ datum_out. "output in desired format
rgds
anver
if hlpful pls mark points
Message was edited by: Anversha s
‎2006 Oct 28 7:32 AM
Hi, Dheeraj
if while the data is being uploaded into ur itab from excel
just check whether the format in ur itab is dd/mm/yyyy ..
that means in ur itab declaration
date(8) type c
or is there
date type d
is having value 28/10/2006
now to convert it into 20061028
use function module
CONVERT_DATE_TO_INTERNAL
IMPORTING
VALUE(DATE_EXTERNAL) = v_dat
EXPORTING
VALUE(DATE_INTERNAL) = v_dat
this will do ..
just cross check the value in debugging.
regards,
VIjay