cancel
Showing results for 
Search instead for 
Did you mean: 

Enable to do a commit with BAPI_INSPLOT_SETUSAGEDECISION

Former Member
0 Kudos

Hi everybody,

I'm trying to do an usage decision with bapi BAPI_INSPLOT_SETUSAGEDECISION using Co 3.0 .net connector but I'm having some problems with it. The code excecutes without problems, and a successfull message is returned, but no update was made.

Here I have the code I'm using.

Dim struDatosDecision As IRfcStructure = DecisionEmpleoAPI.GetStructure("UD_DATA")

Dim struReturn1 As IRfcStructure = DecisionEmpleoAPI.GetStructure("RETURN")

DecisionEmpleoAPI.SetValue("NUMBER", NumLote)

struDatosDecision.SetValue("INSPLOT", NumLote)

struDatosDecision.SetValue("UD_SELECTED_SET", "01")

struDatosDecision.SetValue("UD_PLANT", "B001")

struDatosDecision.SetValue("UD_CODE_GROUP", "01")

struDatosDecision.SetValue("UD_CODE", "PC")

struDatosDecision.SetValue("UD_FORCE_COMPLETION", "X") ' Fuerza la Decisión del Empleo

Try

DecisionEmpleoAPI.SetValue("UD_DATA", struDatosDecision)

DecisionEmpleoAPI.Invoke(_ecc)

CommitLote.Invoke(_ecc)

struReturn1 = DecisionEmpleoAPI("RETURN").GetValue

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I found my self the solution.

I was missing a rfcsessionManager.begin - endcontext. I hope it will help somebody

RfcSessionManager.BeginContext(_ecc)

DecisionEmpleoAPI.GetValue("UD_DATA")

DecisionEmpleoAPI.SetValue("UD_DATA", struDatosDecision)

DecisionEmpleoAPI.Invoke(_ecc)

CommitLote.Invoke(_ecc)

RfcSessionManager.EndContext(_ecc)