<?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: Pass data to excel file using dataset in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109083#M738166</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. I don't think there is any directy way,&lt;/P&gt;&lt;P&gt;to rad .XLS file&lt;/P&gt;&lt;P&gt;into internal table&lt;/P&gt;&lt;P&gt;on the application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. The reason is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) .XLS is a Microsoft technology&lt;/P&gt;&lt;P&gt;b) the application server OS may not be microsoft os,&lt;/P&gt;&lt;P&gt;it may be UNIX, AIX etc.&lt;/P&gt;&lt;P&gt;c) Converter tehnology is not there,&lt;/P&gt;&lt;P&gt;and possibly SAP does not support it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. FILE_READ_AND_CONVERT_SAP_DATA&lt;/P&gt;&lt;P&gt;This FM, &lt;/P&gt;&lt;P&gt;can read files from applicatin server&lt;/P&gt;&lt;P&gt;in TXT and other formats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. BUT, in case of .XLS file,&lt;/P&gt;&lt;P&gt;it EXPECTS the file to be on the presentation server only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(bcos Microsoft OS be there on presentation server)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. IN SAP,&lt;/P&gt;&lt;P&gt;people don't work directly with .xls file&lt;/P&gt;&lt;P&gt;while uploading data.&lt;/P&gt;&lt;P&gt;We need to work with TEXT Files&lt;/P&gt;&lt;P&gt;which are TAB DELIMITED or CSV files etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Nov 2007 07:33:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-20T07:33:36Z</dc:date>
    <item>
      <title>Pass data to excel file using dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109080#M738163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to save the data in background excel file using datasets.&lt;/P&gt;&lt;P&gt;Can u give me an example how i can do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2007 07:26:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109080#M738163</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-20T07:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Pass data to excel file using dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109081#M738164</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;Check the below example program :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: d1 type localfile default&lt;/P&gt;&lt;P&gt;'/usr/sap/TST/SYS/Test.txt'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;field1(20) type c,&lt;/P&gt;&lt;P&gt;field2(20) type c,&lt;/P&gt;&lt;P&gt;field3(20) type c,&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;data: str type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;constants: con_tab type x value '09'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if you have a newer version, then you can use this&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;instead.&lt;/P&gt;&lt;P&gt;*constants:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;con_tab type c value&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;cl_abap_char_utilities=&amp;gt;HORIZONTAL_TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-field1 = 'ABC'.&lt;/P&gt;&lt;P&gt;itab-field2 = 'DEF'.&lt;/P&gt;&lt;P&gt;itab-field3 = 'GHI'.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-field1 = '123'.&lt;/P&gt;&lt;P&gt;itab-field2 = '456'.&lt;/P&gt;&lt;P&gt;itab-field3 = '789'.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open dataset d1 for output in text mode.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;translate itab using ' # '.&lt;/P&gt;&lt;P&gt;concatenate itab-field1 itab-field2 itab-field2&lt;/P&gt;&lt;P&gt;into str&lt;/P&gt;&lt;P&gt;separated by con_tab.&lt;/P&gt;&lt;P&gt;translate str using ' # '.&lt;/P&gt;&lt;P&gt;transfer str to d1.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;close dataset d1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN IT IN BACKGROUND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REWARD IF USEFULL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2007 07:30:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109081#M738164</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-20T07:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Pass data to excel file using dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109082#M738165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;If report is running into background than you can only save your file to Application server. So, to download file on application server you need to use the OPEN DATASET, TRANSFER, CLOSE DATASET syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once file is createed to server, you can make one small program which can read the file and stores it to the presentation server.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2007 07:32:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109082#M738165</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-20T07:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Pass data to excel file using dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109083#M738166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. I don't think there is any directy way,&lt;/P&gt;&lt;P&gt;to rad .XLS file&lt;/P&gt;&lt;P&gt;into internal table&lt;/P&gt;&lt;P&gt;on the application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. The reason is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) .XLS is a Microsoft technology&lt;/P&gt;&lt;P&gt;b) the application server OS may not be microsoft os,&lt;/P&gt;&lt;P&gt;it may be UNIX, AIX etc.&lt;/P&gt;&lt;P&gt;c) Converter tehnology is not there,&lt;/P&gt;&lt;P&gt;and possibly SAP does not support it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. FILE_READ_AND_CONVERT_SAP_DATA&lt;/P&gt;&lt;P&gt;This FM, &lt;/P&gt;&lt;P&gt;can read files from applicatin server&lt;/P&gt;&lt;P&gt;in TXT and other formats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. BUT, in case of .XLS file,&lt;/P&gt;&lt;P&gt;it EXPECTS the file to be on the presentation server only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(bcos Microsoft OS be there on presentation server)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. IN SAP,&lt;/P&gt;&lt;P&gt;people don't work directly with .xls file&lt;/P&gt;&lt;P&gt;while uploading data.&lt;/P&gt;&lt;P&gt;We need to work with TEXT Files&lt;/P&gt;&lt;P&gt;which are TAB DELIMITED or CSV files etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2007 07:33:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109083#M738166</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-20T07:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Pass data to excel file using dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109084#M738167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;Download in Background in Excel Format&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Download from background is possible, if you could setup the environment &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. create a custom table first &lt;/P&gt;&lt;P&gt;Table : Y001 &lt;/P&gt;&lt;P&gt;Displayed fields: 4 of 4 Fixed columns: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MANDT BNAME Y_SITE Y_PATH &lt;/P&gt;&lt;P&gt;010 &amp;lt;userid&amp;gt; &amp;lt;site&amp;gt; cd &amp;lt;novell_path&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. rewrite ws_download to z_download (light modification required, see attachment) &lt;/P&gt;&lt;P&gt;3. ask your basis team to make a copy of command FTP and CHMOD to ZFTP and ZCHMOD resp., make the setting according to your environment. &lt;/P&gt;&lt;P&gt;1 *----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------------------" /&gt;&lt;P&gt;2 * Changed By : &lt;/P&gt;&lt;P&gt;3 * Changed On : &lt;/P&gt;&lt;P&gt;4 * Changed : NOVELL directory path based on SAP login id.&lt;/P&gt;&lt;P&gt;5 *----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------------------" /&gt;&lt;P&gt;6 TABLES: Y001. &lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;8 CONSTANTS: C_PATH(14) VALUE '/home/ftpuser/'.&lt;/P&gt;&lt;P&gt;9&lt;/P&gt;&lt;P&gt;10 DATA: BEGIN OF C_TAB,&lt;/P&gt;&lt;P&gt;11 X(1) TYPE X VALUE '09',&lt;/P&gt;&lt;P&gt;12 END OF C_TAB.&lt;/P&gt;&lt;P&gt;13&lt;/P&gt;&lt;P&gt;14 DATA: BUFFER(8000),&lt;/P&gt;&lt;P&gt;15 FIELDNAME_OFFSET TYPE I,&lt;/P&gt;&lt;P&gt;16 * FULLPATH(128),&lt;/P&gt;&lt;P&gt;17 FULLPATH LIKE SXPGCOLIST-PARAMETERS,&lt;/P&gt;&lt;P&gt;18 * CMDFULLPATH(128),&lt;/P&gt;&lt;P&gt;19 CMDFULLPATH LIKE SXPGCOLIST-PARAMETERS,&lt;/P&gt;&lt;P&gt;20 CMD(40),&lt;/P&gt;&lt;P&gt;21 IBTCXPM LIKE BTCXPM OCCURS 0.&lt;/P&gt;&lt;P&gt;22&lt;/P&gt;&lt;P&gt;23 FUNCTION Z_DOWNLOAD.&lt;/P&gt;&lt;P&gt;24 *"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;25 &lt;STRONG&gt;"&lt;/STRONG&gt;"Local interface:&lt;/P&gt;&lt;P&gt;26 *" IMPORTING&lt;/P&gt;&lt;P&gt;27 *" VALUE(FILENAME)&lt;/P&gt;&lt;P&gt;28 *" VALUE(LOCATION)&lt;/P&gt;&lt;P&gt;29 *" TABLES&lt;/P&gt;&lt;P&gt;30 *" DATA_TAB&lt;/P&gt;&lt;P&gt;31 *" FIELDNAMES OPTIONAL&lt;/P&gt;&lt;P&gt;32 *"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;33&lt;/P&gt;&lt;P&gt;34 DATA: WS_LINE TYPE I.&lt;/P&gt;&lt;P&gt;35&lt;/P&gt;&lt;P&gt;36 FIELD-SYMBOLS: &amp;lt;F&amp;gt;.&lt;/P&gt;&lt;P&gt;37&lt;/P&gt;&lt;P&gt;38 CHECK NOT FILENAME IS INITIAL.&lt;/P&gt;&lt;P&gt;39&lt;/P&gt;&lt;P&gt;40 CONCATENATE C_PATH FILENAME INTO FULLPATH.&lt;/P&gt;&lt;P&gt;41 OPEN DATASET FULLPATH IN TEXT MODE FOR OUTPUT.&lt;/P&gt;&lt;P&gt;42&lt;/P&gt;&lt;P&gt;43 DESCRIBE TABLE FIELDNAMES LINES WS_LINE.&lt;/P&gt;&lt;P&gt;44 IF WS_LINE NE 0.&lt;/P&gt;&lt;P&gt;45 PERFORM FIELDNAMES_2_BUFFER TABLES FIELDNAMES CHANGING BUFFER.&lt;/P&gt;&lt;P&gt;46 FIELDNAME_OFFSET = STRLEN( BUFFER ).&lt;/P&gt;&lt;P&gt;47 TRANSFER BUFFER TO FULLPATH LENGTH FIELDNAME_OFFSET.&lt;/P&gt;&lt;P&gt;48 ENDIF.&lt;/P&gt;&lt;P&gt;49&lt;/P&gt;&lt;P&gt;50 LOOP AT DATA_TAB.&lt;/P&gt;&lt;P&gt;51 CLEAR BUFFER.&lt;/P&gt;&lt;P&gt;52 CLEAR FIELDNAME_OFFSET.&lt;/P&gt;&lt;P&gt;53 DO.&lt;/P&gt;&lt;P&gt;54 ASSIGN COMPONENT SY-INDEX OF STRUCTURE DATA_TAB TO &amp;lt;F&amp;gt;.&lt;/P&gt;&lt;P&gt;55 IF SY-SUBRC NE 0. EXIT. ENDIF.&lt;/P&gt;&lt;P&gt;56 WRITE &amp;lt;F&amp;gt; TO BUFFER+FIELDNAME_OFFSET.&lt;/P&gt;&lt;P&gt;57 CONDENSE BUFFER.&lt;/P&gt;&lt;P&gt;58 FIELDNAME_OFFSET = STRLEN( BUFFER ).&lt;/P&gt;&lt;P&gt;59 WRITE C_TAB TO BUFFER+FIELDNAME_OFFSET(1).&lt;/P&gt;&lt;P&gt;60 ADD 1 TO FIELDNAME_OFFSET.&lt;/P&gt;&lt;P&gt;61 ENDDO.&lt;/P&gt;&lt;P&gt;62 TRANSFER BUFFER TO FULLPATH LENGTH FIELDNAME_OFFSET.&lt;/P&gt;&lt;P&gt;63 ENDLOOP.&lt;/P&gt;&lt;P&gt;64&lt;/P&gt;&lt;P&gt;65 CLOSE DATASET FULLPATH.&lt;/P&gt;&lt;P&gt;66&lt;/P&gt;&lt;P&gt;67 CALL FUNCTION 'SXPG_COMMAND_EXECUTE'&lt;/P&gt;&lt;P&gt;68 EXPORTING&lt;/P&gt;&lt;P&gt;69 COMMANDNAME = 'ZCHMOD'&lt;/P&gt;&lt;P&gt;70 ADDITIONAL_PARAMETERS = FULLPATH&lt;/P&gt;&lt;P&gt;71 TABLES&lt;/P&gt;&lt;P&gt;72 EXEC_PROTOCOL = IBTCXPM&lt;/P&gt;&lt;P&gt;73 EXCEPTIONS&lt;/P&gt;&lt;P&gt;74 NO_PERMISSION = 1&lt;/P&gt;&lt;P&gt;75 COMMAND_NOT_FOUND = 2&lt;/P&gt;&lt;P&gt;76 PARAMETERS_TOO_LONG = 3&lt;/P&gt;&lt;P&gt;77 SECURITY_RISK = 4&lt;/P&gt;&lt;P&gt;78 WRONG_CHECK_CALL_INTERFACE = 5&lt;/P&gt;&lt;P&gt;79 PROGRAM_START_ERROR = 6&lt;/P&gt;&lt;P&gt;80 PROGRAM_TERMINATION_ERROR = 7&lt;/P&gt;&lt;P&gt;81 X_ERROR = 8&lt;/P&gt;&lt;P&gt;82 PARAMETER_EXPECTED = 9&lt;/P&gt;&lt;P&gt;83 TOO_MANY_PARAMETERS = 10&lt;/P&gt;&lt;P&gt;84 ILLEGAL_COMMAND = 11&lt;/P&gt;&lt;P&gt;85 WRONG_ASYNCHRONOUS_PARAMETERS = 12&lt;/P&gt;&lt;P&gt;86 CANT_ENQ_TBTCO_ENTRY = 13&lt;/P&gt;&lt;P&gt;87 JOBCOUNT_GENERATION_ERROR = 14&lt;/P&gt;&lt;P&gt;88 OTHERS = 15.&lt;/P&gt;&lt;P&gt;89&lt;/P&gt;&lt;P&gt;90 CONCATENATE C_PATH FILENAME '_cmd' INTO CMDFULLPATH.&lt;/P&gt;&lt;P&gt;91 OPEN DATASET CMDFULLPATH IN TEXT MODE FOR OUTPUT.&lt;/P&gt;&lt;P&gt;92 CASE LOCATION. "location A, B, C, D on a network&lt;/P&gt;&lt;P&gt;93 WHEN 'A '.&lt;/P&gt;&lt;P&gt;94 &lt;/P&gt;&lt;P&gt;95 TRANSFER 'open xx.xxx.xx.xx' TO CMDFULLPATH. &lt;/P&gt;&lt;P&gt;96 TRANSFER 'user sapftp &amp;lt;pwd&amp;gt;' TO CMDFULLPATH. &lt;/P&gt;&lt;P&gt;97 WHEN 'B '. &lt;/P&gt;&lt;P&gt;98 TRANSFER 'open xx.xxx.xx.xx' TO CMDFULLPATH. &lt;/P&gt;&lt;P&gt;99 TRANSFER 'user sapftp &amp;lt;pwd&amp;gt;' TO CMDFULLPATH. &lt;/P&gt;&lt;P&gt;100 when 'C '.&lt;/P&gt;&lt;P&gt;101 TRANSFER 'open xx.xxx.xx.xx' TO CMDFULLPATH.&lt;/P&gt;&lt;P&gt;102 TRANSFER 'user sapftp &amp;lt;pwd&amp;gt;' TO CMDFULLPATH.&lt;/P&gt;&lt;P&gt;103 when 'D '.&lt;/P&gt;&lt;P&gt;104 TRANSFER 'open xx.xxx.xx.xx' TO CMDFULLPATH.&lt;/P&gt;&lt;P&gt;105 TRANSFER 'user sapftp &amp;lt;pwd&amp;gt;' TO CMDFULLPATH.&lt;/P&gt;&lt;P&gt;106 WHEN OTHERS.&lt;/P&gt;&lt;P&gt;107 ENDCASE.&lt;/P&gt;&lt;P&gt;108 &lt;/P&gt;&lt;P&gt;109 &lt;/P&gt;&lt;P&gt;110 &lt;/P&gt;&lt;P&gt;111 &lt;/P&gt;&lt;P&gt;112 *start&amp;gt;&lt;/P&gt;&lt;P&gt;113 CLEAR Y001.&lt;/P&gt;&lt;P&gt;114 SELECT SINGLE Y_PATH INTO Y001-Y_PATH&lt;/P&gt;&lt;P&gt;115 FROM Y001 WHERE BNAME = SY-UNAME&lt;/P&gt;&lt;P&gt;116 AND Y_SITE = LOCATION. &lt;/P&gt;&lt;P&gt;117 TRANSFER Y001-Y_PATH TO CMDFULLPATH.&lt;/P&gt;&lt;P&gt;118 *&amp;lt;end&lt;/P&gt;&lt;P&gt;119 CONCATENATE 'lcd' C_PATH INTO CMD SEPARATED BY SPACE.&lt;/P&gt;&lt;P&gt;120 TRANSFER CMD TO CMDFULLPATH.&lt;/P&gt;&lt;P&gt;121 CLEAR CMD.&lt;/P&gt;&lt;P&gt;122 CONCATENATE 'put' FILENAME INTO CMD SEPARATED BY SPACE.&lt;/P&gt;&lt;P&gt;123 TRANSFER CMD TO CMDFULLPATH.&lt;/P&gt;&lt;P&gt;124 TRANSFER 'bye' TO CMDFULLPATH.&lt;/P&gt;&lt;P&gt;125 CLOSE DATASET CMDFULLPATH.&lt;/P&gt;&lt;P&gt;126&lt;/P&gt;&lt;P&gt;127 CALL FUNCTION 'SXPG_COMMAND_EXECUTE'&lt;/P&gt;&lt;P&gt;128 EXPORTING&lt;/P&gt;&lt;P&gt;129 COMMANDNAME = 'ZCHMOD'&lt;/P&gt;&lt;P&gt;130 ADDITIONAL_PARAMETERS = CMDFULLPATH&lt;/P&gt;&lt;P&gt;131 TABLES&lt;/P&gt;&lt;P&gt;132 EXEC_PROTOCOL = IBTCXPM&lt;/P&gt;&lt;P&gt;133 EXCEPTIONS&lt;/P&gt;&lt;P&gt;134 NO_PERMISSION = 1&lt;/P&gt;&lt;P&gt;135 COMMAND_NOT_FOUND = 2&lt;/P&gt;&lt;P&gt;136 PARAMETERS_TOO_LONG = 3&lt;/P&gt;&lt;P&gt;137 SECURITY_RISK = 4&lt;/P&gt;&lt;P&gt;138 WRONG_CHECK_CALL_INTERFACE = 5&lt;/P&gt;&lt;P&gt;139 PROGRAM_START_ERROR = 6&lt;/P&gt;&lt;P&gt;140 PROGRAM_TERMINATION_ERROR = 7&lt;/P&gt;&lt;P&gt;141 X_ERROR = 8&lt;/P&gt;&lt;P&gt;142 PARAMETER_EXPECTED = 9&lt;/P&gt;&lt;P&gt;143 TOO_MANY_PARAMETERS = 10&lt;/P&gt;&lt;P&gt;144 ILLEGAL_COMMAND = 11&lt;/P&gt;&lt;P&gt;145 WRONG_ASYNCHRONOUS_PARAMETERS = 12&lt;/P&gt;&lt;P&gt;146 CANT_ENQ_TBTCO_ENTRY = 13&lt;/P&gt;&lt;P&gt;147 JOBCOUNT_GENERATION_ERROR = 14&lt;/P&gt;&lt;P&gt;148 OTHERS = 15.&lt;/P&gt;&lt;P&gt;149&lt;/P&gt;&lt;P&gt;150 CALL FUNCTION 'SXPG_COMMAND_EXECUTE'&lt;/P&gt;&lt;P&gt;151 EXPORTING&lt;/P&gt;&lt;P&gt;152 COMMANDNAME = 'ZFTP'&lt;/P&gt;&lt;P&gt;153 ** commandname = 'ZFTP'&lt;/P&gt;&lt;P&gt;154 ADDITIONAL_PARAMETERS = CMDFULLPATH&lt;/P&gt;&lt;P&gt;155 TABLES&lt;/P&gt;&lt;P&gt;156 EXEC_PROTOCOL = IBTCXPM&lt;/P&gt;&lt;P&gt;157 EXCEPTIONS&lt;/P&gt;&lt;P&gt;158 NO_PERMISSION = 1&lt;/P&gt;&lt;P&gt;159 COMMAND_NOT_FOUND = 2&lt;/P&gt;&lt;P&gt;160 PARAMETERS_TOO_LONG = 3&lt;/P&gt;&lt;P&gt;161 SECURITY_RISK = 4&lt;/P&gt;&lt;P&gt;162 WRONG_CHECK_CALL_INTERFACE = 5&lt;/P&gt;&lt;P&gt;163 PROGRAM_START_ERROR = 6&lt;/P&gt;&lt;P&gt;164 PROGRAM_TERMINATION_ERROR = 7&lt;/P&gt;&lt;P&gt;165 X_ERROR = 8&lt;/P&gt;&lt;P&gt;166 PARAMETER_EXPECTED = 9&lt;/P&gt;&lt;P&gt;167 TOO_MANY_PARAMETERS = 10&lt;/P&gt;&lt;P&gt;168 ILLEGAL_COMMAND = 11&lt;/P&gt;&lt;P&gt;169 WRONG_ASYNCHRONOUS_PARAMETERS = 12&lt;/P&gt;&lt;P&gt;170 CANT_ENQ_TBTCO_ENTRY = 13&lt;/P&gt;&lt;P&gt;171 JOBCOUNT_GENERATION_ERROR = 14&lt;/P&gt;&lt;P&gt;172 OTHERS = 15.&lt;/P&gt;&lt;P&gt;173&lt;/P&gt;&lt;P&gt;174 ENDFUNCTION.&lt;/P&gt;&lt;P&gt;175&lt;/P&gt;&lt;P&gt;176 &lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;177 * FORM FIELDNAMES_2_BUFFER *&lt;/P&gt;&lt;P&gt;178 &lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;179 * ........ *&lt;/P&gt;&lt;P&gt;180 &lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;181 * --&amp;gt; FIELDNAMES *&lt;/P&gt;&lt;P&gt;182 * --&amp;gt; BUFFER *&lt;/P&gt;&lt;P&gt;183 &lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;184 FORM FIELDNAMES_2_BUFFER TABLES FIELDNAMES CHANGING BUFFER.&lt;/P&gt;&lt;P&gt;185 CLEAR BUFFER.&lt;/P&gt;&lt;P&gt;186 CLEAR FIELDNAME_OFFSET.&lt;/P&gt;&lt;P&gt;187 LOOP AT FIELDNAMES.&lt;/P&gt;&lt;P&gt;188 WRITE FIELDNAMES TO BUFFER+FIELDNAME_OFFSET.&lt;/P&gt;&lt;P&gt;189 CONDENSE BUFFER.&lt;/P&gt;&lt;P&gt;190 FIELDNAME_OFFSET = STRLEN( BUFFER ).&lt;/P&gt;&lt;P&gt;191 WRITE C_TAB TO BUFFER+FIELDNAME_OFFSET(1).&lt;/P&gt;&lt;P&gt;192 ADD 1 TO FIELDNAME_OFFSET.&lt;/P&gt;&lt;P&gt;193 ENDLOOP.&lt;/P&gt;&lt;P&gt;194 FIELDNAME_OFFSET = FIELDNAME_OFFSET - 1.&lt;/P&gt;&lt;P&gt;195 IF FIELDNAME_OFFSET &amp;gt;= 0.&lt;/P&gt;&lt;P&gt;196 WRITE SPACE TO BUFFER+FIELDNAME_OFFSET(1).&lt;/P&gt;&lt;P&gt;197 ENDIF.&lt;/P&gt;&lt;P&gt;198 ENDFORM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2007 07:33:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109084#M738167</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-20T07:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Pass data to excel file using dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109085#M738168</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;Do like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;OPEN DATASET filename1 FOR OUTPUT IN TEXT MODE.
