+2  A: 

Once shipment and invoice are created for an order it is set to a status of "Complete". Not sure what you want to change there, but if you have some custom statuses set up in your magento installation you can use the setStatus() method of the order class.

$myShipment->getOrder()->setStatus("YourCustomStatus");

I don't think shipments have statuses, but you can add a comment to a shipment by calling addComment($comment, $notifyCustomer), where first variable is a string and second is bool.

$myShipment->addComment("01/01/2010 06:55, Out for delivery", true);

You can also add a comment to the order using a similar method:

$myShipment->getOrder()->addComment("01/01/2010 06:55, Out for delivery", true);
silvo
hi silvo, i did it as you said but when i did $myShipment->save(); i lost tracking id and items from shipment.still cat make it work as i want ... i want that the shipment should be marked shipped and order status i have pasted my full code here http://pastebin.org/382465regards,saurabh
Saurabh