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
818

Hi all,

i have a flat file with a date field(YYYYMMDD),

how can i convert this into user defined format.

Regards

Hema

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
764

Hi,

Take the date from your flat file into an internal table along with all other fields and then Make use of FM CONVERT_DATE_TO_EXTERNAL .

This should solve your problem.

Pls reward if useful.

Regards,

lalit

8 REPLIES 8
Read only

Former Member
0 Likes
764

e.g. The write statement will convert the internal format into the user defined date format.

Either do a write / date_field.

Or write date_field to other_field.

Hope that helps,

Michael

Read only

Former Member
0 Likes
764

Hi,

convert to Excel then u chage the formate whatever u want.

Read only

Former Member
0 Likes
765

Hi,

Take the date from your flat file into an internal table along with all other fields and then Make use of FM CONVERT_DATE_TO_EXTERNAL .

This should solve your problem.

Pls reward if useful.

Regards,

lalit

Read only

abdul_hakim
Active Contributor
0 Likes
764

hi

use WRITE source TO target.

Cheers,

Hakim

Read only

Former Member
0 Likes
764

Hello Hema,

The write statement will work for you.

write w_date1 to w_date2.

(where w_date2 is your required format.)

Regards

Indu.

Read only

former_member787646
Contributor
0 Likes
764

Hi

You can try the following ways and check.

1. Write:/ date1 DD/MM/YYYY.

2. Using Concatenate Statement you can achieve the desired format.

Hope this would help you.

Murthy

Read only

Former Member
0 Likes
764

Use

WRITE Date_variable TO Date_variable

USING EDIT MASK '__/__/____'.

"USING EDIT MASK ........... use the format desired.

Read only

Former Member
0 Likes
764

Hi Hema.

I would like to suggest a few,

You can try---> using Edit mask statement.

or

Concatenation date with offsets.

or

use: source to target conversion DD/MM/YYYY or vice versa.

or

Try using function modules------->

DATE_CONV_EXT_TO_INT - Conversion of dates to SAP internal format (Check sy-subrc)

PDOT_DATE_CONVERT Convert date (yyyymmdd >dd.mm.yyyy)

CONVERT_DATE_TO_INTERN_FORMAT Converts a date to internal format

CONVERT_DATE_TO_EXTERNAL Conversion: Internal to external date (like screen conversion)

CONVERT_DATE_TO_INTERNAL Conversion: External to internal date (like screen conversion)

Hope that's usefull.

Good Luck & Regards.

Harsh Dave

Edited by: Harsh Dave on Jul 16, 2008 10:34 AM