AGREGAR SOCIO DE NEGOCIO A SAPB1 CON DI SERVER

Code with Edd

COMO AGREGAR UN SOCIO DE NEGOCIO A SAP BUSINESS ONE USANDO DI SERVER.

Estructura que debe de tener el XML que se genera para agregar un socio de negocio en SAPB1 utilizando la librería DI Server.

public AddResponseBusinessPartner AddingBusinessPartner(string SessionID, BusinessPartnerReq businessPartner)
{
    try
    {
        string soap_cmd = "";
        string response = "";

        soap_cmd = "<?xml version=\"1.0\" encoding=\"UTF-16\"?>";
        soap_cmd += "<env:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\">";
        soap_cmd += "<env:Header>";
        soap_cmd += "<SessionID>" + SessionID + "</SessionID>";
        soap_cmd += "</env:Header>";
        soap_cmd += "<env:Body>";

        soap_cmd += "<dis:Add xmlns:dis=\"http://www.sap.com/SBO/DIS\">";
        soap_cmd += "<Service>BusinessPartnersService</Service>";
        soap_cmd += "<BusinessPartner>";

        soap_cmd += "<Series>83</Series>";
        soap_cmd += "<CardName>" + businessPartner.CardName + "</CardName>";
        soap_cmd += "<CardType>cCustomer</CardType>";
        soap_cmd += "<GroupCode>" + businessPartner.GroupCode + "</GroupCode>";
        soap_cmd += "<Phone1>" + businessPartner.Phone1 + "</Phone1>";
        soap_cmd += "<Phone2>" + businessPartner.Phone2 + "</Phone2>";
        soap_cmd += "<EmailAddress>" + businessPartner.EMail + "</EmailAddress>";
        soap_cmd += "<FederalTaxID>" + businessPartner.LicTradNum + "</FederalTaxID>";
        soap_cmd += "<SalesPersonCode>" + businessPartner.SlpCode + "</SalesPersonCode>";
        soap_cmd += "<PriceListNum>" + businessPartner.ListNum + "</PriceListNum>";
        soap_cmd += "<AliasName>" + businessPartner.AliasName + "</AliasName>";
        soap_cmd += "<Industry>" + businessPartner.IndustryC + "</Industry>";
        soap_cmd += "<Valid>tYES</Valid>";
        soap_cmd += "<U_LMSucursal>" + businessPartner.LMSucursal + "</U_LMSucursal>";

        soap_cmd += "<BPAddresses>"
            ;
        soap_cmd += "<BPAddress>";
        soap_cmd += "<AddressType>bo_BillTo</AddressType>";
        soap_cmd += "<AddressName>FISCAL</AddressName>";
        soap_cmd += "<Street>" + businessPartner.Street + "</Street>";
        soap_cmd += "<Block>" + businessPartner.Block + "</Block>";
        soap_cmd += "<ZipCode>" + businessPartner.ZipCode + "</ZipCode>";
        soap_cmd += "<City>" + businessPartner.City + "</City>";
        soap_cmd += "<Country>" + businessPartner.Country + "</Country>";
        soap_cmd += "<State>" + businessPartner.State + "</State>";
        soap_cmd += "<U_Latitud>" + businessPartner.Latitud + "</U_Latitud>";
        soap_cmd += "<U_Longitud>" + businessPartner.Longitud + "</U_Longitud>";
        soap_cmd += "</BPAddress>";

        soap_cmd += "<BPAddress>";
        soap_cmd += "<AddressType>bo_ShipTo</AddressType>";
        soap_cmd += "<AddressName>" + businessPartner.Address + "</AddressName>";
        soap_cmd += "<Street>" + businessPartner.Street + "</Street>";
        soap_cmd += "<Block>" + businessPartner.Block + "</Block>";
        soap_cmd += "<ZipCode>" + businessPartner.ZipCode + "</ZipCode>";
        soap_cmd += "<City>" + businessPartner.City + "</City>";
        soap_cmd += "<Country>" + businessPartner.Country + "</Country>";
        soap_cmd += "<State>" + businessPartner.State + "</State>";
        soap_cmd += "<U_Latitud>" + businessPartner.Latitud + "</U_Latitud>";
        soap_cmd += "<U_Longitud>" + businessPartner.Longitud + "</U_Longitud>";
        soap_cmd += "</BPAddress>";

        soap_cmd += "</BPAddresses>";

        soap_cmd += "</BusinessPartner>";
        soap_cmd += "</dis:Add>";
        soap_cmd += "</env:Body>";
        soap_cmd += "</env:Envelope>";


        response = NodeDIS.Interact(soap_cmd);

        AddResponseBusinessPartner res = this.xml.UpdateObjectResponse(response);

        return res;
    }
    catch (Exception ex)
    {
        return new AddResponseBusinessPartner { Success = false, CodeErr = 400, CardCode = null, Message = ex.Message };
    }
}

Referencia: SAP Business One SDK – Help Center

https://help.sap.com/viewer/product/SAP_BUSINESS_ONE/9.3/es-ES

.

AGREGAR SOCIO DE NEGOCIO A SAPB1 CON DI SERVER
Web | + posts

Full Stack Web Developer && SDK SAPB1 Developer.

Melómano, Gamer (Xbox), Comprador compulsivo de Amazon y Posiblemente con TDAH.

Scroll hacia arriba