pick and pack and sales order invoice via odata

Hello All:

In the past written the code for invoicing sales order

static void postSalesInvoice(Args _args)
// Define a class variable according to the  type of posting being performed
SalesFormLetter_Invoice invoice;
SalesTable salesTable;
// Select the salesTable to update
salesTable = SalesTable::find(“SO-101297”);
// Create a new object of the SalesFormLetter_Invoice by using the construct-method in //SalesFormLetter
invoice = SalesFormLetter::construct(DocumentStatus::Invoice);
// Post the invoice of SO
invoice.update(salesTable, SystemDateGet(), SalesUpdate::All,AccountOrder::None, false, true);
// Set to true to print the invoice


Can we write same code written with odata?

Please let me know ASAP


Shankar :)