cancel
Showing results for 
Search instead for 
Did you mean: 

Need help for Update and cancel SalesOrder

former_member219446
Participant
0 Kudos

Hi All,

I written java code for create sales order based on salesquotation,now i want to update and cancel sales order ,i need help to update and cancel salesorder.

can give any related links for update and cancel salesorder.

Thanks and Regards,

Srinivas

Accepted Solutions (1)

Accepted Solutions (1)

former_member184566
Active Contributor
0 Kudos

Hi srinivas.L

It is simple, here is some sample code. You must use getbykey to get the document. Then once you got it you can make whatever changes you need. Then update it. where i have oOrder.Update() you can have oOrder.cancel

Dim oOrder As SAPbobsCOM.Documents

oOrder = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)

If oOrder.GetByKey(530) Then

oOrder.Lines.SetCurrentLine(1)

oOrder.Lines.WarehouseCode = "01"

If oOrder.Update() <> 0 Then

MsgBox(oCompany.GetLastErrorDescription)

End If

Else

MsgBox("Nothing found")

End If

Hope this helps

former_member219446
Participant
0 Kudos

Hi Louis,

Thank you,

By using your code updation and cancel are working fine.

while updation ,which fields can i update and which can't.

(I am updating sales order).

Thanks and Regards,

Srinivas

former_member219446
Participant
0 Kudos

Hi Louis,

While updating sales order data using program,

In "ordr" table it consists of docnum=1177 and docentry=179,

the corresponding table rdr1 contains two items A00001 adn A00003 for that docentry=179.

now i want to update the sales order data for docnum=1177 as it should contain only one item A00005.

i written update code but the remaining items are also existed after updation.

can u help me how can i fulfill my requirement.

(after updation rdr1 contains only one item ...A00005)

Thanks and Regards

Srinivas

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Srinivas..

I also have the same problem.

There are many properties for object Order. Which one we need to fill to update, which one we dont have to, im not clear. If application can have COPY function, why not put the method into the object, which will make our life easier.

What i did is i just copied all properties from one SO to another SO.