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

about SO_DOCUMENT_REPOSITORY_MANAGER

Former Member
0 Likes
717

Dear Experts,

I have used below program to send mail.but i don't know how to cancel return receip and blank attachemnt email test.txt.

Could you please tell me how to do?

Looking forward to your reply

Many thanks.

Best regards,

Merry

http://files.cnblogs.com/flysky927/ZSENDEMAIL_V3.txt

Dear Experts,

I have used below program to send mail.but i don't know how to cancel return receip and blank attachemnt email test.txt.

Could you please tell me how to do?

Looking forward to your reply

Many thanks.

Best regards,

Merry

http://files.cnblogs.com/flysky927/ZSENDEMAIL_V3.txt

4 REPLIES 4
Read only

former_member194669
Active Contributor
0 Likes
670

Try this way , Check the block of code between START and END


FORM send_document.
  DATA: send_request       TYPE REF TO cl_bcs.
  DATA: recipient          TYPE REF TO if_recipient_bcs.
  DATA: bcs_exception      TYPE REF TO cx_bcs.
  DATA: sent_to_all        TYPE os_boolean.
  DATA: sender             TYPE REF TO cl_sapuser_bcs.
  TRY.
      send_request = cl_bcs=>create_persistent( ).
*     add document to send request
      CALL METHOD send_request->set_document( go_document ).

      recipient = cl_cam_address_bcs=>create_internet_address(
                                        p_email ).

*     add recipient with its respective attributes to send request
      CALL METHOD send_request->add_recipient
        EXPORTING
          i_recipient = recipient
          i_express   = 'X'.
"  <<<<---------<<<<<< Start
      move : 'N' to v_request_status. " N = No status get returned
      v_status = v_request_status.
      call method send_request->set_status_attributes
        exporting
          i_requested_status = v_request_status
          i_status_mail      = v_status.
"  <<<<---------<<<<<< End
*  send document
      CALL METHOD send_request->send(
        EXPORTING
          i_with_error_screen = 'X'
        RECEIVING
          result              = sent_to_all ).
      IF sent_to_all = 'X'.
        WRITE 'Document Sent Successfully'(003).
      ENDIF.

      COMMIT WORK.
    CATCH cx_bcs INTO bcs_exception.
      WRITE: 'Error Occurred.'(001).
      WRITE: 'Error Type:'(002), bcs_exception->error_type.
      EXIT.
  ENDTRY.
  WAIT UP TO 2 SECONDS.
  SUBMIT rsconn01 WITH mode = 'INT'
*                WITH output = 'X'
                AND RETURN.
ENDFORM.                    "send_document

Read only

0 Likes
670

Dear a®s ,

Thanks for you good method,i have used your method i can cancel return receipt now.

But I have below question:

1、Why i can receive two attached files , i only select one attached file ,there is blank file,how can i delete this attachment .

Looking forward to your reply

Best Regards,

Merry

Read only

0 Likes
670

Check this


 try.
        go_document = cl_document_bcs=>create_document(
                                      i_type    = 'RAW'
                                      i_text = text[]
                                      i_subject = subject ).
        if not g_attachments[] is initial.
          call method go_document->add_attachment
            exporting
              i_attachment_type    = attach_ext1 "Fill the Att extension
              i_attachment_subject = attach_name1 " Attah Name
              i_att_content_text   = g_attachments[].
        endif.

Read only

Former Member
0 Likes
670

good answer ,thank you very much.