on 03-16-2010 10:38 AM
We're using FM HR_INFOTYPE_OPERATION to update the infotype 0001 (Organisation). We basically have the Cost center field grayed out on the entry screen so can not update it via BDC, which the cirrent method that we use to create new employees, based on data passed in from a third party system. When then attempt to update the employee record (using Copy) and the FM mentioned.
We first get the details of the infotype using FM HR_INFOTYPE_GETDETAIL, and this work perfectly, returning all the information required. We the update the structure returned by the RECORD parameter and then use the FM HR_INFOTYPE_OPERATION, like so:
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = '0001'
number = gs_p0001-pernr
SUBTYPE =
OBJECTID =
lockindicator = 'X'
validityend = '99991231'
validitybegin = gs_p0001-einda
RECORDNUMBER = '001'
record = gs_p0001
operation = 'COP'
nocommit = 'X'
importing
return = gt_bapireturn1
key = gs_bapipakey
exceptions
others = 1.
However, we receiving an error in the gt_bapireturn1 itab basically giving the error PG 184. When I look up the error it basically says that to update this info type we need an exclusive lock, which I would have thought exists when using the LOCKINDICATOR parameter. The previous FM ( HR_INFOTYPE_GETDETAILS) returns blank against the SPRPS fileld (Lock indicator) when reading the infotype data, so it's not previously locked or anything.
We're using version 4.0b, which I know is pretty old, but surely this update should work.
Has anyone encountered this problem before, and, do you think I should be able to update this field even though it's grayed out on the screen ?.
Jason
Edited by: Jason Stratham on Mar 16, 2010 11:41 AM
I read that I should be using the enqueue and dequeue FM's despite the LOCKINDICATOR parameter.
This I have now done, but am now receiving an error PG 428 'A complex application error has occurred', but I'm none the wiser in knowing why this error has occurred. Has anyone encountered this error before?.
I'm beginning to feel that despite being told that I can use the HT_INFOTYPE_OPERATION function module it may well purely imitate the front screen processing, which does not allow us to change the cost center value. Is there any way that this might be done. We're on version 4.0b, and I'm sure that in later version there might be a BAPI that almost directly updates it. I guess there's no such method for 4.0b?.
Jason
Edited by: Jason Stratham on Mar 16, 2010 12:06 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.