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 Format.

Former Member
0 Likes
631

Hi Friends,

I need to change date format from YYYYMMDD to MM/DD/YY format in the internal table, because i need to send ths internal table to an external non SAP system.

Shejal.

1 ACCEPTED SOLUTION
Read only

suresh_datti
Active Contributor
0 Likes
579

write itab-date to itab-date mm/dd/yyyy.

or

concatenate itab-date4(2) '/' itab-date6(2) '/'

itab-date+2(2) into itab-date.

~Suresh

3 REPLIES 3
Read only

suresh_datti
Active Contributor
0 Likes
580

write itab-date to itab-date mm/dd/yyyy.

or

concatenate itab-date4(2) '/' itab-date6(2) '/'

itab-date+2(2) into itab-date.

~Suresh

Read only

Former Member
0 Likes
579

Hi Shejal,

There is a function module which takes the date as YYYYMMDD and output it as DD/MM/YYYY.

Please check this standard FM.

FM Name : PERIOD_AND_DATE_CONVERT_OUTPUT

Purpose : Conversion of a date with period

specification with output.

Usage :

Import : YYYYMMDD (Internal Date), Language, Country,

Internal Period;

Export : country specific date|period string

(External Date), External Period,

External Period Text.

Int.Period Ext.Period Ext.Date, e.g. Ext.Per.Text

1 D MM/DD/YYYY

2 W WW/YYYY Week

3 M MM/YYYY Month

4 P ? space

5 K ? space Calndr

Hope this will help u in some way.

Read only

Clemenss
Active Contributor
0 Likes
579

make it simple:

Use ABAP statement write with formatting option for date field, see also

http://help.sap.com/saphelp_47x200/helpdata/en/9f/70bed8fe1211d2b92f0000e8353423/frameset.htm

ABAP Programming (BC-ABA)->ABAP User Dialogs->Creating Lists->Creating Simple Lists with the WRITE Statement->Formatting Options

write sy-datum MM/DD/YYYY to <target>.

where target is your character-type output field.

Regards,

Clemens