‎2008 Jul 11 8:04 AM
Hi,
I am using HR_INFOTYPE_OPERATION FM to create records in one of our custom infotypes. I am getting error like:'Date . . contains invalid characters'.checked the pgm and am sure that i'm passing value in yyyymmdd format only.
I tried it in dialog mode 1. The program stops and the date fields are filled like dd.mm.yyyy format, but still it gives error. If any of you have any idea on this issue, please help me out.
Thanks,
Rahul.
‎2008 Jul 11 8:07 AM
hi,
Plz check the data type of your Date fields. They Should be like SY-DATUM only.
And If you are not working on some Specific Use sy-datum in BEGDA and ENDDA to avoid confusions.
Regards
Sumit Agarwal
‎2008 Jul 11 8:10 AM
Hi Rahul,
In this Function Module you have validityend and validitybegin for this just pass the date in this format '20080711' i.e Make sure you give in the quotes. If it is still giving an error then pass the date to some variable and then give that variable to these two fields.
This will solve.
Regards,
Swapna.
‎2008 Jul 11 8:10 AM
hi rahul,
right now try experimenting with different date formats.. i will get back with the actual solution..
btw shudnt the format that appears on the infotype scrren look like 02/03/2008 to 12/31/9999??
‎2008 Jul 11 8:27 AM
Hi Mauli,
Thanks for your reply.
The date format that appears on the infotype screen is like 11.07.2008 only and the date format associated with the user is also in DD.MM.YYYY only.
If you try to create record thru PA30 giving the same date, able to create it.
Hope I will get a solution!
Thanks,
Rahul.
‎2008 Jul 11 8:35 AM
Declare the date type as P0001-BEGDA or ENDDA and check .
Which date it is giving the error is it
VALIDITYEND
VALIDITYBEGIN
or it is coming from the infotype date field check it once.
‎2008 Jul 11 8:43 AM
Hi vijay,
it shows error in the record which we are passing not the validitybegin and validityend.
Thanks,
Rahul.
‎2008 Jul 11 9:10 AM
that means you are passing the date in converted format(with // or ..).instead pass sy-datum directly and check without converting.
‎2008 Jul 11 8:56 AM
Check how UR passing data to the structure that U pass to
FM HR_INFOTYPE_OPERATION ..
Might be UR moving data to date fields ..
write : v_date to p0001-begda ...
‎2008 Jul 11 2:44 PM
Hi,
It was not the problem with HR_INFOTYPE_OPERATION. while hard coding the same values it is creating the record.Actually I'm uploading the records(excel file) to the internal table using the FM TEXT_CONVERT_XLS_TO_SAP. It seems like some hidden characters are coming with the value. This is causing the problem. Could anybody please help me on this issue.Or pls suggest me some other FM which I can use. I need to get the value to the internal table even in the case of a type mismatch.
Thanks,
Rahul.
‎2010 Dec 17 4:52 PM
Hi Rahul,
Were you able to fix this issue ? I am facing the same problem. I am using HR_INFOTYPE_OPERATION FM and it throws me an error " Date // contains invalid characters" . It gives the same error in both Dialog and Background mode. I checked in the debugger and don't see any special characters. Even if I delete the date passed from the program and enter the system date manually in Dialog mode, I get the same error.
Please let me know how you got around this.
Thanks,
Danny.
‎2010 Dec 18 7:32 AM
hi ,
Date format should be 01012010 while passing date .
Regards
Deepak.