<?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: Calling the Logon Function from ASP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-the-logon-function-from-asp/m-p/3583454#M862709</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;Pls try the attached code. I hope it will solve your queries.&lt;/P&gt;&lt;P&gt;======================================================================&lt;/P&gt;&lt;P&gt;Public theFunc&lt;/P&gt;&lt;P&gt;Public con As&lt;/P&gt;&lt;P&gt;Public functionCtrl&lt;/P&gt;&lt;P&gt;Dim returnFunc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set functionCtrl = CreateObject("SAP.Functions")&lt;/P&gt;&lt;P&gt;Set sapConnection = CreateObject("SAP.Logoncontrol.1")&lt;/P&gt;&lt;P&gt;Set sapConnection = sapConnection.NewConnection&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Pass the name of the system&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;sapConnection.System = "SDS"&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Pass the name of the Server&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;sapConnection.ApplicationServer = "192.168.60.111" '"/H/210.212.164.82/W/cmatrix/H/192.168.225.2"&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Pass the name of the Client&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;sapConnection.client = '800&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Pass the name of the USER&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;sapConnection.user = "DEVELOPer"&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Pass the name of the Password&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;sapConnection.Password = "ABAP"&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Pass the name of the Language&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;sapConnection.language = "EN"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Log On to the SAP System&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;Set functionCtrl = server.CreateObject("SAP.Functions")&lt;/P&gt;&lt;P&gt; retcd=oConn.Logon(0,true)&lt;/P&gt;&lt;P&gt; If RetCd = False Then&lt;/P&gt;&lt;P&gt;   Response.write "SAP Logon Failed."&lt;/P&gt;&lt;P&gt;   Response.Write "&amp;lt;A href='admin.asp'&amp;gt;" &amp;amp; "Login Again" &amp;amp; "&amp;lt;/A&amp;gt;"&lt;/P&gt;&lt;P&gt;   Response.End&lt;/P&gt;&lt;P&gt; else&lt;/P&gt;&lt;P&gt;   Response.write "SAP Logon Succeeded."&lt;/P&gt;&lt;P&gt; end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;functionCtrl.Connection = oConn&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Give the name of RFC Function&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;Set theFunc = functionCtrl.Add("ZCNPL_MATR_STK")&lt;/P&gt;&lt;P&gt;theFunc.Exports("MATNR") = "HS1400BRN"&lt;/P&gt;&lt;P&gt;theFunc.Exports("WERKS") = "BWWA"&lt;/P&gt;&lt;P&gt;theFunc.Exports("LGORT") = "NMOD"&lt;/P&gt;&lt;P&gt;returnFunc = theFunc.Call&lt;/P&gt;&lt;P&gt;If returnFunc = True Then&lt;/P&gt;&lt;P&gt;    'Give the Name of Table parameter in RFC Function&lt;/P&gt;&lt;P&gt; Set docs = theFunc.tables.Item("MAT_STK_TAB")&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Write The Out Put&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;for i = 1 to docs.rows.count&lt;/P&gt;&lt;P&gt; for each oCol  in docs.columns&lt;/P&gt;&lt;P&gt;  response.write oCol.value(i)&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;Reward if found helpful...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Varishtah.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 30 Mar 2008 10:01:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-30T10:01:45Z</dc:date>
    <item>
      <title>Calling the Logon Function from ASP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-the-logon-function-from-asp/m-p/3583453#M862708</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;I am using RFC/BAPI from ASP to connect to the SAP system and perform certain functions. I am having problems passing the logon parameters implicitly from the ASP code. Can you guys help me in passing the logon parameters so the user does not have to fill up the logon details everytime he connects. I do not want the popup window for Logon to appear at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Mar 2008 06:33:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-the-logon-function-from-asp/m-p/3583453#M862708</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-29T06:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calling the Logon Function from ASP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-the-logon-function-from-asp/m-p/3583454#M862709</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;Pls try the attached code. I hope it will solve your queries.&lt;/P&gt;&lt;P&gt;======================================================================&lt;/P&gt;&lt;P&gt;Public theFunc&lt;/P&gt;&lt;P&gt;Public con As&lt;/P&gt;&lt;P&gt;Public functionCtrl&lt;/P&gt;&lt;P&gt;Dim returnFunc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set functionCtrl = CreateObject("SAP.Functions")&lt;/P&gt;&lt;P&gt;Set sapConnection = CreateObject("SAP.Logoncontrol.1")&lt;/P&gt;&lt;P&gt;Set sapConnection = sapConnection.NewConnection&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Pass the name of the system&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;sapConnection.System = "SDS"&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Pass the name of the Server&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;sapConnection.ApplicationServer = "192.168.60.111" '"/H/210.212.164.82/W/cmatrix/H/192.168.225.2"&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Pass the name of the Client&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;sapConnection.client = '800&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Pass the name of the USER&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;sapConnection.user = "DEVELOPer"&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Pass the name of the Password&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;sapConnection.Password = "ABAP"&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Pass the name of the Language&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;sapConnection.language = "EN"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Log On to the SAP System&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;Set functionCtrl = server.CreateObject("SAP.Functions")&lt;/P&gt;&lt;P&gt; retcd=oConn.Logon(0,true)&lt;/P&gt;&lt;P&gt; If RetCd = False Then&lt;/P&gt;&lt;P&gt;   Response.write "SAP Logon Failed."&lt;/P&gt;&lt;P&gt;   Response.Write "&amp;lt;A href='admin.asp'&amp;gt;" &amp;amp; "Login Again" &amp;amp; "&amp;lt;/A&amp;gt;"&lt;/P&gt;&lt;P&gt;   Response.End&lt;/P&gt;&lt;P&gt; else&lt;/P&gt;&lt;P&gt;   Response.write "SAP Logon Succeeded."&lt;/P&gt;&lt;P&gt; end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;functionCtrl.Connection = oConn&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Give the name of RFC Function&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;Set theFunc = functionCtrl.Add("ZCNPL_MATR_STK")&lt;/P&gt;&lt;P&gt;theFunc.Exports("MATNR") = "HS1400BRN"&lt;/P&gt;&lt;P&gt;theFunc.Exports("WERKS") = "BWWA"&lt;/P&gt;&lt;P&gt;theFunc.Exports("LGORT") = "NMOD"&lt;/P&gt;&lt;P&gt;returnFunc = theFunc.Call&lt;/P&gt;&lt;P&gt;If returnFunc = True Then&lt;/P&gt;&lt;P&gt;    'Give the Name of Table parameter in RFC Function&lt;/P&gt;&lt;P&gt; Set docs = theFunc.tables.Item("MAT_STK_TAB")&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;'Write The Out Put&lt;/P&gt;&lt;P&gt;'**************************************&lt;/P&gt;&lt;P&gt;for i = 1 to docs.rows.count&lt;/P&gt;&lt;P&gt; for each oCol  in docs.columns&lt;/P&gt;&lt;P&gt;  response.write oCol.value(i)&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;Reward if found helpful...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Varishtah.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Mar 2008 10:01:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-the-logon-function-from-asp/m-p/3583454#M862709</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-30T10:01:45Z</dc:date>
    </item>
  </channel>
</rss>

