<?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 SAP Ans VB Connection in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-ans-vb-connection/m-p/3526033#M848290</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Friends,&lt;/P&gt;&lt;P&gt;    Pls,give some documents or sites link to connect SAP and VB&lt;/P&gt;&lt;P&gt;with step by step procedure..............Urgent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Mar 2008 10:38:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-10T10:38:50Z</dc:date>
    <item>
      <title>SAP Ans VB Connection</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-ans-vb-connection/m-p/3526033#M848290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Friends,&lt;/P&gt;&lt;P&gt;    Pls,give some documents or sites link to connect SAP and VB&lt;/P&gt;&lt;P&gt;with step by step procedure..............Urgent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 10:38:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-ans-vb-connection/m-p/3526033#M848290</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T10:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Ans VB Connection</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-ans-vb-connection/m-p/3526034#M848291</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;Form VB.NET appliaction you have two ways to connect to SAP system and execute BAPI. Either through webservices or by using NCo. Choice depends upon you appliaction requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For starting with NCo go through&lt;/P&gt;&lt;P&gt;[http://help.sap.com/saphelp_nw04s/helpdata/en/a9/4a57c1bac80e4e977d8cd9b3ecab89/frameset.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THIS IS ANOTHER WAY TO LOGIN TO SAP THROUGH VB TRY THIS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Logon with the SAPLogon control, Use an RFC call from the SAP Function&lt;/P&gt;&lt;P&gt;Control, and get the results with the SAP Table Factory Control. . .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must have SAPGui's FULL install on your machine for this to work (Or at&lt;/P&gt;&lt;P&gt;least SAPLogon and the RFC toolkit)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This VBScript example might help, it calls RFC_READ_TABLE in sap, and emails&lt;/P&gt;&lt;P&gt;the results back to a user from a selected query (In this case uses that are&lt;/P&gt;&lt;P&gt;locked out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should show you how this could work in practice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Will&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' Email Locked out SAP users details to user in a .csv file through MS&lt;/P&gt;&lt;P&gt;Exchange / CDO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim ctlTableFactory, RFC_READ_TABLE, eQUERY_TAB, tblOptions, tblData,&lt;/P&gt;&lt;P&gt;tblFields, funcControl, objConnection, ctlLogon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set objFileSystemObject = CreateObject("Scripting.FileSystemObject")&lt;/P&gt;&lt;P&gt;Set ctlLogon = CreateObject("SAP.LogonControl.1")&lt;/P&gt;&lt;P&gt;Set funcControl = CreateObject("SAP.Functions")&lt;/P&gt;&lt;P&gt;Set ctlTableFactory = CreateObject("SAP.TableFactory.1")&lt;/P&gt;&lt;P&gt;Set objWindowsScriptShell = CreateObject("WScript.Shell")&lt;/P&gt;&lt;P&gt;Set objConnection = ctlLogon.NewConnection&lt;/P&gt;&lt;P&gt;Set filOutputobjFileSystemObject.CreateTextFile("E:\SAP Scripts\LockedUsers.CSV", True)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objConnection.ApplicationServerobjWindowsScriptShel l.RegRead("HKLM\Software\AccantiaEDI\SAPServer")&lt;/P&gt;&lt;P&gt;objConnection.SystemobjWindowsScriptShell.RegRead(" HKLM\Software\AccantiaEDI\SID")&lt;/P&gt;&lt;P&gt;objConnection.SystemNumber = "00"&lt;/P&gt;&lt;P&gt;objConnection.ClientobjWindowsScriptShell.RegRead(" HKLM\Software\AccantiaEDI\SAPClient")&lt;/P&gt;&lt;P&gt;objConnection.Language = "EN"&lt;/P&gt;&lt;P&gt;objConnection.UserobjWindowsScriptShell.RegRead("HK LM\Software\AccantiaEDI\SAPSAPUser")&lt;/P&gt;&lt;P&gt;objConnection.PasswordobjWindowsScriptShell.RegRead ("HKLM\Software\AccantiaEDI\SAPSAPPassword")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;booReturn = objConnection.Logon(0, True)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If booReturn True Then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'MsgBox " Cannot log on! "&lt;/P&gt;&lt;P&gt;'MsgBox booReturn&lt;/P&gt;&lt;P&gt;filOutput.WriteLine "ERROR CALLING LOGGING INTO SAP - FAILED LOGINS&lt;/P&gt;&lt;P&gt;UNKNOWN"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stop&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'MsgBox " Logon OK."&lt;/P&gt;&lt;P&gt;funcControl.Connection = objConnection&lt;/P&gt;&lt;P&gt;Set RFC_READ_TABLE = funcControl.Add("RFC_READ_TABLE")&lt;/P&gt;&lt;P&gt;Set strExport1 = RFC_READ_TABLE.Exports("QUERY_TABLE")&lt;/P&gt;&lt;P&gt;Set strExport2 = RFC_READ_TABLE.Exports("DELIMITER")&lt;/P&gt;&lt;P&gt;Set tblOptions = RFC_READ_TABLE.Tables("OPTIONS") '&lt;/P&gt;&lt;P&gt;Set tblData = RFC_READ_TABLE.Tables("DATA") '&lt;/P&gt;&lt;P&gt;Set tblFields = RFC_READ_TABLE.Tables("FIELDS") '&lt;/P&gt;&lt;P&gt;strExport1.Value = "USR02"&lt;/P&gt;&lt;P&gt;strExport2.Value = ","&lt;/P&gt;&lt;P&gt;tblOptions.AppendRow&lt;/P&gt;&lt;P&gt;tblOptions(1, "TEXT") = "LOCNT &amp;gt; 0 OR UFLAG = 128"&lt;/P&gt;&lt;P&gt;tblFields.AppendRow&lt;/P&gt;&lt;P&gt;tblFields(1, "FIELDNAME") = "BNAME"&lt;/P&gt;&lt;P&gt;tblFields.AppendRow&lt;/P&gt;&lt;P&gt;tblFields(2, "FIELDNAME") = "LOCNT"&lt;/P&gt;&lt;P&gt;tblFields.AppendRow&lt;/P&gt;&lt;P&gt;tblFields(3, "FIELDNAME") = "UFLAG"&lt;/P&gt;&lt;P&gt;If RFC_READ_TABLE.Call = True Then&lt;/P&gt;&lt;P&gt;If tblData.RowCount &amp;gt; 0 Then&lt;/P&gt;&lt;P&gt;filOutput.WriteLine "UserName,FailedLogins,LockedFlag"&lt;/P&gt;&lt;P&gt;' MsgBox tblData.RowCount&lt;/P&gt;&lt;P&gt;For intRow = 1 To tblData.RowCount&lt;/P&gt;&lt;P&gt;filOutput.WriteLine tblData(intRow, "WA")&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filOutput.WriteLine "NO FAILED LOGINS OR LOCKED USERS"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filOutput.WriteLine "ERROR CALLING SAP REMOTE FUNCTION CALL -&lt;/P&gt;&lt;P&gt;FAILED LOGINS UNKNOWN"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set filOutput = Nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MailProfile = "MS Exchange Settings"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set objSession = CreateObject("MAPI.Session")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LogonOK = objSession.Logon(MailProfile)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set objMessage = objSession.Outbox.Messages.Add&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objMessage.Subject = "SAP Users Report - Locked Users + Failed Logins"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;strSetMessage = "There are " &amp;amp; tblData.RowCount &amp;amp; " users that are&lt;/P&gt;&lt;P&gt;either locked due to failed logins, or have at least 1 failed login attempt&lt;/P&gt;&lt;P&gt;on system " &amp;amp; objWindowsScriptShell.RegRead("HKLM\Software\Accant iaEDI\SID")&lt;/P&gt;&lt;P&gt;&amp;amp; vbcrlf &amp;amp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&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;Dhruv Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 10:49:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-ans-vb-connection/m-p/3526034#M848291</guid>
      <dc:creator>dhruv_shah3</dc:creator>
      <dc:date>2008-03-10T10:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Ans VB Connection</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-ans-vb-connection/m-p/3526035#M848292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 11:43:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-ans-vb-connection/m-p/3526035#M848292</guid>
      <dc:creator>Sergiu</dc:creator>
      <dc:date>2013-08-28T11:43:05Z</dc:date>
    </item>
  </channel>
</rss>

