2013 Jan 03 9:43 AM
Hi,
I am getting error as 'Wrong Date' when function module 'CONVERT_DATE_TO_INTERNAL' is used. In this function module when it is accessing the function
CALL 'DATE_CONV_EXT_TO_INT'
ID 'DATINT' FIELD H_DATE_INTERNAL
ID 'DATEXT' FIELD H_DATE_EXTERNAL.
I am getting sy-subrc as 3. The date which is passed to H_DATE_EXTERNAL is 02012013. But when I pass the date 02012012 then there is no error. I guess it is showing error for the date of 2013, can you please suggest what I need to do in this scenario ?
Many thanks.
2013 Jan 03 9:50 AM
hi
use simple calculations like
date1 = 01022013.
concatenate date+4(4) date+2(2) date+0(2) into date2.
this will give you 20120201.
regards and hope this helps,
Vinoth.
2013 Jan 03 10:06 AM
Hi Vinoth,
This calculation is already there in the code but still the function module is used. So you are saying that this function module is not necessary if we are using the calculation you'hv suggested.?
2013 Jan 03 10:11 AM
no i didnt say that exactly . its better always using standard function modules that are provided by SAP. But since you are getting error that can be solvable by simple logic this code will work that i provided . Kindly debug your code to get the error.
hope it wil be helpful.
Vinoth
2013 Jan 03 10:26 AM
Hi Vinoth and Kumar,
May I know any other function modules I can try using for the date conversion ?
2013 Jan 03 10:06 AM
It is better to use standard utility function modules instead of writing your own logic (unless you have a very specific requirement). I just checked in my system by passing 01022013 to CONVERT_DATE_TO_INTERNAL and it worked fine. Maybe there is a bug in your code.
2013 Jan 03 10:44 AM
Hi Kumar,
The logic Vinoth has given is already used in the code before calling the function module. I guess this logic should not be there if we are calling the function module. Either to use this logic or function module, correct ?
2013 Jan 03 11:17 AM
Well yes. I don't see any reason in having two pieces of code doing the same thing. But, I would still recommend the use of the standard function module.
2013 Jan 03 11:13 AM
Hi,
Give input date as 01022013, i guess you are giving as 20130102
Thanks,
Govind
2013 Jan 03 1:05 PM
Hola
98978779 20120102 (20.12.0102) INCORRECTO
79879798 01022012 (01.02.2012) INCORRECTO
79879897 02012012 (02.01.2012) CORRECTO
79869896 03012013 (03.01.2013) CORRECTO
LA FORMA CORRECTA ES DDMMYYYY
CHECK THIS
CONVERSION_EXIT_INVDT_INPUT
CONVERSION_EXIT_INVDT_OUTPUT
Módulo funciones CONVERSION_EXIT_INVDT_INPUT
Parámetros p.import Valor
INPUT 03012013
Parámetros export Valor
OUTPUT 79869896
Módulo funciones CONVERSION_EXIT_INVDT_OUTPUT
Parámetros p.import Valor
INPUT 79869896
Parámetros export Valor
OUTPUT 03.01.2013
Message was edited by: Javier Ruiz Stgo. Chile