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

E-mail error : SO_DOCUMENT_SEND_API1

Former Member
0 Likes
4,222

Hi,

After running F110 transaction, spools are getting generated with Remittance Advises Notes which are using Scripts.

Requriement is Take each spool and covert into PDF and send it to Vendor email id.

Iam using FMs CONVERT_OTFSPOOLJOB_2_PDF and SO_DOCUMENT_SEND_API1.

When while running the program Iam getting the following Error in FM SO_DOCUMENT_SEND_API1

'System error when accessing Knowledge Provider'.

Please gudie me regarding this.

1 ACCEPTED SOLUTION
Read only

Jelena_Perfiljeva
Active Contributor
1,949

Go to your Basis admin, he/she will be able to resolve this error. I ran into this a couple of times and it was resolved by a Basis admin. It's not an ABAP issue.

9 REPLIES 9
Read only

Former Member
0 Likes
1,949

Hi Krishnama,

Are you passing COMMIT_WORK = 'X' to the function module SO_DOCUMENT_SEND_API1. If not try passing the same.

Regards

Bala

Read only

0 Likes
1,949

Hi Bala,

Iam passing commit work value as 'X'.

Still Iam getting Error.

Read only

0 Likes
1,949

are you getting a dump because of this? then please read the dump and check what exactly is going wrong.

Read only

Former Member
0 Likes
1,949

Hi,

Try like this

{Sample Code}

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

document_data = ws_doc_data

put_in_outbox = 'X'

sender_address = ws_sender_address

sender_address_type = ws_sender_address_type

commit_work = 'X'

IMPORTING

sent_to_all = ws_sent_all

TABLES

packing_list = i_packing_list

contents_bin = i_attachment

contents_txt = i_message

receivers = i_receivers

Regards

Krishna

Read only

0 Likes
1,949

Hi Krishna,<br>

<br>

Iam using following code. Iam getting error in mail FM with RC=6. Is there any bug in my prog.<br><br>

<pre>parameters : p_mail type AD_SMTPADR.

select-options : s_spool for TSP01-RQIDENT.

start-of-selection.

loop at s_spool.

CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'

EXPORTING

src_spoolid = s_spool-low

no_dialog = ' '

IMPORTING

pdf_bytecount = lv_numbytes

btc_jobname = lv_jobname

btc_jobcount = lv_jobcount

TABLES

pdf = lt_pdf

EXCEPTIONS

err_no_otf_spooljob = 1

err_no_spooljob = 2

err_no_permission = 3

err_conv_not_possible = 4

err_bad_dstdevice = 5

user_cancelled = 6

err_spoolerror = 7

err_temseerror = 8

err_btcjob_open_failed = 9

err_btcjob_submit_failed = 10

err_btcjob_close_failed = 11

OTHERS = 12.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

  • //Transfer the 132 bit strings to 255 bit strings.

LOOP AT lt_pdf.

TRANSLATE lt_pdf USING ' ~'.

CONCATENATE lv_buffer lt_pdf INTO lv_buffer.

ENDLOOP.

REFRESH lt_objbin.

CLEAR lw_objbin.

DO.

lw_objbin = lv_buffer.

APPEND lw_objbin TO lt_objbin.

SHIFT lv_buffer LEFT BY 255 PLACES.

IF lv_buffer IS INITIAL.

EXIT.

ENDIF.

ENDDO.

  • //Creating the Subject for the email

lv_doc_chng-obj_name = sy-repid.

lv_doc_chng-obj_descr = 'Remittance Advice'.

lv_doc_chng-sensitivty = 'O'.

WRITE sy-datum TO lv_date USING EDIT MASK '__/__/____'.

WRITE sy-uzeit TO lv_time USING EDIT MASK '__:__:__'.

CONCATENATE lv_doc_chng-obj_descr '_'

lv_date '_'

lv_time INTO lv_doc_chng-obj_descr.

  • //Email Body

CLEAR lw_objtxt.

lw_objtxt = 'Remittance Advice'.

APPEND lw_objtxt TO lt_objtxt.

CLEAR lw_objtxt.

CONCATENATE 'Date:' lv_date INTO lw_objtxt SEPARATED BY space.

  • "Date

APPEND lw_objtxt TO lt_objtxt.

CLEAR lw_objtxt.

CONCATENATE 'Time:' lv_time INTO lw_objtxt SEPARATED BY space.

  • "Time

APPEND lw_objtxt TO lt_objtxt.

DESCRIBE TABLE lt_objtxt LINES lv_tab_lines.

CLEAR lw_objtxt.

READ TABLE lt_objtxt

INTO lw_objtxt

INDEX lv_tab_lines.

  • //Fill the Size of the Document

lv_doc_chng-doc_size = ( lv_tab_lines - 1 ) * 255 +

STRLEN( lw_objtxt ).

  • //Create the entry for the Compressed document for Header.

REFRESH lt_objpack.

CLEAR lw_objpack.

lw_objpack-head_start = 1.

lw_objpack-head_num = 0.

lw_objpack-body_start = 1.

lw_objpack-body_num = lv_tab_lines.

lw_objpack-doc_type = 'RAW'.

APPEND lw_objpack TO lt_objpack.

  • //Get the size of the Actual PDF Document

CLEAR lv_tab_lines.

DESCRIBE TABLE lt_objbin LINES lv_tab_lines.

lw_objhead = lv_doc_chng-obj_descr.

APPEND lw_objhead TO lt_objhead.

  • //Create the entry for the Compressed document for the PDF

CLEAR lw_objpack.

lw_objpack-transf_bin = 'X'.

lw_objpack-head_start = 1.

lw_objpack-head_num = 1.

lw_objpack-body_start = 1.

lw_objpack-body_num = lv_tab_lines.

lw_objpack-doc_type = 'PDF'.

lw_objpack-obj_name = 'ATTACHMENT'.

APPEND lw_objpack TO lt_objpack.

  • //Create the Recipient's Data

CLEAR lw_reclist.

REFRESH lt_reclist.

lw_reclist-receiver = p_mail.

lw_reclist-rec_type = 'U'.

APPEND lw_reclist TO lt_reclist.

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

document_data = lv_doc_chng

put_in_outbox = 'X'

commit_work = 'X'

TABLES

packing_list = lt_objpack

object_header = lt_objhead

contents_bin = lt_objbin

contents_txt = lt_objtxt

receivers = lt_reclist

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 <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.</pre><br><br>

Regards <br>

Krishna

Edited by: Matt on Aug 14, 2009 5:11 PM - fixed formatting

Read only

Jelena_Perfiljeva
Active Contributor
1,950

Go to your Basis admin, he/she will be able to resolve this error. I ran into this a couple of times and it was resolved by a Basis admin. It's not an ABAP issue.

Read only

0 Likes
1,949

Hello Jelena,

We are having the same issue, but our BASIS guys closed the incident as they said we should tell them what to correct. Could you tell me if you still remember, what did the BASIS Admin do to solve this issue?

Thank you,

Iuliana

Read only

Former Member
0 Likes
1,949

refer the following blogs

/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface

Read only

0 Likes
1,949

Hi,

Got the same error while attaching file with the mail in ECC


System error when accessing Knowledge Provider



I found that DB in DMS server had issue. it has been cleared once I repaired it.


Regards,

pandiyaraj jayaprakash