IF SY-SUBRC = 0.
 LOOP AT &amp;lt;b&amp;gt;itab1&amp;lt;/b&amp;gt; into &amp;lt;b&amp;gt;wa_itab&amp;lt;/b&amp;gt;.
  TRANSFER &amp;lt;b&amp;gt;wa_itab&amp;lt;/b&amp;gt; TO filename1.
  IF SY-SUBRC &amp;lt;&amp;gt; 0.
   EXIT.
  ENDIF.
 ENDLOOP.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this link to download to excel&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3127617"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward Points if this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Satish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2007 07:37:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109085#M738168</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-20T07:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Pass data to excel file using dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109086#M738169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to pass the data to the excel file from an internal table which have so many columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2007 09:00:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109086#M738169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-20T09:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Pass data to excel file using dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109087#M738170</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;If you want to save a excel file in a background process you have to save your file to the aplication server.&lt;/P&gt;&lt;P&gt;In aplication server you can´t use the usual FM to convert data to XLS because those FMs use the SAP GUI. So you have to save you data with OPEN DATASET, writting a file that Excel can understand. I sugest that you take a look at these links:&lt;/P&gt;&lt;P&gt;/people/sergio.ferrari2/blog/2006/06/12/spreadsheet-integration--which-approach-for-which-sap-technology&lt;/P&gt;&lt;P&gt;/people/sergio.ferrari2/blog/2006/06/11/downloading-data-into-excel-with-format-options-from-sap-web-applications&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2007 10:18:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109087#M738170</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-20T10:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Pass data to excel file using dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109088#M738171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi thanks &lt;/P&gt;&lt;P&gt;its working&lt;/P&gt;&lt;P&gt;after data download if we save/send file in excel format then data in separated by column .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Aug 2010 16:52:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-data-to-excel-file-using-dataset/m-p/3109088#M738171</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-10T16:52:44Z</dc:date>
    </item>
  </channel>
</rss>

