Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

RFC Problem

Former Member
0 Likes
619

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.

3 REPLIES 3
Read only

Former Member
0 Likes
597

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

Read only

Former Member
0 Likes
597

  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.

Read only

Former Member
0 Likes
597

1.Checks whether other Back ground jobs also gets cancelled .

2.Check with your basis team..reg:authorizations

Cheers