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

function module for convert date as sap internal format ?

former_member220941
Participant
0 Likes
4,870

Hi All,

Is there any standard function module to convert the date filed as SAP internal date?

My problem is while uploading data from excel sheet date filed can be any format

for exp: dd/mm/yyyy or mm/dd/yyyy or yyyy/dd/mm or dd-mm-yyyy,mm-dd-yyyy

             dd-mm-yyyy or dd.mm.yyyy or mm.dd.yyyy  etc...

In our case there is no particular format in excel it can be differ for each user. I know we have few FM's in standard.

But those are not working for my req. pls help me if you have any idea.

Thanks in advance.

Regards,

Venkat Mote.

3 REPLIES 3
Read only

Former Member
0 Likes
932

I'm not sure how that would be possible as there would be no way to determine if 01-12 is a month or a day.  Your only option is to have a policy that dates be formatted the same way (or at least use day before month or month before day).

Read only

satyabrata_sahoo3
Contributor
0 Likes
932

This could have achieved programmatic but when you have situations like 12122012, you can't  differentiate if which is day or month!

So I am afraid you must have to fix the date format in Excel. Else if you know date format in the excel you can use FORMAT_DATE_4_OUTPUT in program by passing the FORMAT to the FM...

Read only

rajkumarnarasimman
Active Contributor
0 Likes
932

Hi Venkatesh,

Can you please check with the following function module. For my case, it is working fine.


CALL FUNCTION 'CONVERT_DATE_TO_INTERN_FORMAT'

  EXPORTING

    datum = p_gs_date

    dtype = 'DATS'

  IMPORTING

    idate = p_gs_date

Hope it helps to you.

Regards

Rajkumar Narasimman