‎2007 Feb 22 10:58 AM
I m using CONVERSION_EXIT_PDATE_INPUT function module to convert the date format from DD/MM/YYYY -> YYYYMMDD.
Its working fine if the date is up to todays date.
If i give any date greater than this month or year its throwing an error as Invalid date.
But i want to change the format for future days also.
is there any alternative way to solve this issue.
Thanks in advance.
‎2007 Feb 22 11:07 AM
try this...
data : v_date1(10) value '23/02/2007',
v_date(8).
concatenate v_date1+6(4) v_date1+3(2) v_date1+0(2) into v_date.OR
as suggested by Alavaro
data : v_date1 TYPE KCDE_INTERN_VALUE,
v_date2 TYPE KCDE_INTERN_VALUE.
CALL FUNCTION 'KCD_EXCEL_DATE_CONVERT'
EXPORTING
EXCEL_DATE = v_date1
DATE_FORMAT = 'TMJ'
IMPORTING
SAP_DATE = v_date2
EXCEPTIONS
OTHERS = 0.
Message was edited by:
Chandrasekhar Jagarlamudi
‎2007 Feb 22 11:00 AM
Hi,
It works fine for all the dates. Check the date format in your user settings.
By the way, it accepts only DD/MM/YYY
Regards,
Ravi
Message was edited by:
Ravi Kanth Talagana
‎2007 Feb 22 11:09 AM
when i gave input as 12/12/2008 or 12/12/2007 its throwing error invalid date.
if i gave 01/12/2007 its working fine.
May i know where i made mistake.
I checked the date format in user profile its MM/DD/YYYY
Thanks
Message was edited by:
Kalpanashri Rajendran
‎2007 Feb 22 11:12 AM
REPORT YCHATEST.
TYPE-POOLS : KCDE.
DATA : V_DATE1 TYPE KCDE_INTERN_VALUE,
V_DATE2 TYPE KCDE_INTERN_VALUE.
V_DATE1 = '23/02/2007'.
CALL FUNCTION 'KCD_EXCEL_DATE_CONVERT'
EXPORTING
EXCEL_DATE = V_DATE1
DATE_FORMAT = 'TMJ'
IMPORTING
SAP_DATE = V_DATE2
EXCEPTIONS
OTHERS = 0.
WRITE : V_DATE2.
‎2007 Feb 22 11:02 AM
Hi Kalpanashri,
try FM KCD_EXCEL_DATE_CONVERT
For example, "01/03/2007" yields "20070301"
I hope it helps. BR,
Alvaro
‎2007 Feb 22 11:18 AM
ya i checked with this FM also but the output is in YYYY/DD/MM format.
But i need output in YYYY/MM/DD format.
The input can be in any format.
Is this possible.
Thanks
‎2007 Feb 22 11:27 AM
Well, the second parameter is the input format: "T" for day, "M" for month and "J" for year. For example, suppose it's March 23rd, 2007:
call function 'KCD_EXCEL_DATE_CONVERT'
exporting
excel_date = '20/03/2007'
date_format = 'TMJ'
importing
sap_date = l_date.
This yields 20070320.
If you need the input form in, say, year-day-month, just set date_format = 'JTM'.
Does it solve your problem? If not, please answer back. BR,
Alvaro
‎2007 Feb 22 11:29 AM
‎2007 Feb 22 11:07 AM
try this...
data : v_date1(10) value '23/02/2007',
v_date(8).
concatenate v_date1+6(4) v_date1+3(2) v_date1+0(2) into v_date.OR
as suggested by Alavaro
data : v_date1 TYPE KCDE_INTERN_VALUE,
v_date2 TYPE KCDE_INTERN_VALUE.
CALL FUNCTION 'KCD_EXCEL_DATE_CONVERT'
EXPORTING
EXCEL_DATE = v_date1
DATE_FORMAT = 'TMJ'
IMPORTING
SAP_DATE = v_date2
EXCEPTIONS
OTHERS = 0.
Message was edited by:
Chandrasekhar Jagarlamudi
‎2007 Feb 22 11:09 AM
Try this out
DATA: ZTEMP(9).
CLEAR: ZTEMP, ZDD, ZMMM, ZYYYY.
CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'
EXPORTING
INPUT = IS_DLV_DELNOTE-HD_GEN-CREA_DATE
IMPORTING
OUTPUT = ZTEMP.
ZDD = ZTEMP+3(2).
ZMMM = ZTEMP+0(3).
ZYYYY = ZTEMP+5(4). http://www.sap-img.com/abap/abap-program-output-of-date-format.htm
If u give 01/12/2007 its taking as January 12th so no error.
Message was edited by:
Judith Jessie Selvi
‎2007 Feb 22 11:20 AM
Hi,
Use the FM:
<b>DATE_CONV_EXT_TO_INT</b> - user formatted date is converted to system date
Hope this helps.
Reward if helpful.
Regards,
Sipra