cancel
Showing results for 
Search instead for 
Did you mean: 

How create a new production order by C++ code?

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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