on 11-15-2010 4:00 AM
Hi everybady
I'm trying to create new production orders using a VC++ 6.0,
but as i can't put a new DocumentNumber "It's Read only",
i can't add a new orders. show me sample code plz....
help me....
Thanks
Hello
Docnum will be avaiable when you issed the Production order.
The method on each langugage is the same so hereby i am posting a VB.NET Code,and you can convert it.
The mandartory fields:
ItemCode - you would like to produce
Qty - how many you would like to producce
After you issued the Production order, you must change the Status from planned to Released
of course, you can add more properties.....
Dim oPO As SAPbobsCOM.ProductionOrders = oCompany.GetBusinessObject(BoObjectTypes.oProductionOrders)
oPO.ItemNo = "ITEMCODE"
oPO.PlannedQuantity = "QTY TO BE CREATED"
oPO.PostingDate = Today.Date
oPO.ProductionOrderType = BoProductionOrderTypeEnum.bopotStandard
If oPO.Add <> 0 Then
Dim POENTRY As String = oCompany.GetNewObjectKey()
If oPO.GetByKey(CInt(POENTRY)) Then
oPO.ProductionOrderStatus = BoProductionOrderStatusEnum.boposReleased
' Here you have a docnum like OPO.DocNum '
If oPO.Update() <> 0 Then
sbo_application.MessageBox(oCompany.GetLastErrorDescription)
Exit Sub
End If
End If
End If
Regards
János
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
105 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.