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

Insert record in infotype 0581 using function module

Former Member
0 Likes
1,449

Hello experts,

I am using function module HR_INFOTYPE_OPERATION to insert a record in infotype 0581, but its giving exception CX_HRPA_INVALID_INFOTYPE. This infotype is time constraint 1.So how can i handle this.

Reply will be really helpful <removed by moderator>.

Edited by: S Harshit on Feb 17, 2012 6:49 AM

Edited by: Thomas Zloch on Feb 17, 2012

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,175

Hi Harshit,

It is a very confusing issue.

Check this link out. It might give you some idea.

<removed by moderator>

Regards

Tarun

Moderator message: please don't post just link(s) without explaining the relevance.

Edited by: Thomas Zloch on Feb 17, 2012

9 REPLIES 9
Read only

Former Member
0 Likes
1,176

Hi Harshit,

It is a very confusing issue.

Check this link out. It might give you some idea.

<removed by moderator>

Regards

Tarun

Moderator message: please don't post just link(s) without explaining the relevance.

Edited by: Thomas Zloch on Feb 17, 2012

Read only

Former Member
0 Likes
1,175

Hi,

Refer below link for your problem

<removed by moderator>

Thanks,

venkat

Moderator message: please don't post just link(s) without explaining the relevance.

Edited by: Thomas Zloch on Feb 17, 2012

Read only

0 Likes
1,175

Hi venkat,

Your link has provided me that I am unable to pass the rent amount RTAMT, can you help me on this.

Read only

Former Member
0 Likes
1,175

Hi Harshit,

Yes.. Infotype 0581 is Time constraint 1, You can't maintain overlap or gaps records in this, check the input record and existing record dates.

The FM which you are using is correct to maintain IT0581, Check the dates properly, still you get same error, Please post the code, I can help you.

Regards,

Mallikarjuna

Read only

0 Likes
1,175

Hi Mallikarjuna,

I am trying to pass the rent amount, but unable to, here is the code.

TYPES: BEGIN OF IT_P0581.
INCLUDE STRUCTURE P0581.
TYPES END OF IT_P0581.
DATA: INFTYKEY LIKE BAPIPAKEY,
RETURN LIKE BAPIRETURN1.
DATA: P0581_TAB TYPE TABLE OF IT_P0581 WITH HEADER LINE.
P0581_TAB-PERNR = 01400038.
P0581_TAB-INFTY = '0581'.
P0581_TAB-BEGDA = '20111010'.
P0581_TAB-ENDDA = '99991231'.
P0581_TAB-RTAMT = 3000 .



append P0581_TAB.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = P0581_TAB-INFTY
NUMBER = P0581_TAB-PERNR
SUBTYPE = ''
VALIDITYEND = P0581_TAB-ENDDA
VALIDITYBEGIN = P0581_TAB-BEGDA
RECORD = P0581_TAB
OPERATION = 'INS'
NOCOMMIT = ''
RECORDNUMBER = '000'
DIALOG_MODE = '2'
IMPORTING
RETURN = RETURN
KEY = INFTYKEY
EXCEPTIONS
OTHERS = 0.

Read only

0 Likes
1,175

is there any records in IT0581 for this employee...?, If yes check the dates, else let me know what you are trying to do exactly.

Regards,

Mallikarjuna

Read only

0 Likes
1,175

Hi Mallikarjuna,

I am getting records in my table but its not inserting. For this pernr there is no record exists in DB.

Best Regards,

Harshit

Read only

0 Likes
1,175

Change the amount to 3000.00, and also check the amount format in PA0581 table try to pass the same format, and also check the all mandatory fields, Pass the value to all mandatory fields, I feel there could be an subtype for IT0581, If subtype is exits pass the subtype also.

Read only

0 Likes
1,175

Hi,

check function module HR_INFOTYPE_OPERATION directly in se37 with operation 'INS' ,infotype 581 and pernr, it create record or not.

Thanks,

venkat