Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Date in incorrect format

Former Member
0 Likes
2,484

Hi,

I have one program which creates variant.The variant date created by the program is wrong 1//20/05/2.

What would be the issue?

As per my knowledge, we get this error because we pass date to an internal table in MM/DD/YYYY format instead of YYYYMMDD. Usually programs take YYYYMMDD format and displays the output in MM/DD/YYYY. But i am not finding any such case here in the program to solve the issue.

7 REPLIES 7
Read only

Former Member
0 Likes
1,732

Hi,

Check the date format in the internal table while creating the variant. The format would be MM/DD/YYYY and you are passing this value to another date field in which only first eight char will be moved.

So convert the MM/DD/YYYY to YYYYMMDD and move this to value in the variant.

Read only

Former Member
0 Likes
1,732

*convert date yyyymmdd to mm/dd/yyyy

    concatenate itab-process_date+4(2)
                itab-process_date+6(2)
                itab-process_date(4)
           into it_fin-doc_dt separated by '/'.

hope this will help u

regards,

PP

Read only

Former Member
0 Likes
1,732

Hi,

Please check the type for the date fields. It should be DATUM.

This will help.

Regards,

Prashant

Read only

0 Likes
1,732

SYST_DATUM or SY_DATUM also no issue. am i correct?

Read only

SujeetMishra
Active Contributor
0 Likes
1,732

Hello Raju,

Please once have a look at FM below :

CONVERT_DATE_TO_EXTERNAL

CONVERT_DATE_TO_INTERNAL.

User This to convert your date format according to your need.

may this will solve your problem.

Regards,

Sujeet

Read only

Former Member
0 Likes
1,732

Hi,

use FM RSEC_DATE_CONVERT to convert date into internal format.

Regards,

Raju.

Read only

Former Member
0 Likes
1,732

Hi,

concatenate jtab-process_date+4(2)

jtab-process_date+6(2)

jtab-process_date(4)

into it_fin-doc_dt separated by '/'.

write 😕 it_fin_dt.

regards,

munibabu.K