2017 May 27 11:49 AM
Folks,
Any standard FM which identifies the Source field's date format and then converts it to the User specific Date format into the target field.
Source Field : Will have date but we are not sure in which format it will be.
1.Identify the date format in the Source field.( any SAP Standard FM for this ?)
2.Get the User Specific date format using SLS_MISC_GET_USER_DATE_FORMAT.
3.Convert the Source field date into User Specific date format using step2.
Steps 2 and 3, I was able to but looking for any Standard FM for step 1 or any standard FM which includes all the 3 steps.
Thanks,
K.Kiran.
2017 May 27 4:16 PM
The official API described in the ABAP documentation is class CL_ABAP_DATFM.
2017 May 27 4:16 PM
The official API described in the ABAP documentation is class CL_ABAP_DATFM.
2017 May 29 7:21 AM
No FM or method will always be able to distinguish DDMMYYYY vs MMDDYYYY for days lower or equal to 12. Nevertheless you could try CL_ABAP_DATFM=>CONV_DATE_EXT_TO_INT, but better ask provider of the file...
2017 May 29 12:07 PM
Thanks Sandra & Raymond.
I had checked CL_ABAP_DATFM but none of its methods will be able to get us the dateformat code with input as date ( possible values 1,2,3,4,5,6,7,8,9,A,B,C - refer to value range of XUDATFM ).
Not sure in which format the date will be in the source field but whatever the format it might be, I need to get the YYYYMMDD format in the target field.
Hence,I did like below.
1.Got the User specific date format code using CL_ABAP_DATFM=>GET_DATFM
2.Checking if XUDATFM is not 2.
3.If XUDATFM is not 2 then using CL_ABAP_DATFM=>CONV_DATE_EXT_TO_INT to convert the external date format into internal date format.
K.Kiran.