I searched very deeply for exits or BADI to add a custom button to the standard toolbar, I had no success, the only suggested way was to add the button to the customer data tabstrip, but that was not the requirement.
Eventually I solved adding the button + function code to the standard gui status NORMAL.
steps:
1. transaction SE80
2. function group MEGUI
3. gui status -> NORMAL
4. added new button (in my case it's for sending email) and function code to the status
5. added implicit enhancement to program LMEGUICJL , where the standard function codes are also handled.
6. retrieved order's data through the following ABAP:
l_transaction = l_appl->my_trmgr->get_current( ).
READ TABLE l_transaction->my_data ASSIGNING <fs_document> INDEX 1.
<fs_document> contains order's main data, from here it's possible to work on whatever solution needed. In my case i called PO smartform and sent it by email