Application Development 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: 

Send FAX with PDF attachments issue

0 Kudos
758

Hello,

I have the same issue for sending the fax with PDF attachment.

I create the document, attachments and sends via BCS class, but i got the following issue:

No delivery to <fax number>, as part of message cannot be transferred

Message no. XS811

Diagnosis

The message could not be delivered to recipient 6504612397 as part of the message could not be transferred.

System Response

Processing was ended normally.

Additional information of the node used (in the system language of the node):

Procedure

Part of the message could not be transported all the way to recipient <fax number>. This is usually due to particular binary attachments. Check the message and remove oversized attachments and attachments that require special coding, for example.

The following is my code:

lr_send_request = cl_bcs=>create_persistent( ).

lr_document = cl_document_bcs=>create_document(

i_type = gc_doc_type_raw

i_text = it_message_body

i_subject = iv_subject ).

  • Get attachments

PERFORM get_attachments USING it_invoice_send

CHANGING lt_attachments

et_invoice_no_pdf.

*Add attachments

LOOP AT lt_attachments INTO ls_attachment.

lv_attachment_subject = ls_attachment-subject.

TRY.

lr_document->add_attachment(

EXPORTING

i_attachment_type = ls_attachment-doc_type

i_attachment_subject = lv_attachment_subject

i_att_content_hex = ls_attachment-cont_hex ).

CATCH cx_document_bcs INTO lx_document_bcs.

MESSAGE e005(zzfi_coll_enh) RAISING add_attachment_failed.

ENDTRY.

ENDLOOP.

lr_send_request->set_document( lr_document ).

lr_sender = cl_sapuser_bcs=>create( sy-uname ).

lr_send_request->set_sender( lr_sender ).

lr_recipient = cl_cam_address_bcs=>create_fax_address(

i_country = iv_fax_country

i_number = iv_fax_number ).

lr_send_request->add_recipient(

EXPORTING

i_recipient = lr_recipient

i_express = gc_flg_x ).

lr_send_request->send(

EXPORTING

i_with_error_screen = gc_flg_x

RECEIVING

result = ev_result ).

COMMIT WORK.

Thanks,

Ivy

1 ACCEPTED SOLUTION

Former Member
0 Kudos
392

Hi,

Please check program BCS_EXAMPLE_6. I guess you would have to do something similar to achieve the functionality you desire. Important point to note is the following code, that converts the pdf contents to corrrect SOLIX format.

  • get PDF xstring and convert it to BCS format

lp_pdf_size = XSTRLEN( ls_formoutput-pdf ).

pdf_content = cl_document_bcs=>xstring_to_solix(

ip_xstring = ls_formoutput-pdf ).

document = cl_document_bcs=>create_document(

i_type = 'PDF'

i_hex = pdf_content

i_length = lp_pdf_size

i_subject = 'test created by BCS_EXAMPLE_6' ). "#EC NOTEXT

Regards,

Shyam

10 REPLIES 10

0 Kudos
392

Hi all,

Could you help me solve this issue?

Thanks

Former Member
0 Kudos
393

Hi,

Please check program BCS_EXAMPLE_6. I guess you would have to do something similar to achieve the functionality you desire. Important point to note is the following code, that converts the pdf contents to corrrect SOLIX format.

  • get PDF xstring and convert it to BCS format

lp_pdf_size = XSTRLEN( ls_formoutput-pdf ).

pdf_content = cl_document_bcs=>xstring_to_solix(

ip_xstring = ls_formoutput-pdf ).

document = cl_document_bcs=>create_document(

i_type = 'PDF'

i_hex = pdf_content

i_length = lp_pdf_size

i_subject = 'test created by BCS_EXAMPLE_6' ). "#EC NOTEXT

Regards,

Shyam

0 Kudos
392

Hi,

I use the following function module to get the PDF data.

and the type of lt_data is solix_tab, so i didn't use the covert method (xstring_to_solix)

CALL FUNCTION 'SCMS_HTTP_GET'

EXPORTING

crep_id = ls_toa02-archiv_id

doc_id = ls_toa02-arc_doc_id

comp_id = gc_comp_id_data

TABLES

data = lt_data

EXCEPTIONS

bad_request = 1

unauthorized = 2

not_found = 3

conflict = 4

internal_server_error = 5

error_http = 6

error_url = 7

error_signature = 8

OTHERS = 9.

Thanks a lot !

0 Kudos
392

Hi Shyam,

I run into another issue.

I will get 2 cover sheet and 1 document content after i sent the fax, the first cover sheet 1 is created by RightFax service, and the other cover sheet 2 is created by SAP automatically.

We need to get rid of the document content page, and move those information to cover sheet 2, but i checked the cover sheet 2, the subject field lenght is too short to fill the document content, or we fill the document content to cover sheet 1 which created by RightFax.

Could you tell me how to transfer the information from SAP to RightFax cover sheet?

or if we can change the cover sheet template, when we use class CL_BCS to send fax?

Thanks and Best Regards,

Ivy Lu

0 Kudos
392

Who can help me? Thanks a lot

0 Kudos
392

Hi Ivy,

I did a similar thing to send dcument to FAX as type 'PDF'. from SOST I'm able to open the PDF as well. But the Outgoing FAX still fails with the message 'No Delivery as part of the message cannot be transferred'.

How are you sending PDF to FAX in SAP ?

0 Kudos
392

Hi Phani,

Could you please let us know your code? I used the following code to solve my issue.

get PDF xstring and convert it to BCS format 

    lp_pdf_size = XSTRLEN( ls_formoutput-pdf ).

    pdf_content = cl_document_bcs=>xstring_to_solix(

        ip_xstring = ls_formoutput-pdf ).

    document = cl_document_bcs=>create_document(

          i_type    = 'PDF'

          i_hex     = pdf_content

          i_length  = lp_pdf_size

          i_subject = 'test created by BCS_EXAMPLE_6' ). "#EC NOTEXT

Best Regards,

Ivy

0 Kudos
392

Hi Ivy,

Actually, our PDF is stored in DMS.

1) We read it in binary data( SOLIX ).

2) we CALL METHOD CL_BCS_CONVERT=>SOLIX_TO_XSTRING to convert it to XSTRING & then get the SIZE.

3) Now we add attachment using:

CALL METHOD document->add_attachment

       EXPORTING

         i_attachment_type    = 'PDF'

         i_attachment_subject = 'test_doc'

         i_attachment_size    = SIZE

         i_att_content_hex    = lt_table.( SOLIX )

So, this adds PDF to fax & Fax request goes in SOST, we are able to see the PDF in attachments & also open it directly to see content. But when we select the Fax item & execute send Fax, it still fails with error 'No Delivery as part of the message cannot be transferred'.

Previously we were sending attachment as type 'BIN' with SOLIX PDF content. Now even after we send it appropriately as PDF (& we are able to open the PDF in SOST ), transmission still fails.

Still some issue wth code or can be some Fax Server issue?

Thanks alot again for your help.

0 Kudos
392

Please ask your basis to check if the Fax Server has the license to send PDF?

0 Kudos
392

Ivy,

Did you manage to fix the cover sheets issue?  We are using RightFax with SAP too. I could get the fax to send out OK with an attachment and was able to get rid of cover page but set the setting in RightFax itself.  I am currently trying to find a way to get rid of the extra page which has only the words "Attached Document" on it coming in right before the attached file.  Any idea how to get rid of that extra page?

Thanks,

Jib