‎2009 Feb 06 10:26 AM
I've created a zBAPI that posts financial documents. After posting, it sends an email of the results.
This works fine when done in foreground. Remotely, SO_DOCUMENT_SEND_API1 is raising subrc 4 which is no authorization.
I don't get it. Why would the zBAPI executes properly in foreground but encountered problem when done in background?
Note: Same user account used in both transaction.
‎2009 Feb 06 10:33 AM
can you share code,
are you using fm Gui_upload or download .....if yes they dependent on the gui and will not work in back gnd
‎2009 Feb 06 10:43 AM
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = lwa_doc
document_type = c_raw
put_in_outbox = c_x
commit_work = c_x
IMPORTING
sent_to_all = lv_sent
new_object_id = lv_id
TABLES
object_content = li_content
receivers = li_rcvrs
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc NE 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Nothing special with my code. Just calling an FM to send my emails.
‎2009 Feb 06 10:53 AM
1.Checks whether other Back ground jobs also gets cancelled .
2.Check with your basis team..reg:authorizations
Cheers