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

invalid date error using HR_INFOTYPE_OPERATION

Former Member
0 Likes
2,293

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.

11 REPLIES 11
Read only

Former Member
0 Likes
1,632

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

Read only

Former Member
0 Likes
1,632

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.

Read only

Former Member
0 Likes
1,632

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

Read only

0 Likes
1,632

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.

Read only

0 Likes
1,632

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.

Read only

0 Likes
1,632

Hi vijay,

it shows error in the record which we are passing not the validitybegin and validityend.

Thanks,

Rahul.

Read only

0 Likes
1,632

that means you are passing the date in converted format(with // or ..).instead pass sy-datum directly and check without converting.

Read only

Former Member
0 Likes
1,632

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

Read only

Former Member
0 Likes
1,632

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.

Read only

Former Member
0 Likes
1,632

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.

Read only

0 Likes
1,632

hi ,

Date format should be 01012010 while passing date .

Regards

Deepak.