0

如何在 SDK 中的 Item Masterdata PriceList 上更新项目的价格?

这是我的示例代码:

Try
    Dim aItemMas As SAPbobsCOM.Items
    aItemMas = SAP_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)

    With aItemMas
        .ItemCode = "SMPLE-23456"
        .ItemName = "Sample Test Item222"
        .ForeignName = "01-29992"
        .PriceList.PriceListName(1).GetType()
        .PriceList.Currency = ""
        .PriceList.Price = 100
        .ItemType = SAPbobsCOM.ItemTypeEnum.itItems
        .InventoryItem = SAPbobsCOM.BoYesNoEnum.tNO
        .SalesItem = SAPbobsCOM.BoYesNoEnum.tYES
        .PurchaseItem = SAPbobsCOM.BoYesNoEnum.tNO
        .ItemsGroupCode = 100
        .SalesVATGroup = "ZO"
    End With

    Dim Result As Integer
    Dim ErrNo As Long
    Dim ErrMsg As String = ""

    Result = aItemMas.Add

    SAP_Company.GetLastError(ErrNo, ErrMsg)
    If (ErrNo <> 0) Then
        MsgBox(ErrNo & ": " & ErrMsg, vbCritical)
    End If

Catch ex As Exception
    MsgBox(ex.ToString)
End Try

请帮帮我这个我有库存

4

1 回答 1

1
oItem = ((SAP_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)));

if (oItem.GetByKey(ItemCode) == true)
{
    oItem.PriceList.SetCurrentLine(Index);
    oItem.PriceList.Price = 1000;
}

oItem.Update();

int ErrNo;
string errMsg;

errMsg = SAP_Company.GetLastErrorDescription();
ErrNo = SAP_Company.GetLastErrorCode();

if (ErrNo != 0)
{
    MessageBox.Show(ErrNo + ": " + errMsg);
}
else
{
    MessageBox.Show("Nice!");
}
于 2015-06-18T07:45:05.293 回答