<?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 Re: Attachment in ABAP program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/attachment-in-abap-program/m-p/3874166#M931255</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the FM in the FG SKWV_KWUI_DOCUMENT (provided by BASIS) to do so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Saurabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jun 2008 04:20:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-24T04:20:53Z</dc:date>
    <item>
      <title>Attachment in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attachment-in-abap-program/m-p/3874165#M931254</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 want a program for attaching an excel sheet or word document in Tr Code qm03 .&lt;/P&gt;&lt;P&gt;Points would be awarded for suitable answers.&lt;/P&gt;&lt;P&gt;Its very urgent.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2008 05:19:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attachment-in-abap-program/m-p/3874165#M931254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-14T05:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Attachment in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attachment-in-abap-program/m-p/3874166#M931255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the FM in the FG SKWV_KWUI_DOCUMENT (provided by BASIS) to do so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Saurabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2008 04:20:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attachment-in-abap-program/m-p/3874166#M931255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-24T04:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Attachment in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attachment-in-abap-program/m-p/3874167#M931256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this code will help u to achieve the same. In this code I am uploading PDF file from presentation server and attaching it in lineitem level to GOS in FB02.&lt;/P&gt;&lt;P&gt;Similarly u can do the same for qm02 for a particular notification no.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  Z_GOS_DEMO_JG&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report  z_gos_demo_jg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type-pools:sbdst.&lt;/P&gt;&lt;P&gt;data: i_file type standard table of char134 initial size 0.&lt;/P&gt;&lt;P&gt;data: l_hstring(1022) type x.&lt;/P&gt;&lt;P&gt;data: l_cstring(255) type c.&lt;/P&gt;&lt;P&gt;data: w_file(134) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: wa_buffer type string.&lt;/P&gt;&lt;P&gt;data: l_classname type sbdst_classname.&lt;/P&gt;&lt;P&gt;data: i_component type sbdst_components.&lt;/P&gt;&lt;P&gt;data: w_component type bapicompon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: i_signature type sbdst_signature.&lt;/P&gt;&lt;P&gt;data: w_signature type bapisignat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: i_content type sbdst_content.&lt;/P&gt;&lt;P&gt;data: w_content type bapiconten.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_file type string.&lt;/P&gt;&lt;P&gt;data: objkey type sbdst_object_key.&lt;/P&gt;&lt;P&gt;l_file = 'C:\TEST.PDF'.&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;dummy&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method cl_gui_frontend_services=&amp;gt;gui_upload&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    filename                = l_file&lt;/P&gt;&lt;P&gt;    filetype                = 'ASC'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   has_field_separator     = SPACE&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   header_length           = 0&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   read_by_line            = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   dat_mode                = SPACE&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   codepage                = SPACE&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ignore_cerr             = ABAP_TRUE&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   replacement             = '#'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   virus_scan_profile      =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   filelength              =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   header                  =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  changing&lt;/P&gt;&lt;P&gt;    data_tab                = i_file&lt;/P&gt;&lt;P&gt;  exceptions&lt;/P&gt;&lt;P&gt;    file_open_error         = 1&lt;/P&gt;&lt;P&gt;    file_read_error         = 2&lt;/P&gt;&lt;P&gt;    no_batch                = 3&lt;/P&gt;&lt;P&gt;    gui_refuse_filetransfer = 4&lt;/P&gt;&lt;P&gt;    invalid_type            = 5&lt;/P&gt;&lt;P&gt;    no_authority            = 6&lt;/P&gt;&lt;P&gt;    unknown_error           = 7&lt;/P&gt;&lt;P&gt;    bad_data_format         = 8&lt;/P&gt;&lt;P&gt;    header_not_allowed      = 9&lt;/P&gt;&lt;P&gt;    separator_not_allowed   = 10&lt;/P&gt;&lt;P&gt;    header_too_long         = 11&lt;/P&gt;&lt;P&gt;    unknown_dp_error        = 12&lt;/P&gt;&lt;P&gt;    access_denied           = 13&lt;/P&gt;&lt;P&gt;    dp_out_of_memory        = 14&lt;/P&gt;&lt;P&gt;    disk_full               = 15&lt;/P&gt;&lt;P&gt;    dp_timeout              = 16&lt;/P&gt;&lt;P&gt;    not_supported_by_gui    = 17&lt;/P&gt;&lt;P&gt;    error_no_gui            = 18&lt;/P&gt;&lt;P&gt;    others                  = 19&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at i_file into w_file.&lt;/P&gt;&lt;P&gt;*Replacing space by ~&lt;/P&gt;&lt;P&gt;      translate w_file using '~'.&lt;/P&gt;&lt;P&gt;      concatenate wa_buffer w_file into wa_buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Replacing   ~ by space&lt;/P&gt;&lt;P&gt;    translate wa_buffer using '~'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    do.&lt;/P&gt;&lt;P&gt;      l_cstring = wa_buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  assign l_cstring to &amp;lt;dummy&amp;gt; type 'X'.&lt;/P&gt;&lt;P&gt;  check sy-subrc = 0.&lt;/P&gt;&lt;P&gt;  move &amp;lt;dummy&amp;gt; to l_hstring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;APPENDing 255 Characters as a record&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     APPEND wa_record TO i_record.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      move l_hstring to w_content-line.&lt;/P&gt;&lt;P&gt;      append w_content to i_content.&lt;/P&gt;&lt;P&gt;      shift wa_buffer left by 255 places.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     SHIFT wa_buffer LEFT BY 1022 PLACES.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      if wa_buffer is initial.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_classname = 'BSEG'.&lt;/P&gt;&lt;P&gt;objkey = '100000000018482007001'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_component-doc_count  = 1.&lt;/P&gt;&lt;P&gt;w_component-comp_count = 1.&lt;/P&gt;&lt;P&gt;w_component-comp_id  = '100000000018482007001'.&lt;/P&gt;&lt;P&gt;*W_COMPONENT-COMP_SIZE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single mimetype from toadd into w_component-mimetype&lt;/P&gt;&lt;P&gt;       where doc_type = 'PDF'.&lt;/P&gt;&lt;P&gt;append w_component to i_component.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_signature-doc_count  = 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; W_SIGNATURE-DOC_ID  = 'MESSAGE' .&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;w_signature-doc_ver_no = 2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; W_SIGNATURE-DOC_VAR_ID&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; W_SIGNATURE-DOC_VAR_TG&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;w_signature-comp_count = 1.&lt;/P&gt;&lt;P&gt;w_signature-prop_name  = 'DESCRIPTION'.&lt;/P&gt;&lt;P&gt;w_signature-prop_value = 'FILE'.&lt;/P&gt;&lt;P&gt;append w_signature to i_signature.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method cl_bds_document_set=&amp;gt;create_with_table&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   logical_system  =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    classname       = l_classname&lt;/P&gt;&lt;P&gt;    classtype       = 'BO'&lt;/P&gt;&lt;P&gt;    client          = sy-mandt&lt;/P&gt;&lt;P&gt;    components      = i_component&lt;/P&gt;&lt;P&gt;    content         = i_content&lt;/P&gt;&lt;P&gt;  changing&lt;/P&gt;&lt;P&gt;    object_key      = objkey&lt;/P&gt;&lt;P&gt;    signature       = i_signature&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   internal_error  = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   error_kpro      = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   parameter_error = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   not_authorized  = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   not_allowed     = 5&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   nothing_found   = 6&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   others          = 7&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;  commit work.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2008 06:35:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attachment-in-abap-program/m-p/3874167#M931256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-24T06:35:31Z</dc:date>
    </item>
  </channel>
</rss>

