<?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: Attach a document to VA02 - Background in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/attach-a-document-to-va02-background/m-p/11351281#M1921451</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thales,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you say file will come to SAP via RFC in a lraw field, what exactly do you mean? Iraw field contains file data or file path? if it contains file data, then is there any field that contains file path as well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You simply have to follow three steps&lt;/P&gt;&lt;P&gt;1) Identify physical location of file on SAP application server.&lt;/P&gt;&lt;P&gt;2) Convert it to the format that can uploaded as an attachment.&lt;/P&gt;&lt;P&gt;3) Call 'SO_DOCUMENT_REPOSITORY_MANAGER' as mentioned in the above link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If physical location of file could not be identified in the program &amp;amp; if you only have data, then you can simply create a file from the data and save it at a particular location on application server. Then you can pickup same file from application server and load it using same FM. Does that make sense?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Tejas Asodekar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Oct 2015 14:09:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-10-19T14:09:13Z</dc:date>
    <item>
      <title>Attach a document to VA02 - Background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attach-a-document-to-va02-background/m-p/11351279#M1921449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really need your help. I have a scenario where I have to attach a PDF document to VA02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to make it work in dialog mode, but in my scenario I have to make it work in background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The file will come to SAP via RFC in a lraw field. Then I have to get this file and attach it to VA02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the guide I used to make it work in dialog mode. &lt;A __default_attr="125435" __jive_macro_name="blogpost" class="jive_macro jive_macro_blogpost" data-orig-content=" Attach File to Standard Trasaction VA02 Using Function Module SO_DOCUMENT_REPOSITORY_MANAGER " href="https://community.sap.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks ! If you need any more information, please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obs.: My problem is running in background. Any option is welcome. Save the file to a unix folder and upload, or read it straight from the table and attach, etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thales Schmidt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 13:20:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attach-a-document-to-va02-background/m-p/11351279#M1921449</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-10-19T13:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Attach a document to VA02 - Background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attach-a-document-to-va02-background/m-p/11351280#M1921450</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;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;You can try this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use &lt;SPAN style="color: #404040; text-align: justify; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;STRONG&gt;SO_SOLIXTAB_TO_SOLITAB &lt;/STRONG&gt;to convert your RAW data do SOLITAB.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;Use FM &lt;SPAN style="color: #404040; text-align: justify;"&gt;&lt;STRONG&gt;SO_CONVERT_CONTENTS_BIN&lt;/STRONG&gt; to convert your binary data&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;Use FM &lt;SPAN style="color: #404040; text-align: justify;"&gt;&lt;STRONG&gt;SO_FOLDER_ROOT_ID_GET&lt;/STRONG&gt; to get your folder root data&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;Compile your objdata like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #404040; text-align: justify; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;ls_obj_data-objsns = 'O'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #404040; font-family: calibri, verdana, arial, sans-serif; font-size: 12pt; text-align: justify;"&gt;ls_obj_data-objla = sy-langu.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #404040; font-family: calibri, verdana, arial, sans-serif; font-size: 12pt; text-align: justify;"&gt;ls_obj_data-objdes = p_desc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #404040; font-family: calibri, verdana, arial, sans-serif; font-size: 12pt; text-align: justify;"&gt;lv_offset = STRLEN( p_file ) - 3.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #404040; font-family: calibri, verdana, arial, sans-serif; font-size: 12pt; text-align: justify;"&gt;ls_obj_data-file_ext = p_file+lv_offset(3).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #404040; text-align: justify; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;ls_obj_data-objlen = LINES( it_content ) * 255.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #404040; font-family: 'Lucida Grande', Verdana, Tahoma, Arial, sans-serif; font-size: 10.08px; text-align: justify;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #404040; font-family: 'Lucida Grande', Verdana, Tahoma, Arial, sans-serif; font-size: 10.08px; text-align: justify;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #404040; font-family: 'Lucida Grande', Verdana, Tahoma, Arial, sans-serif; font-size: 10.08px; text-align: justify;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-align: justify; color: #404040; font-size: 10.08px; font-family: 'Lucida Grande', Verdana, Tahoma, Arial, sans-serif;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 16px;"&gt;Call FM &lt;/SPAN&gt;&lt;STRONG style=": ; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;SO_OBJECT_INSERT&lt;/STRONG&gt;&amp;nbsp; &lt;SPAN style="color: #404040; font-family: calibri, verdana, arial, sans-serif; font-size: 16px; text-align: justify;"&gt;to feed your object attachment.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-align: justify; color: #404040; font-size: 16px; font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-align: justify; color: #404040; font-size: 16px; font-family: calibri, verdana, arial, sans-serif;"&gt;With folder data from SD_FOLDER_ROOT_ID_GET, call &lt;SPAN style="color: #404040; text-align: justify; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;STRONG&gt;BINARY_RELATION_CREATE_COMMIT &lt;/STRONG&gt;to generate link between attachment and document&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-align: justify; color: #404040; font-size: 16px; font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-align: justify; color: #404040; font-size: 16px; font-family: calibri, verdana, arial, sans-serif;"&gt;You should get your goal.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-align: justify; color: #404040; font-size: 16px; font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-align: justify; color: #404040; font-size: 16px; font-family: calibri, verdana, arial, sans-serif;"&gt;Hope to help&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-align: justify; color: #404040; font-size: 16px; font-family: calibri, verdana, arial, sans-serif;"&gt;Bye&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 14:07:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attach-a-document-to-va02-background/m-p/11351280#M1921450</guid>
      <dc:creator>roberto_vacca2</dc:creator>
      <dc:date>2015-10-19T14:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Attach a document to VA02 - Background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attach-a-document-to-va02-background/m-p/11351281#M1921451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thales,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you say file will come to SAP via RFC in a lraw field, what exactly do you mean? Iraw field contains file data or file path? if it contains file data, then is there any field that contains file path as well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You simply have to follow three steps&lt;/P&gt;&lt;P&gt;1) Identify physical location of file on SAP application server.&lt;/P&gt;&lt;P&gt;2) Convert it to the format that can uploaded as an attachment.&lt;/P&gt;&lt;P&gt;3) Call 'SO_DOCUMENT_REPOSITORY_MANAGER' as mentioned in the above link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If physical location of file could not be identified in the program &amp;amp; if you only have data, then you can simply create a file from the data and save it at a particular location on application server. Then you can pickup same file from application server and load it using same FM. Does that make sense?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Tejas Asodekar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 14:09:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attach-a-document-to-va02-background/m-p/11351281#M1921451</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-10-19T14:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Attach a document to VA02 - Background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attach-a-document-to-va02-background/m-p/11351282#M1921452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks ! It's solved !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 16:40:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attach-a-document-to-va02-background/m-p/11351282#M1921452</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-10-19T16:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Attach a document to VA02 - Background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/attach-a-document-to-va02-background/m-p/11351283#M1921453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Old post, but just for anyone looking at this going forward, the object length is calculated incorrectly and you might get corrupt files this way. When you calculate the length don't just take the number of lines * 255 as the last line might not (and most likely won't) have a length of 255. So use : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_obj_data-objlen&amp;nbsp;&amp;nbsp;&amp;nbsp; = ( lines( it_content ) - 1 ) * 255 + strlen( it_content[ lines( it_content ) ]-line ).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2016 22:40:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/attach-a-document-to-va02-background/m-p/11351283#M1921453</guid>
      <dc:creator>wouter_venhuizen2</dc:creator>
      <dc:date>2016-09-08T22:40:00Z</dc:date>
    </item>
  </channel>
</rss>

