on 03-17-2015 2:15 PM
Hola a Todos.
He creado Una Tabla Definida por el Usuario (UDT), con sus respectivos campos (UDF), esto lo he realizado en una empresa de pruebas, ¿Como hago para exportar o pasar esta UDT a la Base de Datos de otra empresa(Sociedad)?
Saludos y Muchas Gracias.
Buenas tardes.
Para realizar lo que necesitas debes seguir los siguientes pasos (te aseguro que es más rápido hacerlo por el cliente)
1.- Conectarse a la compañía que tiene la tabla de usuario:
SAPbobsCOM.Company oCompany = new SAPbobsCOM.Company();
int lRetCode;
oCompany.Server = "sap9";
oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2008;
oCompany.DbUserName = "sa";
oCompany.DbPassword = "S****";
oCompany.CompanyDB = "SBO_DemoCL";
oCompany.UserName = "manager";
oCompany.Password = "bes****";
try
{
lRetCode = oCompany.Connect();
}
catch
{
MessageBox.Show(oCompany.GetLastErrorDescription());
}
2.- Declarar, seleccionar y exportar el objeto de tu tabla en XML
oCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode;
SAPbobsCOM.UserTablesMD oUserTablesMD = (SAPbobsCOM.UserTablesMD)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables);
if (oUserTablesMD.GetByKey("ZSCH1"))
{
oUserTablesMD.SaveToFile("C:\\" + oUserTablesMD.TableName + ".xml");
}
3.- Debes recuperar la lista de ID campos de usuarios desde la tabla CUFD y exportarlos en XML
SAPbobsCOM.UserFieldsMD oUserFieldsMD = (SAPbobsCOM.UserFieldsMD)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields);
string UDTName = "ZSCH1";
int UDF_ID = 5;
if (oUserFieldsMD.GetByKey(UDTName, UDF_ID))
{
oUserTablesMD.SaveToFile("C:\\" + oUserFieldsMD.FieldID + ".xml");
}
4.- Luego de exportar todo, te conectas a la nueva compañia
{Codigo paso 1}
5.- Cargas los XML en el orden que los exportaste
oCompany.GetBusinessObjectFromXML("C:\\MyXML.xml");
Saludos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola
yo la crearía en la empresa nueva y copiaría los datos mediante SQL (INSERT INTO TABLA FROM ORIGEN,DBO.TABLA).
Un saludo
Agustín Marcos Cividanes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
puedes replicarla por medio de DTW con los templetes que están en la carpeta User Defined Data, Meta Data.
saludos.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
11 | |
11 | |
6 | |
6 | |
5 | |
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.