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

receiving error from function CALL 'DATE_CONV_EXT_TO_INT'.

Former Member
0 Likes
2,883

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.

9 REPLIES 9
Read only

vinoth_aruldass
Contributor
0 Likes
1,856

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.

Read only

0 Likes
1,856

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.?

Read only

0 Likes
1,856

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

Read only

0 Likes
1,856

Hi Vinoth and Kumar,

May I know any other function modules I can try using for the date conversion ?

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
1,856

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.

Read only

Former Member
0 Likes
1,856

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 ?

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
1,856

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.

Read only

Former Member
0 Likes
1,856

Hi,

Give input date as 01022013, i guess you are giving as 20130102

Thanks,

Govind

Read only

0 Likes
1,856

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