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

COMMIT at HR_INFOTYPE_OPERATION

Former Member
0 Likes
3,150

Hi everyone,

I'm facing a little problem: I must update a group of abscences at infotype 2001 for an employee. So, what I want to do is a "none or everything" operation, I mean, if a update in one of the abscences was wrong, roolback the modifications for that employee.

I've tried to use the HR_INFOTYPE_OPERATION within a LOOP, with the NOCOMMIT parameter set = 'X', and use a COMMIT WORK or a ROOLBACK outside, in my program. But I found out that it is not working like I've imagined.

Someone have an idea? I don't want to use UPDATE command directly, because for infotypes it's not recommended.

Thanks in advance!

Raphael

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,531

Hi,

Have you tried to excecute the function module

CALL FUNCTION 'HR_INITIALIZE_BUFFER'. just afert you have upadte your group of absences ?

Regards

3 REPLIES 3
Read only

Former Member
0 Likes
1,531

Hi Raphael

Just check if you have an option of VTASK with that FM, in that case pass VTASK as 'B', in case of all your records are successful then use Commit work else Rollback the update.

Cheers

~ Ranganath

Read only

Former Member
0 Likes
1,532

Hi,

Have you tried to excecute the function module

CALL FUNCTION 'HR_INITIALIZE_BUFFER'. just afert you have upadte your group of absences ?

Regards

Read only

Former Member
0 Likes
1,531

Thanks Jürgen!

I was about to change the FM, but with your help I could see that the problem was I've used the FM 'HR_INITIALIZE_BUFFER' just after each call of FM 'HR_INFOTYPE OPERATION', so when the COMMIT WORK was called there was nothing to commit...hehe.

So now it's working fine!

Raphael