Skip to Content
0

Dont' find stock transfer request in SAP DI-API

Feb 07 at 07:36 AM

58

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Edy Simon Feb 08 at 02:05 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded