<?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: flat file in http folder in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672577#M297074</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can run the VB script on any PC where the SAP Gateway and SDK have been installed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on a project where we use vbscript and ASP to extract data from SAP and use it on the intranet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the VB-Script in an excel or word document and also on a webpage. The example below I have used in a excel spreadsheet (use a macro to call the subroutine).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example below retrieves a list of vendors.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;VBScript to list vendors from SAP table LFA1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub GetTable()&lt;/P&gt;&lt;P&gt;'Logon&lt;/P&gt;&lt;P&gt;Dim sapConn As Object 'Declare variant&lt;/P&gt;&lt;P&gt;Set sapConn = CreateObject("SAP.Functions") 'Create ActiveX object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If sapConn.Connection.Logon(0, False) &amp;lt;&amp;gt; True Then 'Try Logon&lt;/P&gt;&lt;P&gt;   MsgBox "Cannot Log on to SAP"&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;'Define function&lt;/P&gt;&lt;P&gt;Dim objRfcFunc As Object&lt;/P&gt;&lt;P&gt;Set objRfcFunc = sapConn.Add("RFC_READ_TABLE")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Set import parameters&lt;/P&gt;&lt;P&gt;Dim objQueryTab, objRowCount As Object&lt;/P&gt;&lt;P&gt;'Table name&lt;/P&gt;&lt;P&gt;Set objQueryTab = objRfcFunc.Exports("QUERY_TABLE")&lt;/P&gt;&lt;P&gt;objQueryTab.Value = "LFA1"&lt;/P&gt;&lt;P&gt;'Set max nr of rows&lt;/P&gt;&lt;P&gt;Set objRowCount = objRfcFunc.Exports("ROWCOUNT")&lt;/P&gt;&lt;P&gt;objRowCount.Value = "10"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Set table parameters&lt;/P&gt;&lt;P&gt;Dim objOptTab, objFldTab, objDatTab As Object&lt;/P&gt;&lt;P&gt;Set objOptTab = objRfcFunc.Tables("OPTIONS")&lt;/P&gt;&lt;P&gt;Set objFldTab = objRfcFunc.Tables("FIELDS")&lt;/P&gt;&lt;P&gt;Set objDatTab = objRfcFunc.Tables("DATA")&lt;/P&gt;&lt;P&gt;'First we set the condition&lt;/P&gt;&lt;P&gt;objOptTab.FreeTable    'Refresh table&lt;/P&gt;&lt;P&gt;'Then set values where statement (TEXT field in table parameter OPTIONS)&lt;/P&gt;&lt;P&gt;objOptTab.Rows.Add&lt;/P&gt;&lt;P&gt;objOptTab(objOptTab.RowCount, "TEXT") = "KTOKK = 'HSUB' and "&lt;/P&gt;&lt;P&gt;objOptTab.Rows.Add&lt;/P&gt;&lt;P&gt;objOptTab(objOptTab.RowCount, "TEXT") = "ORT01 = 'London'"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Next we set fields to obtain (fields we want to retrieve from the table)&lt;/P&gt;&lt;P&gt;objFldTab.FreeTable    'Refresh table&lt;/P&gt;&lt;P&gt;'Then set values (FIELDNAME field in table parameter FIELDS)&lt;/P&gt;&lt;P&gt;objFldTab.Rows.Add&lt;/P&gt;&lt;P&gt;objFldTab(objFldTab.RowCount, "FIELDNAME") = "LIFNR"  'vendor nr&lt;/P&gt;&lt;P&gt;objFldTab.Rows.Add&lt;/P&gt;&lt;P&gt;objFldTab(objFldTab.RowCount, "FIELDNAME") = "NAME1"  'vendor name&lt;/P&gt;&lt;P&gt;objFldTab.Rows.Add&lt;/P&gt;&lt;P&gt;objFldTab(objFldTab.RowCount, "FIELDNAME") = "ORT01"  'city&lt;/P&gt;&lt;P&gt;objFldTab.Rows.Add&lt;/P&gt;&lt;P&gt;objFldTab(objFldTab.RowCount, "FIELDNAME") = "ADRNR"  'address nr&lt;/P&gt;&lt;P&gt;objFldTab.Rows.Add&lt;/P&gt;&lt;P&gt;objFldTab(objFldTab.RowCount, "FIELDNAME") = "ERNAM"  'user who created the vendor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If objRfcFunc.Call = False Then&lt;/P&gt;&lt;P&gt;   MsgBox objRfcFunc.Exception&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim objDatRec As Object&lt;/P&gt;&lt;P&gt;Dim objFldRec As Object&lt;/P&gt;&lt;P&gt;For Each objDatRec In objDatTab.Rows&lt;/P&gt;&lt;P&gt;   For Each objFldRec In objFldTab.Rows&lt;/P&gt;&lt;P&gt;      Cells(objDatRec.Index, objFldRec.Index) = Mid(objDatRec("WA"), objFldRec("OFFSET") + 1, objFldRec("LENGTH"))&lt;/P&gt;&lt;P&gt;   Next&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Oct 2006 13:31:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-31T13:31:33Z</dc:date>
    <item>
      <title>flat file in http folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672573#M297070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is there anyway of downloading a flat file into a folder in some http address rather than the application server or local directory.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sukumar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2006 17:11:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672573#M297070</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-26T17:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: flat file in http folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672574#M297071</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;Have you tried by FTP?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2006 17:32:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672574#M297071</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-26T17:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: flat file in http folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672575#M297072</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;Instead of saving the flatfile from sap on a http address or fileserver you could use a scripting language for example vbscript to extract the data from SAP and store it as a flatfile from your webserver or any other computer with the gateway installed on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want I can give you an example of a vb script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dennis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2006 17:44:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672575#M297072</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-26T17:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: flat file in http folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672576#M297073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is a vb script where do we have to execute it. And please do send me a sample code too.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sukumar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: sukumar kumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2006 18:07:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672576#M297073</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-26T18:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: flat file in http folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672577#M297074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can run the VB script on any PC where the SAP Gateway and SDK have been installed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on a project where we use vbscript and ASP to extract data from SAP and use it on the intranet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the VB-Script in an excel or word document and also on a webpage. The example below I have used in a excel spreadsheet (use a macro to call the subroutine).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example below retrieves a list of vendors.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;VBScript to list vendors from SAP table LFA1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub GetTable()&lt;/P&gt;&lt;P&gt;'Logon&lt;/P&gt;&lt;P&gt;Dim sapConn As Object 'Declare variant&lt;/P&gt;&lt;P&gt;Set sapConn = CreateObject("SAP.Functions") 'Create ActiveX object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If sapConn.Connection.Logon(0, False) &amp;lt;&amp;gt; True Then 'Try Logon&lt;/P&gt;&lt;P&gt;   MsgBox "Cannot Log on to SAP"&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;'Define function&lt;/P&gt;&lt;P&gt;Dim objRfcFunc As Object&lt;/P&gt;&lt;P&gt;Set objRfcFunc = sapConn.Add("RFC_READ_TABLE")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Set import parameters&lt;/P&gt;&lt;P&gt;Dim objQueryTab, objRowCount As Object&lt;/P&gt;&lt;P&gt;'Table name&lt;/P&gt;&lt;P&gt;Set objQueryTab = objRfcFunc.Exports("QUERY_TABLE")&lt;/P&gt;&lt;P&gt;objQueryTab.Value = "LFA1"&lt;/P&gt;&lt;P&gt;'Set max nr of rows&lt;/P&gt;&lt;P&gt;Set objRowCount = objRfcFunc.Exports("ROWCOUNT")&lt;/P&gt;&lt;P&gt;objRowCount.Value = "10"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Set table parameters&lt;/P&gt;&lt;P&gt;Dim objOptTab, objFldTab, objDatTab As Object&lt;/P&gt;&lt;P&gt;Set objOptTab = objRfcFunc.Tables("OPTIONS")&lt;/P&gt;&lt;P&gt;Set objFldTab = objRfcFunc.Tables("FIELDS")&lt;/P&gt;&lt;P&gt;Set objDatTab = objRfcFunc.Tables("DATA")&lt;/P&gt;&lt;P&gt;'First we set the condition&lt;/P&gt;&lt;P&gt;objOptTab.FreeTable    'Refresh table&lt;/P&gt;&lt;P&gt;'Then set values where statement (TEXT field in table parameter OPTIONS)&lt;/P&gt;&lt;P&gt;objOptTab.Rows.Add&lt;/P&gt;&lt;P&gt;objOptTab(objOptTab.RowCount, "TEXT") = "KTOKK = 'HSUB' and "&lt;/P&gt;&lt;P&gt;objOptTab.Rows.Add&lt;/P&gt;&lt;P&gt;objOptTab(objOptTab.RowCount, "TEXT") = "ORT01 = 'London'"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Next we set fields to obtain (fields we want to retrieve from the table)&lt;/P&gt;&lt;P&gt;objFldTab.FreeTable    'Refresh table&lt;/P&gt;&lt;P&gt;'Then set values (FIELDNAME field in table parameter FIELDS)&lt;/P&gt;&lt;P&gt;objFldTab.Rows.Add&lt;/P&gt;&lt;P&gt;objFldTab(objFldTab.RowCount, "FIELDNAME") = "LIFNR"  'vendor nr&lt;/P&gt;&lt;P&gt;objFldTab.Rows.Add&lt;/P&gt;&lt;P&gt;objFldTab(objFldTab.RowCount, "FIELDNAME") = "NAME1"  'vendor name&lt;/P&gt;&lt;P&gt;objFldTab.Rows.Add&lt;/P&gt;&lt;P&gt;objFldTab(objFldTab.RowCount, "FIELDNAME") = "ORT01"  'city&lt;/P&gt;&lt;P&gt;objFldTab.Rows.Add&lt;/P&gt;&lt;P&gt;objFldTab(objFldTab.RowCount, "FIELDNAME") = "ADRNR"  'address nr&lt;/P&gt;&lt;P&gt;objFldTab.Rows.Add&lt;/P&gt;&lt;P&gt;objFldTab(objFldTab.RowCount, "FIELDNAME") = "ERNAM"  'user who created the vendor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If objRfcFunc.Call = False Then&lt;/P&gt;&lt;P&gt;   MsgBox objRfcFunc.Exception&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim objDatRec As Object&lt;/P&gt;&lt;P&gt;Dim objFldRec As Object&lt;/P&gt;&lt;P&gt;For Each objDatRec In objDatTab.Rows&lt;/P&gt;&lt;P&gt;   For Each objFldRec In objFldTab.Rows&lt;/P&gt;&lt;P&gt;      Cells(objDatRec.Index, objFldRec.Index) = Mid(objDatRec("WA"), objFldRec("OFFSET") + 1, objFldRec("LENGTH"))&lt;/P&gt;&lt;P&gt;   Next&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Oct 2006 13:31:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672577#M297074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-31T13:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: flat file in http folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672578#M297075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Oct 2006 18:12:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672578#M297075</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-31T18:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: flat file in http folder</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672579#M297076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad to be of help and thanks for awarding the points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Nov 2006 14:12:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-in-http-folder/m-p/1672579#M297076</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-01T14:12:05Z</dc:date>
    </item>
  </channel>
</rss>

