private void InternalExecuteRFC_CALL_TRANSACTION_USING() { IRfcFunction function; if (this._CustomFunctionName.Equals("")) { // function = RFCFunctionFactory.GenerateFunctionObjectForRFC_CALL_TRANSACTION_USING(this._con.IsUnicode); function = _des.Repository.CreateFunction("RFC_CALL_TRANSACTION_USING"); } else { //function = this._con.CreateFunction(this._CustomFunctionName); function = this._des.Repository.CreateFunction(this._CustomFunctionName); } // function.Connection = this._con; function["TCODE"].SetValue(this._TCode); if (this.ExecutionMode == TransactionDialogMode.ShowAll) { function["MODE"].SetValue("A"); } else if (this.ExecutionMode == TransactionDialogMode.Background) { function["MODE"].SetValue("N"); } else { function["MODE"].SetValue("E"); } IRfcTable table = function.GetTable("BT_DATA"); for (int i = 0; i < this.BatchSteps.Count; i++) { table.Append(); IRfcStructure structure = table.CurrentRow; structure["PROGRAM"].SetValue(this.BatchSteps[i].ProgramName); structure["DYNPRO"].SetValue(this.BatchSteps[i].DynproNumber); if (this.BatchSteps[i].BeginNewDynpro) { structure["DYNBEGIN"].SetValue("X"); } structure["FNAM"].SetValue(this.BatchSteps[i].FieldName); structure["FVAL"].SetValue(this.BatchSteps[i].FieldValue); } function.Invoke(_des); for (int j = 0; j < function.GetTable("L_ERRORS").RowCount; j++) { IRfcStructure structure2 = function.GetTable("L_ERRORS")[j]; BatchReturn newBatchReturn = new BatchReturn { Message = "", Type = structure2["MSGTYP"].GetValue().ToString(), MessageID = structure2["MSGID"].GetValue().ToString(), MessageNumber = structure2["MSGNR"].GetValue().ToString(), MessageVariable1 = structure2["MSGV1"].GetValue().ToString(), MessageVariable2 = structure2["MSGV2"].GetValue().ToString(), MessageVariable3 = structure2["MSGV3"].GetValue().ToString(), MessageVariable4 = structure2["MSGV4"].GetValue().ToString() }; newBatchReturn.FillMessageText(_sysName); this.Returns.Add(newBatchReturn); } }
private void InternalExecuteRFC_CALL_TRANSACTION() { IRfcFunction function; if (this._CustomFunctionName.Equals("")) { function = _des.Repository.CreateFunction("RFC_CALL_TRANSACTION"); } else { function = this._des.Repository.CreateFunction(this._CustomFunctionName); } function["TRANCODE"].SetValue(this._TCode); if (this._UpdateMode == TransactionUpdateMode.Asynchronous) { function["UPDMODE"].SetValue("A"); } else if (this._UpdateMode == TransactionUpdateMode.Synchronous) { function["UPDMODE"].SetValue("S"); } else { function["UPDMODE"].SetValue("L"); } if (this.ExecutionMode == TransactionDialogMode.ShowAll) { this.BatchSteps.Insert(0, new BatchStep("", "0", false, "BDC_OKCODE", "/BDA")); } else if (this.ExecutionMode == TransactionDialogMode.ShowOnlyErrors) { this.BatchSteps.Insert(0, new BatchStep("", "0", false, "BDC_OKCODE", "/BDE")); } IRfcTable table = function.GetTable("BDCTABLE"); for (int i = 0; i < this.BatchSteps.Count; i++) { table.Append(); IRfcStructure structure = table.CurrentRow; structure["PROGRAM"].SetValue(this.BatchSteps[i].ProgramName); structure["DYNPRO"].SetValue(this.BatchSteps[i].DynproNumber); if (this.BatchSteps[i].BeginNewDynpro) { structure["DYNBEGIN"].SetValue("X"); } structure["FNAM"].SetValue(this.BatchSteps[i].FieldName); structure["FVAL"].SetValue(this.BatchSteps[i].FieldValue); } function.Invoke(_des); IRfcStructure structure2 = function.GetStructure("MESSG"); if (structure2["MSGTY"].GetValue().ToString().Trim() != "") { BatchReturn newBatchReturn = new BatchReturn { Type = structure2["MSGTY"].GetValue().ToString(), Message = structure2["MSGTX"].GetValue().ToString(), MessageID = structure2["MSGID"].GetValue().ToString(), MessageNumber = structure2["MSGNO"].GetValue().ToString() }; this.Returns.Add(newBatchReturn); } }
public virtual void Add(BatchReturn NewBatchReturn) { base.List.Add(NewBatchReturn); }