‎2014 May 06 11:02 AM
Hello guys,
I'm trying to update some REFX objects (contracts) by removing the master data lock (stat I0065). In 2012 I used function STATUS_CHANGE_INTERN for it and everything worked fine. Now I have the same coding like then, but the update does not work anymore, it just did not remove the master lock data.
The function was updated by SAP in 07/2013. Is there anything new what does not work anymore or where is the problem?
My coding is:
* Aufheben der Sperre
gs_status_int-stat = 'I0065'.
gs_status_int-inact = 'X'.
APPEND gs_status_int TO gt_status_int.
* Sperre löschen
CALL FUNCTION 'STATUS_CHANGE_INTERN'
EXPORTING
check_only = p_test
objnr = gs_contract-objnr
TABLES
status = gt_status_int
EXCEPTIONS
object_not_found = 1
status_inconsistent = 2
status_not_allowed = 3
OTHERS = 4.
* Im Echtlauf Update der DB
IF p_test EQ space.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = gs_return.
ENDIF.
btw with function STATUS_CHANGE_INTERN_VB everything works!
Where is the problem?
Thanks a lot.
Regards
Michael
‎2014 May 06 9:16 PM
Hi Michael
what is the result of sy-subrc after 'STATUS_CHANGE_INTERN' ??
Regards
MC
‎2014 May 07 7:52 AM
The problem ist that returncode is 0. Everything looks fine, just the status did not change 😕
‎2015 Feb 13 7:23 AM
‎2014 May 06 9:37 PM
‎2014 Sep 25 12:58 PM
Dear Michael.
I'm doing some equal than you, modifying status at WBS elements.
I've tryied to use STATUS_CHANGE_INTERN FM with the same result.
Debugging the SAP standard system, I've found that doesn't modify anything.
The error is here at LBSVAF13 include.
*---------------------------------------------------------------------*
* FORM CALL_STATUS_UPDATE *
*---------------------------------------------------------------------*
* ggf. Verbuchung anstoßen *
*---------------------------------------------------------------------*
FORM CALL_STATUS_UPDATE.
IF SY-ONCOM = 'P'.
* For performance reasons do not update status immediately
* if status changes are performed ON COMMIT
* PERFORM STATUS_UPDATE.
ELSEIF COMMIT_FORCED = OFF.
PERFORM STATUS_UPDATE ON COMMIT.
PERFORM STATUS_ROLLBACK ON ROLLBACK. "note966213
* instead update status later on lowest possible COMMIT level.
*
* basically the same routine as STATUS_UPDATE, but as routine
* can be registered only once for processing even on different
* levels, it has to be encapsulated in a dummy routine
* STATUS_UPDATE_REST here.
PERFORM STATUS_UPDATE_REST ON COMMIT LEVEL 999.
COMMIT_FORCED = ON.
ENDIF.
ENDFORM.
Never execute anything, so finally I've just decided execute STATUS_CHANGE_INTERN_VB or STATUS_UPDATE which one is execute just inside the first one.
May be it should be posted like a OSS note.
King regards.
‎2014 Sep 25 1:31 PM
Hi Michael,
For the similar requirement in REFX, I have used BAPI 'BAPI_RE_CN_CHANGE'
you need to pass 'TRANS' with respective status value.
You can try by passing 'PSEM'(Unlock master data)
Regards,
Greeshma.