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
1,090

Hi,

i have a condition that that Dates will be converted into the format of YYYYMMDD, If user can give any format we can change it as YYYYMMDD.

i have function module CONVERT_DATE_TO_INTERN_FORMAT'.but it is converting the MMDDYYYY---YYYYMMDD.

But if the user give DDMMYYYY.How can we fullfill both condition..?

i.e MMDDYYYY & DDMMYYYY----YYYYMMDD.how can we proceed for this conditipn.

tHANKS

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
907

Hi ,

For example .

<b>parameters : p_date like sy-datum.</b>

<b>Now you can give the date only in one format

this will be as per ur default settings in tcode SU3.

so either MMDDYYYY or DDMMYYYY jsut one of them is possible which is in equivalent with su3 settings .</b>

<b>The user cannot enter two formats at a single shot .</b>

An error is triggered at the selection screen itself .

In case if he is trying to do the same then you need to convert it to Su3 defalut format and then to internal format as YYYYMMDD

regards,

vijay.

7 REPLIES 7
Read only

Former Member
0 Likes
907

Hello.

Refere the date field to <b>sy-datum</b>

Regards,

Vasanth

Read only

Former Member
0 Likes
907

Hi SKK ,

This is a bit tricky if the user gived data in both the format MMDDYYYY and DDMMYYYY , because if we get a date like 11122006 , how do we determine in which format has he given because in both the cases they are valid.

If it is only one format then we can surely find a solution to it.

Regards

Arun

Read only

Former Member
0 Likes
907

Hi SKK,

use this FM

<b>CONVERSION_EXIT_IDATE_INPUT</b>

<b>If user has option to give any of format ie,

mmddyyyy or ddmmyyyy and convert to yyyymmdd

it will be difficult for us to do.

suppose if user want to give march 05 2007

he has option to give 03052007 or 05032007.

by coding also we cannot know whether first two digits represents day or month</b>

Read only

Former Member
0 Likes
907

use formatting options... this is suggession

WRITE sy-datum DDMMYY

... DD/MM/YY | MM/DD/YY

| DD/MM/YYYY | MM/DD/YYYY

| DDMMYY | MMDDYY | YYMMDD

Read only

Former Member
0 Likes
908

Hi ,

For example .

<b>parameters : p_date like sy-datum.</b>

<b>Now you can give the date only in one format

this will be as per ur default settings in tcode SU3.

so either MMDDYYYY or DDMMYYYY jsut one of them is possible which is in equivalent with su3 settings .</b>

<b>The user cannot enter two formats at a single shot .</b>

An error is triggered at the selection screen itself .

In case if he is trying to do the same then you need to convert it to Su3 defalut format and then to internal format as YYYYMMDD

regards,

vijay.

Read only

0 Likes
907

hI Vijay,

if one user fill the excel sheet with MMDDYYYY,another user give as YYYYMMDD,3rd user going to give as DDMMYYYY.then excel sheet will be convert all the date formats as <b>YYYYMMDD</b>.

How it possible.

Thanks.

Read only

0 Likes
907

hi sk,

You mean to say from sap r/3 if i download the same or is it the reverse you are saying . i didnt get you ?

is the upload or download i was not clear on the same .

//--then excel sheet will be convert all the date formats as YYYYMMDD.

No this is not possible in excel even only one format at a time is entertained for date format.

User cannot enter MMDDYYYY OR DDMMYYYY OR YYYYMMDD ALL AT A SINGLE INSTANCE.

regards,

vijay

at the time of download