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 conversion

Former Member
0 Likes
437

Hi all,

i have a Date field in flat file as YYDDMM format.

i have to read it into internal table and according to that i have to fetch some data.

how can i convert the YY field into YYYY.

my system date format is YYYYMMDD.

2 REPLIES 2
Read only

Manohar2u
Active Contributor
0 Likes
390

Rupa

As its YY format its difficult to know whether it is 19XX or 20XX, so based on assumptions you need to concatenate with 19 or 20 to YY.

Regds

Manohar

Read only

Former Member
0 Likes
390

Hi Roopa,

follow this code ..

data: date like sy-datum.
data: date1 like sy-datum.
data: date2(10) type c.

date = 050102 (as your format).

move: date to date_8.
write date1 to date2.

write: date2.

here the date2 will have the 10 digit date format which will have your SAP System format .. whatever the format you have in the System this DATE2 will also have the same format ..

please close the thread if this answers the question

Thanks

Sudheer