2013 Jun 06 4:36 PM
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
2013 Jun 07 9:35 AM
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.
2013 Jun 07 9:49 AM
Hi,
Are you saying that no_commit = 'X' is working or you want to find out how to do that in test mode?
2013 Jun 07 4:25 PM
2013 Jun 09 12:36 PM
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
2013 Jun 10 5:15 AM
Hi,
Check this link. It is using classes for updating in simulation mode.
2013 Jun 07 10:05 AM
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
2013 Jun 07 8:18 PM
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.