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

Make a Test before Saving data to an Infotype ( HR_INFOTYPE_OPERATION )

michael_teran
Participant
0 Kudos
2,846

Hello,

I have a problem saving data  to infotype 2007

Step 1.

First I would make a test before saving data, after that I would  Know If there are some errors. I use HR_INFOTYPE_OPERATION function , with NOCOMMIT = 'X' and  ROLLBACK WORK .... (It does not  SAVE ANYTHING)

Step 2.

If there are not errors ( in step 1 ) . I should save, I use the same function ( HR_INFOTYPE_OPERATION) but when I save ( COMMIT WORK AND WAIT )

SAP save two rows in infotype 2007 ( one  for each step )

I would like to know if it exists some Function to make a test or how can i use HR_INFOTYPE_OPERATION, for making a test an after that Save just one row

Thanks

7 REPLIES 7
Read only

Former Member
0 Kudos
1,617

See if FM HR_PSBUFFER_INITIALIZE can be used.

It is in same function group as HR_INFOTYPE_OPERATION.

During simulation, people also use statement SET UPDATE TASK LOCAL.

Read only

jayanthi_jayaraman
Active Contributor
0 Kudos
1,617

Hi,

Are you saying that no_commit = 'X' is working or you want to find out how to do that in test mode?

Read only

0 Kudos
1,617

Test Mode.   "no_commit = 'X'"  --> it does not work out.

Read only

0 Kudos
1,617

As per your Step #2 what value you send in "NO_COMMIT" ??

Debug your Code you can easily find where is your problem, my suggest don't pass any value in "NO_COMMIT" Parameter also don't use "COMMIT WORK AND WAIT" after FM .

Reason :  If you See above FM Source Code , where "NO_COMMIT"  = Initial mean blank , then LUW_MODE = '1'

Now See where this LUW_MODE is Pass into "HR_MAINTAIN_MASTERDATA"  inside above FM i.e. "HR_INFOTYPE_OPERATION" .

then check inside "HR_MAINTAIN_MASTERDATA" FM Source Code where and how this parameter work LUW_MODE ='1' .

Now Check  from Line Number : 244 to 321 in ""HR_MAINTAIN_MASTERDATA" FM Source Code Logic .

here you see  if LUW_MODE = '1' , or NO_COMMIT Is Initial then FM automatically call below Statement i.e. "COMMIT WORK"

Note : Debug your existing Code you can easily find why two row is save , during your STEP#2 .

          or Hide NO_COMMIT Line and don't call again COMMIT WORK after STEP#2 .

Regard's

Smruti

Read only

0 Kudos
1,617

Hi,

Check this link. It is using classes for updating in simulation mode.

http://scn.sap.com/docs/DOC-40711

Read only

Former Member
0 Kudos
1,617

Check these Notes:

Note 635072 - Function module HR_PSBUFFER_INITIALIZE

Note 589887 - Long runtime of BAPIs for HR infotypes

Note 615511 - Long runtimes with 'HR_MAINTAIN_MASTERDATA' for HR infotypes

Regard's

Smruti

Read only

amit_khare
Active Contributor
0 Kudos
1,617

It should work as suggested by Manish Kumar by using Function module HR_PSBUFFER_INITIALIZE but commit work might is an issue with this FM.  It's not reliable in many scenarios.

Try HR_MAINTAIN_MASTERDATA and use the commit from there.