Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

conversion of date field format from char to dats

Hi All,

one issue with Date field.

in my internal table i have a date field with type char(10).

But when I upload the data to database through upload program, there I have a date field with type "DATS".

how do I convert and store it in "DATS " format in database.

please help...

Former Member
Former Member replied

HI ,

Try this use CONVERT_DATE_TO_INTERNAl

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

date_external = "ur date from file

  • ACCEPT_INITIAL_DATE =

IMPORTING

DATE_INTERNAL = "( date in dats format )

  • EXCEPTIONS

  • DATE_EXTERNAL_IS_INVALID = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question