<?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 Embedding Image in Appointment in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/embedding-image-in-appointment/m-p/8236765#M1629663</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my requirement, I have to send an appointment with image as attachment, embedded (in display mode). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for creating document, I am using CL_DOCUMENT_BCS  class, inside that class  i am using&lt;/P&gt;&lt;P&gt;CREATE_FROM_MULTIRELATED method for creating the document. In this method we have to pass below object lo_mime_helper. Before passing it, I am filling it with image and appointment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For image:&lt;/P&gt;&lt;P&gt;  CALL METHOD lo_mime_helper-&amp;gt;add_binary_part&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      content      = i_graphic_table&lt;/P&gt;&lt;P&gt;      filename     = 'WIPRO.BMP'&lt;/P&gt;&lt;P&gt;      extension    = 'BMP'&lt;/P&gt;&lt;P&gt;      description  = 'descriptiongif'&lt;/P&gt;&lt;P&gt;      content_type = 'image/bmp'&lt;/P&gt;&lt;P&gt;      length       = l_len&lt;/P&gt;&lt;P&gt;      content_id   = 'content_id_1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For appointment&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_sr_title = 'Invitaion for the Meeting'.&lt;/P&gt;&lt;P&gt;clear lt_text.&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;create document as an ica l object&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  lt_text = lo_appointment-&amp;gt;as_ical_object( ).&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'SO_RAW_INT_TO_RTF'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      objcont_old = lt_text&lt;/P&gt;&lt;P&gt;      objcont_new = lt_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data wa_text like line of lt_text.&lt;/P&gt;&lt;P&gt;  data text_length type i.&lt;/P&gt;&lt;P&gt;  data full_length type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at lt_text INTO wa_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     text_length = strlen( wa_text ).&lt;/P&gt;&lt;P&gt;     full_length = full_length + text_length.&lt;/P&gt;&lt;P&gt;     clear text_length.&lt;/P&gt;&lt;P&gt;     CLEAR wa_text.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear l_len.&lt;/P&gt;&lt;P&gt;l_len = full_length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD lo_mime_helper-&amp;gt;add_textual_part&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      content      = lt_text&lt;/P&gt;&lt;P&gt;      filename     = 'Appointment Meeting'&lt;/P&gt;&lt;P&gt;      extension    = 'ICS'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     description  =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      content_type = 'application/rtf'&lt;/P&gt;&lt;P&gt;      LENGTH       = l_len&lt;/P&gt;&lt;P&gt;      content_id   = 'content_id_2'&lt;/P&gt;&lt;P&gt;      .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am passing lo_mime_helper to methofd for creating document&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   TRY.&lt;/P&gt;&lt;P&gt;      CALL METHOD cl_document_bcs=&amp;gt;create_from_multirelated&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          i_subject          = 'my subject'&lt;/P&gt;&lt;P&gt;          i_multirel_service = lo_mime_helper&lt;/P&gt;&lt;P&gt;        RECEIVING&lt;/P&gt;&lt;P&gt;          result             = document.&lt;/P&gt;&lt;P&gt;    CATCH cx_document_bcs .&lt;/P&gt;&lt;P&gt;      MESSAGE e672(so) WITH 'bcs error while creating bcs_doc'.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    CATCH cx_bcom_mime .&lt;/P&gt;&lt;P&gt;      MESSAGE e672(so) WITH 'mime error while creating bcs_doc'.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THis is sending a mail, but both image and appointment are going as attachment, even when I am setting Disposition type as I(Inline) in debugger. I want it to go as appointment with image embedded in body part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I am using CL_APPOINTMENT class, its going as appointment perfectly, but how to embedd a image in body part then.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Oct 2011 07:39:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-10-10T07:39:38Z</dc:date>
    <item>
      <title>Embedding Image in Appointment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/embedding-image-in-appointment/m-p/8236765#M1629663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my requirement, I have to send an appointment with image as attachment, embedded (in display mode). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for creating document, I am using CL_DOCUMENT_BCS  class, inside that class  i am using&lt;/P&gt;&lt;P&gt;CREATE_FROM_MULTIRELATED method for creating the document. In this method we have to pass below object lo_mime_helper. Before passing it, I am filling it with image and appointment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For image:&lt;/P&gt;&lt;P&gt;  CALL METHOD lo_mime_helper-&amp;gt;add_binary_part&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      content      = i_graphic_table&lt;/P&gt;&lt;P&gt;      filename     = 'WIPRO.BMP'&lt;/P&gt;&lt;P&gt;      extension    = 'BMP'&lt;/P&gt;&lt;P&gt;      description  = 'descriptiongif'&lt;/P&gt;&lt;P&gt;      content_type = 'image/bmp'&lt;/P&gt;&lt;P&gt;      length       = l_len&lt;/P&gt;&lt;P&gt;      content_id   = 'content_id_1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For appointment&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_sr_title = 'Invitaion for the Meeting'.&lt;/P&gt;&lt;P&gt;clear lt_text.&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;create document as an ica l object&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  lt_text = lo_appointment-&amp;gt;as_ical_object( ).&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'SO_RAW_INT_TO_RTF'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      objcont_old = lt_text&lt;/P&gt;&lt;P&gt;      objcont_new = lt_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data wa_text like line of lt_text.&lt;/P&gt;&lt;P&gt;  data text_length type i.&lt;/P&gt;&lt;P&gt;  data full_length type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at lt_text INTO wa_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     text_length = strlen( wa_text ).&lt;/P&gt;&lt;P&gt;     full_length = full_length + text_length.&lt;/P&gt;&lt;P&gt;     clear text_length.&lt;/P&gt;&lt;P&gt;     CLEAR wa_text.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear l_len.&lt;/P&gt;&lt;P&gt;l_len = full_length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD lo_mime_helper-&amp;gt;add_textual_part&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      content      = lt_text&lt;/P&gt;&lt;P&gt;      filename     = 'Appointment Meeting'&lt;/P&gt;&lt;P&gt;      extension    = 'ICS'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     description  =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      content_type = 'application/rtf'&lt;/P&gt;&lt;P&gt;      LENGTH       = l_len&lt;/P&gt;&lt;P&gt;      content_id   = 'content_id_2'&lt;/P&gt;&lt;P&gt;      .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am passing lo_mime_helper to methofd for creating document&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   TRY.&lt;/P&gt;&lt;P&gt;      CALL METHOD cl_document_bcs=&amp;gt;create_from_multirelated&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          i_subject          = 'my subject'&lt;/P&gt;&lt;P&gt;          i_multirel_service = lo_mime_helper&lt;/P&gt;&lt;P&gt;        RECEIVING&lt;/P&gt;&lt;P&gt;          result             = document.&lt;/P&gt;&lt;P&gt;    CATCH cx_document_bcs .&lt;/P&gt;&lt;P&gt;      MESSAGE e672(so) WITH 'bcs error while creating bcs_doc'.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    CATCH cx_bcom_mime .&lt;/P&gt;&lt;P&gt;      MESSAGE e672(so) WITH 'mime error while creating bcs_doc'.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THis is sending a mail, but both image and appointment are going as attachment, even when I am setting Disposition type as I(Inline) in debugger. I want it to go as appointment with image embedded in body part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I am using CL_APPOINTMENT class, its going as appointment perfectly, but how to embedd a image in body part then.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2011 07:39:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/embedding-image-in-appointment/m-p/8236765#M1629663</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-10T07:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Embedding Image in Appointment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/embedding-image-in-appointment/m-p/8236766#M1629664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi try with this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Document = cl_document_bcs=&amp;gt;create_document( i_type = u2018RAWu2019 i_text =&lt;/P&gt;&lt;P&gt;text i_length = u201912u2032 i_subject = u2018test created u2018 ).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;add attachment to Document&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;BCS expects Document content here e.g. from Document upload&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;binary_content = u2026&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL METHOD Document-&amp;gt;add_attachment EXPORTING i_attachment_type = u2018GIFu2019&lt;/P&gt;&lt;P&gt;i_attachment_subject = u2018My attachmentu2019 i_att_content_hex =&lt;/P&gt;&lt;P&gt;binary_content.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;add Document to send request&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL METHOD send_request-&amp;gt;set_document( Document ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: send_request TYPE REF TO cl_bcs.&lt;/P&gt;&lt;P&gt;DATA: text TYPE bcsy_text.&lt;/P&gt;&lt;P&gt;data: binary_content1 type STANDARD table OF TBL1024 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;data: binary_content type solix_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: Document TYPE REF TO cl_document_bcs.&lt;/P&gt;&lt;P&gt;DATA: sender TYPE REF TO cl_sapuser_bcs.&lt;/P&gt;&lt;P&gt;DATA: recipient TYPE REF TO if_recipient_bcs.&lt;/P&gt;&lt;P&gt;DATA: bcs_exception type ref to cx_bcs.&lt;/P&gt;&lt;P&gt;data: sent_to_all type os_boolean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;send_request = cl_bcs=&amp;gt;create_persistent( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sender = cl_sapuser_bcs=&amp;gt;create( sy-uname ).&lt;/P&gt;&lt;P&gt;CALL METHOD send_request-&amp;gt;set_sender EXPORTING i_sender = sender.&lt;/P&gt;&lt;P&gt;recipient =&lt;/P&gt;&lt;P&gt;cl_cam_address_bcs=&amp;gt;create_internet_address( u2018 u2018 )&lt;/P&gt;&lt;P&gt;CALL METHOD send_request-&amp;gt;add_recipient&lt;/P&gt;&lt;P&gt;EXPORTING i_recipient = recipient&lt;/P&gt;&lt;P&gt;i_express = u2018Xu2019.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD send_request-&amp;gt;set_send_immediately( u2018Xu2019 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD send_request-&amp;gt;send( exporting i_with_error_screen = u2018Xu2019&lt;/P&gt;&lt;P&gt;receiving result = sent_to_all ).&lt;/P&gt;&lt;P&gt;COMMIT WORK.endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;begging removed by moderator&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;chitra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Thomas Zloch on Nov 15, 2011 1:02 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Nov 2011 09:03:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/embedding-image-in-appointment/m-p/8236766#M1629664</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-15T09:03:16Z</dc:date>
    </item>
  </channel>
</rss>

