item

sap-sdk

Working with Item Object

Administration of items

 

NOTE:

If possible, use BeasServiceLayer Item

Only this Object supports the complete Beas functionality.

 

 

Example using SAP SDK for items

Load Item 10003 and change Item Name and default warehouse

declare=di_item=ue_api_sbo
di_item=getbusinessobject=oitems
di_item=getbykey=10003
if <value> <> 1 then
  message=error$item not found <di_item.getlasterror>
  return failure
end if
di_item=itemname=newname
// with di-api-name
di_item=defaultaultwarehouse=01
// or width columnname
di_item=dfltwh=01
// Write change
di_item=update

 

 

Note: Wrong: declare=item=ue_api_spo user is not "item". This is a sbo-gui-api-methode.

 
 

Objectmodel

 

items

 |_ Pricelist

 |_ whsinfo

 

 

Methods (^1)

add

add item

cancel

Cancels a record from the object table.

close

Not supported.

getasxml

Returns the object from XML data, which is stored as string in a buffer.

getbykey

get itemcode. value=1=ok
declare=di_item=ue_api_sbo
di_item=getbusinessobject=oitems
di_item=getbykey=10003
if <value> <> 1 then
message=error$item not found <di_item.getlasterror>
return failure
end if
...

savetofile

Save the object to a file as XML data.

remove

delete the item

savexml

Saves the object data to XML formatted data.

update

Updates the object data in the company database.

 

 

Attention: Please refer to the SAP documentation for more details on each field definition below:

 

Property (^1)

 AssetItem

Determines whether or not this item is a Fixed Assets.

(field name: AssetItem).

 AvgStdPrice

sets the Item Cost.

(field name: AvgPrice).

 BarCode

sets the Bar Code (EAN code) for this item.

(field name: CodeBars).

Length: 16 characters.

 BaseUnitName

sets the inventory Unit Name.

(field name: BaseUnit).

Length: 20 characters.

 Browser

Returns the DataBrowser object.

 CommissionGroup

sets the Commission Group code.

(field name: CommisGrp).

 CommissionPercent

sets the commission percentage for the specified Business Partner.

(field name: CommisPcnt).

 CommissionSum

sets the Total Commission for Item.

(field name: CommisSum).

 CostAccountingMethod

sets the Valuation Method used to evaluate inventory.

(field name: EvalSystem).

 CustomsGroupCode

sets the Customs Group code. Customs groups determine the customs duty for an item purchased abroad.
(field name: CstGrpCode).

 DataExportCode

sets the Data Export Code.

(field name: ExportCode).

Length: 20 characters.

 DefaultWarehouse

sets the Default Warehouse.

(field name: DfltWH).

Length: 8 characters.

DefaultCountingUom


 DesiredInventory

sets the Preferred Quantity in Purchase Units.

(field name: ReorderQty).

 ForceSelectionOfSerialNumber

sets a valid value of "Y" or "N" type that specifies whether or not to force selection of serial numbers for documents.

(field name: BlockOut).

 ForeignExpensesAccount

sets the foreign expenses account.

Length: 15 characters.

 ForeignName

sets the item name or a description in foreign language.

Length: 100 characters.

 Frozen

sets a valid value of "Y" or "N" type that specifies whether or not this item is on hold.

 FrozenFrom

sets the start date for keeping the item on hold.

 FrozenRemarks

sets the remarks regarding the on hold period.

Length: 30 characters.

 FrozenTo

sets the end date for keeping the item on hold.

 GLMethod

valid values are:

0 - Warehouses

1 - Item Group

2 - Item Level  

 IncomeAccount

Not used from DI API version 6.2 and up.

 IncomingServiceCode

sets the incoming service code.

(field name: ISvcCode).

This is a foreign key to the Service Code table (OSCD), not exposed through the DI API.

 IndirectTax

sets a valid value of "Y" or "N" type that specifies whether or not to apply indirect tax.

 InventoryItem

sets a valid value of "Y" or "N" type that specifies whether or not this item is a warehouse item (not a service).

 InventoryUOM

sets the Unit of Measurement for the item (for example: box, case, piece).

Length: 5 characters.

 IsPhantom

sets a valid value of "Y" or "N" type that specifies whether or not the item is a phantom item.

 IssueMethod (issuemthd)

sets a valid value that specifies the method for issuing the item from the inventory: Backflash (automatic) or Manual.
0 or B = SAP Business One issues items automatically from the inventory.

1 or M = The user issues specified items manually from the inventory.

 ItemClass

sets that determines wether or not current Item is a Service or Material.

(field name: ItemClass).

 ItemCode

sets the item code in the inventory. The item code must be unique.

Mandatory property.

Length: 20 characters.

ItemCode is the primary key of item records in SAP Business One and used to distinguish between items in the system.

 ItemCountryOrg

sets the origin country of the item.

Length: 3 characters.

 ItemName

sets the item name/description.

Length: 100 characters.

 ItemsGroupCode

sets the items group code. The user can classify items by groups. Each item can be assigned to one group only. The items group is used for reports and evaluations.

 ItemType

sets a valid value of this Item Type.

(field name: ItemType).

