Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

220
Vistas
.Net SAP Transaction restart from client

I'm using .Net NCo 3.0 library and I tried one example of tRFC wherein I see the transaction ID is created and associated with the RFC function and then invoked, after a successful transaction, the transaction ID is deleted, here we maintain the Transaction details in database for each tRFC operation, so, in this case, if the transaction fails, we can get the ID from the database and we can try again, I would like to know the code implementation of retry mechanism, there is a possibility that the SAP server is down, so when and how to restart and make sure that the transaction initiated is executed only once, no loss of data and no duplication.

TidStore tidStore = new TidStore("clientTidStore", false);

 static RfcTransaction CreateTransaction(TidStore tidStore, out string data)
        {
            RfcTransaction trans = new RfcTransaction(); // This creates a fresh TID.;
            Console.Write("Please enter some input data: ");
            data = Console.ReadLine();

            FileStream dataFile = new FileStream(trans.Tid.TID, FileMode.Create, FileAccess.ReadWrite);
            byte[] utf8Data = Encoding.UTF8.GetBytes(data);
            dataFile.Write(utf8Data, 0, utf8Data.Length);
            dataFile.Close();
            tidStore.CreateEntry(trans.Tid.TID);
            return trans;
        }

        private void SubmitTransaction(RfcTransaction trans, TidStore tidStore, String data)
        {
            try
            {
                IRfcTable dataTable = stfc_write_to_tcpic.GetTable("TCPICDAT");
                dataTable.Append();
                dataTable.SetValue(0, data);

                // Insert the function module into the transaction:
                trans.AddFunction(stfc_write_to_tcpic);
                stfc_write_to_tcpic = (IRfcFunction)stfc_write_to_tcpic.Clone();
                dataTable = stfc_write_to_tcpic.GetTable("TCPICDAT");
                dataTable.SetValue(0, data + " -- data of the second function module");
                trans.AddFunction(stfc_write_to_tcpic);
                trans.Commit(_ECCsystem);
                tidStore.SetStatus(trans.Tid.TID, TidStatus.Committed, null);

                File.Delete(trans.Tid.TID);
                _ECCsystem.ConfirmTransactionID(trans.Tid);
                tidStore.DeleteEntry(trans.Tid.TID);
            }
            catch (Exception e)
            {
                tidStore.SetStatus(trans.Tid.TID, TidStatus.RolledBack, e.Message);
            }
        }
    }
}
    
over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You need to create your own function with a time interval to check which TID's are not yet processed.

over 4 years ago · Santiago Trujillo Denunciar

0

With regard to deal with and to implement SAP transaction handling at external program side, there are some general explanations in the SAP NetWeaver RFC SDK 7.50 Programming Guide which are quite helpful, I think. Please see chapters 4.3, 4.4 and 5.5. It is more detailed than what is explained in the SAP .NET Connector 3.0 Programming Guide and it can easily be adapted to the NCo programming APIs as well.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda