<?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: Excel file on Application server in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-on-application-server/m-p/2053410#M423620</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;Following is some sample code I put together that will convert internal tables to a delimited format and write to the server. This is something that comes up frequently and this is the easiest way I've found to do it yet. Coding it into a function module is a good idea for easy re-use. This is very basic functionality and, of course, custom improvements, error-checking, etc., could and should be added as needed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT Z_DELIM_DEMO. 

DATA: BEGIN OF ITAB OCCURS 0, 
FIELD1(10) TYPE C, 
FIELD2(10) TYPE C, 
FIELD3(10) TYPE C, 
END OF ITAB. 
* ITAB = any internal table - fields should all be type c. 

data: EXCEL_STRING(2000) type c, 
comma(1) type c value ',', 
unixpath(80) type c. 

constants: ascii_tab type x value '09'. 

field-symbols: &amp;lt;f&amp;gt;, &amp;lt;delim&amp;gt;. 

*Assign delimiter field such as tab or comma. 
assign ASCII_tab to &amp;lt;delim&amp;gt;. 


*Assign a valid Unix path and filename. 
unixpath = '/INTERFACES/DV2/out/delimiter_test.xls'. 

*fill itab with some text. Normally, you'd pass real data. 
move 'THIS IS A TEST' TO ITAB. 
APPEND ITAB. 
MOVE 'OUTPUT WILL BE DELIMITED' TO ITAB. 
APPEND ITAB. 

*Open the dataset so we can transfer the data. 
open dataset unixpath for output in text mode. 

LOOP AT ITAB. 
DO. 
* assigns the next field in the current header to &amp;lt;f&amp;gt;. 
ASSIGN COMPONENT sy-index OF STRUCTURE ITAB TO &amp;lt;f&amp;gt;. 
IF sy-subrc &amp;lt;&amp;gt; 0. "no fields left in the header structure. 
EXIT. "exits do loop and process next record in itab 
ENDIF. 

IF sy-index = 1. "if first field in header, assign to string 
excel_string = &amp;lt;f&amp;gt;. 
ELSE. "concatenate string, delimter, next field 
CONCATENATE excel_string &amp;lt;delim&amp;gt; &amp;lt;f&amp;gt; INTO excel_string. 
ENDIF. 
ENDDO. 
* string is now delimited. Transfer to server. 
TRANSFER excel_string TO unixpath. 
ENDLOOP. 

close dataset unixpath.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 Mar 2007 16:28:15 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2007-03-17T16:28:15Z</dc:date>
    <item>
      <title>Excel file on Application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-on-application-server/m-p/2053409#M423619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can an Excel file be put on application server, I mean in 'AL11' directory path?&lt;/P&gt;&lt;P&gt;If yes, please let me knoe how it can be done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for all your time to resolve the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Jawahar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Mar 2007 13:58:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-on-application-server/m-p/2053409#M423619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-17T13:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Excel file on Application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-on-application-server/m-p/2053410#M423620</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;Following is some sample code I put together that will convert internal tables to a delimited format and write to the server. This is something that comes up frequently and this is the easiest way I've found to do it yet. Coding it into a function module is a good idea for easy re-use. This is very basic functionality and, of course, custom improvements, error-checking, etc., could and should be added as needed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT Z_DELIM_DEMO. 

DATA: BEGIN OF ITAB OCCURS 0, 
FIELD1(10) TYPE C, 
FIELD2(10) TYPE C, 
FIELD3(10) TYPE C, 
END OF ITAB. 
* ITAB = any internal table - fields should all be type c. 

data: EXCEL_STRING(2000) type c, 
comma(1) type c value ',', 
unixpath(80) type c. 

constants: ascii_tab type x value '09'. 

field-symbols: &amp;lt;f&amp;gt;, &amp;lt;delim&amp;gt;. 

*Assign delimiter field such as tab or comma. 
assign ASCII_tab to &amp;lt;delim&amp;gt;. 


*Assign a valid Unix path and filename. 
unixpath = '/INTERFACES/DV2/out/delimiter_test.xls'. 

*fill itab with some text. Normally, you'd pass real data. 
move 'THIS IS A TEST' TO ITAB. 
APPEND ITAB. 
MOVE 'OUTPUT WILL BE DELIMITED' TO ITAB. 
APPEND ITAB. 

*Open the dataset so we can transfer the data. 
open dataset unixpath for output in text mode. 

LOOP AT ITAB. 
DO. 
* assigns the next field in the current header to &amp;lt;f&amp;gt;. 
ASSIGN COMPONENT sy-index OF STRUCTURE ITAB TO &amp;lt;f&amp;gt;. 
IF sy-subrc &amp;lt;&amp;gt; 0. "no fields left in the header structure. 
EXIT. "exits do loop and process next record in itab 
ENDIF. 

IF sy-index = 1. "if first field in header, assign to string 
excel_string = &amp;lt;f&amp;gt;. 
ELSE. "concatenate string, delimter, next field 
CONCATENATE excel_string &amp;lt;delim&amp;gt; &amp;lt;f&amp;gt; INTO excel_string. 
ENDIF. 
ENDDO. 
* string is now delimited. Transfer to server. 
TRANSFER excel_string TO unixpath. 
ENDLOOP. 

close dataset unixpath.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Mar 2007 16:28:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/excel-file-on-application-server/m-p/2053410#M423620</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-03-17T16:28:15Z</dc:date>
    </item>
  </channel>
</rss>