IUomEntry


 LeadTime

sets the lead time in days for ordering the item.

 Mainsupplier

sets the card code of the main supplier of this item.

Length: 15 characters.

 ManageBatchNumbers

sets a valid value of "Y" or "N" type that specifies whether or not this item is managed by batch numbers.

 ManageSerialNumbers

sets a valid value of "Y" or "N" type that specifies whether or not this item is managed by serial numbers.

 ManageSerialNumbersOnReleaseOnly

sets a valid value of "Y" or "N" type that determines whether or not to create automatic serial numbers upon reception.

(field name: ManOutOnly).

 ManageStockByWarehouse

sets a valid value of "Y" or "N" type that specifies whether or not the inventory is managed by the warehouse quantity levels.

 Manufacturer

sets the manufacturer code of the item (foreign key of the Manufacturers object).

Mandatory property.

 MaterialGroup

sets the Material Group.

(field name: MatGrp).

This is a foreign key to the Material Group OMGP object, not exposed through the DI API.

 MaterialType

sets a valid value of BoMaterialTypes that determines current material state from Raw Material to Finished Goods.

(field name: MatType).

 MaxInventory

sets the maximum inventory quantity for this item.

 MinInventory

sets the minimum inventory quantity for this item.

 MinOrderQuantity

sets this Item Minimum Order Quantity limitation . (field name: MinOrdrQty).

 MovingAveragePrice

Returns the average price of an item calculated according to quantities and prices.

ManageStockByWareHouse


 NCMCode

Returns the classification of item that is issued by the Brazilian government and used to determine the IPI tax rate.

(field name: NCMCode).

This is a foreign key to the NCM Code table (ONCM), not exposed through the DI API.

 OrderIntervals

sets the inventory cycle such as, every week on Monday, or every first day of the month. The inventory cycles are defined in SAP Business One (OCYC table, which is not exposed through the DI API).

 OrderMultiple

sets the multiple quantity in addition to the minimum quantity of items in a single order.

 OutgoingServiceCode

sets the Outgoing Service Code.

(field name: OSvcCode).

This is a foreign key to the Service Code Table (OSCD), not exposed through the DI API.

 Picture

sets the picture file name to attach to an item.

(field name: PicturName).

Length: 200 characters.

 PlanningSystem

sets a valid value of BoPlanningSystem type that specifies the inventory planning system: MRP or None.

 PriceList

set pricelist. see pricelistmethode

 ProcurementMethod

sets a valid value of BoProcurementMethod type that specifies the procurement method of items: Buy or Make.

 ProductSource

sets a valid value of BoProductSources that determines the product source.

(field name: ProductSrc).

 Properties

sets a valid value of "Y" or "N" type that specifies whether or not this item belongs to one or more query groups.

 PurchaseFactor1

sets the factor #1 by which the base price list is multiplied to calculate the purchase prices.

 PurchaseFactor2

sets the factor #2 by which the base price list is multiplied to calculate the purchase prices.

 PurchaseFactor3

sets the factor #3 by which the base price list is multiplied to calculate the purchase prices.

 PurchaseFactor4

sets the factor #4 by which the base price list is multiplied to calculate the purchase prices.

 PurchaseHeightUnit

Define the purchase unit with the ID of the measure unit.

 PurchaseHeightUnit1

Define the purchase height unit with the ID of the measure unit.

 PurchaseItem

sets a valid value of "Y" or "N" type that specifies whether or not this item is for purchase (for example, an item can be defined as an asset).

 PurchaseItemsPerUnit

sets the number of items per purchasing unit.

 PurchaseLengthUnit

Define the purchase length unit with the ID of the measure unit.

 PurchaseLengthUnit1

Define the secondary purchase length unit with the ID of the measure unit.

 PurchasePackagingUnit

Define the purchase packaging unit with the ID of the measure unit.

 PurchaseQtyPerPackUnit

Define the purchase packaging unit with the ID of the measure unit.

 PurchaseUnit

Define the purchase unit with the ID of the measure unit.

 PurchaseUnitHeight

Define the purchase unit height with the ID of the measure unit.

 PurchaseUnitHeight1

Define the secondary purchase unit height with the ID of the measure unit.

 PurchaseUnitLength

Define the purchase unit length with the ID of the measure unit.

 PurchaseUnitLength1

Define the secondary purchase unit length with the ID of the measure unit.

 PurchaseUnitVolume

Define the purchase unit volume with the ID of the measure unit.

 PurchaseUnitWeight

Define the purchase unit weight with the ID of the measure unit.

 PurchaseUnitWeight1

Define the secondary purchase unit weight with the ID of the measure unit.

 PurchaseUnitWidth

Define the purchase unit width with the ID of the measure unit.

 PurchaseUnitWidth1

Define the secondary purchase unit width with the ID of the measure unit.

 PurchaseVATGroup

sets the VAT group for a purchase item.

Length: 8 characters.

 PurchaseVolumeUnit

Define the purchase volume unit with the ID of the measure unit.

 PurchaseWeightUnit

Define the purchase weight unit with the ID of the measure unit.

 PurchaseWeightUnit1

