2014 Jul 30 12:27 PM
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.
2014 Jul 30 12:33 PM
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).
2014 Jul 30 12:38 PM
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...
2014 Jul 30 12:44 PM
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