<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Upload and attach existing document using CL_DOCUMENT_BCS in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-and-attach-existing-document-using-cl-document-bcs/m-p/2982187#M704098</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to upload an existing excel document to my email.  When I was exploring the CL_DOCUMENT_BCS class I found the method ADD_DOCUMENT_AS_ATTACHMENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is will this method work the way I think it will work, upload the file and attach to the email, or do I need another function/method to upload the file?  And how do you use the method?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Oct 2007 07:02:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-31T07:02:05Z</dc:date>
    <item>
      <title>Upload and attach existing document using CL_DOCUMENT_BCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-and-attach-existing-document-using-cl-document-bcs/m-p/2982187#M704098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to upload an existing excel document to my email.  When I was exploring the CL_DOCUMENT_BCS class I found the method ADD_DOCUMENT_AS_ATTACHMENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is will this method work the way I think it will work, upload the file and attach to the email, or do I need another function/method to upload the file?  And how do you use the method?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2007 07:02:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-and-attach-existing-document-using-cl-document-bcs/m-p/2982187#M704098</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-31T07:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Upload and attach existing document using CL_DOCUMENT_BCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-and-attach-existing-document-using-cl-document-bcs/m-p/2982188#M704099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Used FM SO_DOCUMENT_REPOSITORY_MANAGER.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 13:09:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-and-attach-existing-document-using-cl-document-bcs/m-p/2982188#M704099</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T13:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Upload and attach existing document using CL_DOCUMENT_BCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-and-attach-existing-document-using-cl-document-bcs/m-p/2982189#M704100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Used FM SO_DOCUMENT_REPOSITORY_MANAGER.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 13:10:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-and-attach-existing-document-using-cl-document-bcs/m-p/2982189#M704100</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T13:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Upload and attach existing document using CL_DOCUMENT_BCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-and-attach-existing-document-using-cl-document-bcs/m-p/2982190#M704101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I too have a same requirement. Can u please elaborate how did u achieved this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to attach an existing document&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2008 09:05:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-and-attach-existing-document-using-cl-document-bcs/m-p/2982190#M704101</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-07T09:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Upload and attach existing document using CL_DOCUMENT_BCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-and-attach-existing-document-using-cl-document-bcs/m-p/2982191#M704102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; REPORT ZSEND_ATTACH. * This program will allow you to send email with attachment without dialog. CONSTANTS: c_cr(1) TYPE c VALUE cl_abap_char_utilities=&amp;gt;cr_lf. " Line Feed for End-Of_line data gv_method like sy-ucomm. data gs_user like soudnamei1. data gs_user_data like soudatai1. data gv_owner like soud-usrnam. data gi_receivers like soos1 occurs 0 with header line. data gs_document like sood4 . data gs_header like sood2. data gi_objcnt like soli occurs 0 with header line. data gi_objhead like soli occurs 0 with header line. data gi_objpara like selc occurs 0 with header line. data gi_objparb like soop1 occurs 0 with header line. data gi_attachm like sood5 occurs 0 with header line. data gi_references like soxrl occurs 0 with header line. data gv_authority like sofa-usracc. data gs_ref_document like sood4. data gs_new_parent like soodk. data gs_folder_id like SOODK. data gs_order_id like SOODK. data gv_fold_number(12) type c. data gv_fold_yr(2) type c. data gv_fold_type(3) type c. data gv_pfile like rlgrap-filename. data: begin of gi_files occurs 10, text(4096), end of gi_files. * selection-screen----------------------------------------------------* parameters: p_file like rlgrap-filename obligatory. at selection-screen on value-request for p_file. *---------------------------------------------------------------------* * search file call function 'WS_FILENAME_GET' EXPORTING def_filename = p_file def_path = 'c:' mask = '*.csv,*.csv.' mode = 'O' title = 'CSV file serach' IMPORTING filename = gv_pfile EXCEPTIONS inv_winsys = 01 no_batch = 02 selection_cancel = 03 selection_error = 04. if sy-subrc = 0. p_file = gv_pfile. endif. start-OF-SELECTION. *--------------------------------------------------------------------- gs_user-sapname = sy-uname. call function 'SO_USER_READ_API1' EXPORTING user = gs_user IMPORTING user_data = gs_user_data. gv_fold_type = gs_user_data-outboxfol+0(3). gv_fold_yr = gs_user_data-outboxfol+3(2). gv_fold_number = gs_user_data-outboxfol+5(12). clear gi_files. refresh : gi_objcnt, gi_objhead, gi_objpara, gi_objparb, gi_receivers, gi_attachm, gi_references, gi_files. gi_objcnt-line = 'Mail message'. append gi_objcnt. clear gi_objcnt. concatenate c_cr space into gi_objcnt-line. append gi_objcnt. clear gi_objcnt. concatenate c_cr 'Regards Léon Hoeneveld' into gi_objcnt-line. append gi_objcnt. clear gi_objcnt. gs_document-foltp = gv_fold_type. gs_document-folyr = gv_fold_yr. gs_document-folno = gv_fold_number. gs_document-objtp = gs_user_data-object_typ. gs_document-objdes = 'Mailsubject'. gs_document-folrg = 'O'. gs_document-objlen = '0'. gs_document-file_ext = 'TXT'. gs_header-objla = 'NL'. gs_header-objnam = gs_document-objnam. gs_header-objdes = gs_document-objdes. gs_header-objpri = '5'. gs_header-objsns = 'O'. gs_header-file_ext = 'TXT'. gv_method = 'SAVE'. call function 'SO_DOCUMENT_REPOSITORY_MANAGER' exporting method = gv_method office_user = sy-uname ref_document = gs_ref_document new_parent = gs_new_parent importing authority = gv_authority tables objcont = gi_objcnt objhead = gi_objhead objpara = gi_objpara objparb = gi_objparb recipients = gi_receivers attachments = gi_attachm references = gi_references files = gi_files changing document = gs_document header_data = gs_header. * File from the pc to send... gv_method = 'ATTCREATEFROMPC'. gi_files-text = p_file. append gi_files. call function 'SO_DOCUMENT_REPOSITORY_MANAGER' EXPORTING method = gv_method office_user = gv_owner ref_document = gs_ref_document new_parent = gs_new_parent IMPORTING authority = gv_authority TABLES objcont = gi_objcnt objhead = gi_objhead objpara = gi_objpara objparb = gi_objparb recipients = gi_receivers attachments = gi_attachm references = gi_references files = gi_files CHANGING document = gs_document header_data = gs_header. gs_folder_id-objtp = gv_fold_type. gs_folder_id-objyr = gv_fold_yr. gs_folder_id-objno = gv_fold_number. gs_order_id-objtp = gs_document-OBJTP. gs_order_id-objyr = gs_document-objyr. gs_order_id-objno = gs_document-objno. "gi_receivers-recnam = 'USERNAME'. gi_receivers-recextnam = . "gi_receivers-recesc = 'B'. gi_receivers-recesc = 'U'. gi_receivers-sndex = 'X'. append gi_receivers. CALL FUNCTION 'SO_OBJECT_SEND' EXPORTING FOLDER_ID = gs_folder_id OBJECT_ID = gs_order_id "OUTBOX_FLAG = 'X' TABLES objcont = gi_objcnt objhead = gi_objhead objpara = gi_objpara objparb = gi_objparb RECEIVERS = gi_receivers EXCEPTIONS ACTIVE_USER_NOT_EXIST = 1 COMMUNICATION_FAILURE = 2 COMPONENT_NOT_AVAILABLE = 3 FOLDER_NOT_EXIST = 4 FOLDER_NO_AUTHORIZATION = 5 FORWARDER_NOT_EXIST = 6 NOTE_NOT_EXIST = 7 OBJECT_NOT_EXIST = 8 OBJECT_NOT_SENT = 9 OBJECT_NO_AUTHORIZATION = 10 OBJECT_TYPE_NOT_EXIST = 11 OPERATION_NO_AUTHORIZATION = 12 OWNER_NOT_EXIST = 13 PARAMETER_ERROR = 14 SUBSTITUTE_NOT_ACTIVE = 15 SUBSTITUTE_NOT_DEFINED = 16 SYSTEM_FAILURE = 17 TOO_MUCH_RECEIVERS = 18 USER_NOT_EXIST = 19 ORIGINATOR_NOT_EXIST = 20 X_ERROR = 21 OTHERS = 22. IF SY-SUBRC 0. write: sy-subrc. ENDIF. commit work. WAIT UP TO 2 SECONDS. SUBMIT rsconn01 WITH mode = 'INT' "WITH output = 'X' AND RETURN. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2009 13:31:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-and-attach-existing-document-using-cl-document-bcs/m-p/2982191#M704102</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-21T13:31:13Z</dc:date>
    </item>
  </channel>
</rss>

