Skip to Content
avatar image
Former Member

Dont' find stock transfer request in SAP DI-API

He,

i create a stock transfer request with DI-API, the code is next:

try
{
                        StockTransfer oTransfer = oCompany.GetBusinessObject(BoObjectTypes.oStockTransferDraft);
                        oTransfer.DocObjectCode =  BoObjectTypes.oInventoryTransferRequest;                       
                        oTransfer.CardCode = "CODE";
                        oTransfer.CardName = "NAME";
                        oTransfer.Address = "ADDRESS";
                        oTransfer.ToWarehouse = "FROM";
                        oTransfer.FromWarehouse = "TO";
                        oTransfer.DocDate = Convert.ToDateTime("2018/02/06");
                        oTransfer.TaxDate = Convert.ToDateTime("2018/02/06");
                        oTransfer.PriceList = 1;
                        oTransfer.Lines.ItemCode = "CODE";
                        oTransfer.Lines.FromWarehouseCode = "FROM";
                        oTransfer.Lines.WarehouseCode = "TO";
                        oTransfer.Lines.Quantity = 1;
                        oTransfer.Lines.VendorNum = "VENDOR";
                        oTransfer.Comments = "COMMENT";
                        if (oTransfer.Add() != 0){
                            MessageBox.Show(oCompany.GetLastErrorDescription());
                        }else{
                            MessageBox.Show("SUCCESS ");
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }

when execute this show result "SUCCESS" but don't cant find the request in SAP

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 08 at 02:05 AM

    Hi Francisco,

    StockTransfer oTransfer = oCompany.GetBusinessObject(BoObjectTypes.oStockTransferDraft);

    will create a stock transfer draft object for you.

    In my testing SBO 91PL6 i can find this, not sure in your version.

    SAPbobsCOM.StockTransfer st = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryTransferRequest) as SAPbobsCOM.StockTransfer;

    Regards
    Edy

    Add comment
    10|10000 characters needed characters exceeded