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
917

when we input date date format is yyyymmdd .

I want user to input it in the format ddmmyyyy

wht i shd write ?

7 REPLIES 7
Read only

Former Member
0 Likes
856

hi

change the default settings.....

u can change it thru su01

Read only

Former Member
0 Likes
856

Hi Amit,

Check this info.

The following ABAP code demonstrates a number of ways to format a SAP date value:

  • Using the WRITE statement

***************************

data: gd_date(10). "field to store output date

  • Converts SAP date from 20020901 to 01.09.2002

write sy-datum to gd_date dd/mm/yyyy.

  • Converts SAP date from 20020901 to 01.09.02

write sy-datum to gd_date dd/mm/yy.

Regards

Read only

0 Likes
856

I try

data: gd_date(10). "field to store output date

  • Converts SAP date from 20020901 to 01.09.2002

write sy-datum to gd_date dd/mm/yyyy.

  • Converts SAP date from 20020901 to 01.09.02

write sy-datum to gd_date dd/mm/yy.

But no write resullts, why?

Read only

0 Likes
856

REPORT ZDATE1.

data: gd_date(10). "field to store output date

  • Converts SAP date from 20020901 to 01.09.2002

write sy-datum to gd_date dd/mm/yyyy.

write / gd_date.

  • Converts SAP date from 20020901 to 01.09.02

write sy-datum to gd_date dd/mm/yy.

write / gd_date.

*Then output is:

11.10.2007

11.10.07

Read only

Former Member
0 Likes
856

Hello,

The input by the user depends upon the settings in the User profile :

SAP Screen --> Menu --> System --> User Profile --> Own Data --> Defaults -->

Date Format .

The user can use any of the format.

Ask the user to set the Date format as ddmmyyyy.

If not you can do a validation and if the user enters a date in the format other than u desired then u can show a message.

Hope it solves ur prob.

Regards,

Deepu.k

Read only

Former Member
0 Likes
856

Dear friend,

Mention the date field in selection as default on selection screen with the format u want or popup info message before entering the selection screen as what format user has to enter for date field.

Pls reward points.

Regards,

Ameet

Read only

rainer_hbenthal
Active Contributor
0 Likes
856

presentation depends on user settings. Cuase most od the users does not have access to su01 advide them to go to system->user profile->own data, their they can change their locale settings in the way they want to.

This is nothing you must code. Let the user do the selection and dont irritate them by doing your own stuff overrdiding their settings.