Define the secondary purchase weight unit with the ID of the measure unit.

 PurchaseWidthUnit

Define the purchase width unit with the ID of the measure unit.

 PurchaseWidthUnit1

Define the secondary purchase width unit with the ID of the measure unit.

PUomEntry


 QuantityOnStock

sets the total quantity of the item in the warehouse.

 QuantityOrderedByCustomers

sets the total quantity of the items ordered by customers.

 QuantityOrderedFromVendors

sets the total quantity of the items ordered from vendors.

 SalesFactor1

sets the factor #1 by which the base price list is multiplied to calculate the sale prices.

 SalesFactor2

sets the factor #2 by which the base price list is multiplied to calculate the sale prices.

 SalesFactor3

sets the factor #3 by which the base price list is multiplied to calculate the sale prices.

 SalesFactor4

sets the factor #4 by which the base price list is multiplied to calculate the sale prices.

 SalesHeightUnit

Define the sales height unit with the ID of the measure unit.

 SalesHeightUnit1

Define the secondary sales height unit with the ID of the measure unit.

 SalesItem

sets a valid value of "Y" or "N" type that specifies whether or not this item is a sales item.

 SalesItemsPerUnit

sets the number of items per sales unit.

 SalesLengthUnit

Define the sales length unit with the ID of the measure unit.

 SalesLengthUnit1

Define the secondary sales length unit with the ID of the measure unit.

 SalesPackagingUnit

Define the sales packaging unit with the ID of the measure unit.

 SalesQtyPerPackUnit

sets the number of items per sales packaging unit.

 SalesUnit

Define the sales unit with the ID of the measure unit.

 SalesUnitHeight

Define the sales height unit with the ID of the measure unit.

 SalesUnitHeight1

Define the secondary sales height unit with the ID of the measure unit.

 SalesUnitLength

Define the sales length unit with the ID of the measure unit.

 SalesUnitLength1

Define the secondary sales length unit with the ID of the measure unit.

 SalesUnitVolume

Define the sales unit volume with the ID of the measure unit.

 SalesUnitWeight

Define the sales unit weight with the ID of the measure unit.

 SalesUnitWeight1

Define the secondary sales unit weight with the ID of the measure unit.

 SalesUnitWidth

Define the sales unit width with the ID of the measure unit.

 SalesUnitWidth1

Define the secondary sales unit width with the ID of the measure unit.

 SalesVATGroup

sets the VAT group for a sales item.

Length: 8 characters.

 SalesVolumeUnit

Define the unit for the sales volume unit with the ID of the measure unit.

 SalesWeightUnit

Define the unit for the sales weight unit with the ID of the measure unit.

 SalesWeightUnit1

Define the secondary unit for the sales weight unit with the ID of the measure unit.

 SalesWidthUnit

Define the unit for the sales width unit with the ID of the measure unit.

 SalesWidthUnit1

Define the secondary unit for the sales width unit with the ID of the measure unit.

 SerialNum

sets the serial number of the item.

Length: 17 characters

 ServiceGroup

sets the Service Group.

(field name: ServiceGrp).

This is a foreign key to the OSGP object, not exposed through the DI API).

 ShipType

sets the shipping type of the item (air cargo, courier, etc.).

 SRIAndBatchManageMethod

sets a valid value that specifies the method for managing serial numbers and batch numbers.

 SupplierCatalogNo

sets the item catalog number as provided by the main supplier.

Length: 17 characters.

 SWW

sets an additional identifier of the item.

Length: 16 characters.

SUomEntry


 TreeType

Returns a valid value of BoItemTreeTypes type that specifies the product tree type of the item (also known as bill of material type).

 User_Text

sets a free text string for this item.

Length: 10 characters.

UomGroupEntry


 UserFields

Property Userfields does not exist.

Example to set userfield

myitem=u_fieldname=myvalue

 

 Valid

sets a valid value of "Y" or "N" type that specifies whether or not this item is valid.

 ValidFrom

sets the start date of the item's validity.

 ValidRemarks

sets the remarks regarding the validity period.

Length: 30 characters.

 ValidTo

sets the end date of the item's validity.

 VatLiable

sets a valid value of "Y" or "N" type that specifies whether or not this item is subject to VAT.

 WarrantyTemplate

sets the template for service warranty.

Length: 20 characters.

 WhsInfo

set whsinfo. see whsinfo methode

 WTLiable

sets a valid value of "Y" or "N" type that specifies whether or not this item is subject to Withholding tax.

 

(^1) Quelle: SAP Business One SDK

 

Example

beasscript-logo-small

declare=di_item=ue_api_sbo
di_item=getbusinessobject=oitems
di_item=itemcode=10003
di_item=itemname=Sofa
di_item=invntryuom=Peace
di_item=u_me_verbr=Peace
di_item=saleunitmsr=Peace
di_item=buyunitmsr=Peace
di_item=add
destroy di_item

 

Differences to DI-API

All Properties can be mentioned about the table field name.

 di_item=defaultaultwarehouse=01

 di_item=dfltwh=01

Partly available discrepancies are avoided

 Example

 di_item=validfrom=

           delete the date in the field.