Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Compras-Proveedores>Entradas de Mercancías [DI API]

Buenos dias; ¿Estimados, como puedo realizar las entradas de mercancias de proveedores basado en Orden de Compra mediante DI API? Si se como mandar a grabar, pero no se como simular el boton: (copiar de pedidos) y manejar esos saldos de cantidades que se generan, ya que guardan el documento base. En espera de su ayuda. Saludos, DR

Former Member
replied

Hi Douglas,

You can achieve this with something like this:

            int orderNumber = 0; //key of your order

            Documents oPurchaseDelivery = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes);

            oPurchaseDelivery.CardCode = "C20000";

            oPurchaseDelivery.DocDueDate = DateTime.Now;

            oPurchaseDelivery.Lines.BaseType = (int)SAPbobsCOM.BoObjectTypes.oPurchaseOrders;

            oPurchaseDelivery.Lines.BaseEntry = orderNumber; //the number of base order

            oPurchaseDelivery.Lines.BaseLine = 0; //the index of line in base order, that you need copy

            if (oPurchaseDelivery.Add() != 0)

            {

                MessageBox.Show(oCompany.GetLastErrorDescription());

                return;

            }

            else

            {

                MessageBox.Show("PurchaseDelivery [" + oCompany.GetNewObjectKey() + "] created!");

            }

Regards,

Diego

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question