Simple example of connecting SAP and VB

Hi Experts
Can anyone help me providing material or simple example program of connecting SAP and VB for data transfer.
     Its being a tough task for me, pls help me out.
Thanks in advance.
Regards
Rajaram

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.
For starting with NCo go through
http://help.sap.com/saphelp_nw04s/helpdata/en/a9/4a57c1bac80e4e977d8cd9b3ecab89/frameset.htm
OR
THIS IS ANOTHER WAY TO LOGIN TO SAP THROUGH VB TRY THIS.
Logon with the SAPLogon control, Use an RFC call from the SAP Function
Control, and get the results with the SAP Table Factory Control. . .
You must have SAPGui's FULL install on your machine for this to work (Or at
least SAPLogon and the RFC toolkit)
This VBScript example might help, it calls RFC_READ_TABLE in sap, and emails
the results back to a user from a selected query (In this case uses that are
locked out.
This should show you how this could work in practice.
Thanks,
Will
' Email Locked out SAP users details to user in a .csv file through MS
Exchange / CDO
Dim ctlTableFactory, RFC_READ_TABLE, eQUERY_TAB, tblOptions, tblData,
tblFields, funcControl, objConnection, ctlLogon
Set objFileSystemObject = CreateObject("Scripting.FileSystemObject")
Set ctlLogon = CreateObject("SAP.LogonControl.1")
Set funcControl = CreateObject("SAP.Functions")
Set ctlTableFactory = CreateObject("SAP.TableFactory.1")
Set objWindowsScriptShell = CreateObject("WScript.Shell")
Set objConnection = ctlLogon.NewConnection
Set filOutputobjFileSystemObject.CreateTextFile("E:\SAP Scripts\LockedUsers.CSV", True)
objConnection.ApplicationServerobjWindowsScriptShel l.RegRead("HKLM\Software\AccantiaEDI\SAPServer")
objConnection.SystemobjWindowsScriptShell.RegRead(" HKLM\Software\AccantiaEDI\SID")
objConnection.SystemNumber = "00"
objConnection.ClientobjWindowsScriptShell.RegRead(" HKLM\Software\AccantiaEDI\SAPClient")
objConnection.Language = "EN"
objConnection.UserobjWindowsScriptShell.RegRead("HK LM\Software\AccantiaEDI\SAPSAPUser")
objConnection.PasswordobjWindowsScriptShell.RegRead ("HKLM\Software\AccantiaEDI\SAPSAPPassword")
booReturn = objConnection.Logon(0, True)
If booReturn True Then
'MsgBox " Cannot log on! "
'MsgBox booReturn
filOutput.WriteLine "ERROR CALLING LOGGING INTO SAP - FAILED LOGINS
UNKNOWN"
Stop
Else
'MsgBox " Logon OK."
funcControl.Connection = objConnection
Set RFC_READ_TABLE = funcControl.Add("RFC_READ_TABLE")
Set strExport1 = RFC_READ_TABLE.Exports("QUERY_TABLE")
Set strExport2 = RFC_READ_TABLE.Exports("DELIMITER")
Set tblOptions = RFC_READ_TABLE.Tables("OPTIONS") '
Set tblData = RFC_READ_TABLE.Tables("DATA") '
Set tblFields = RFC_READ_TABLE.Tables("FIELDS") '
strExport1.Value = "USR02"
strExport2.Value = ","
tblOptions.AppendRow
tblOptions(1, "TEXT") = "LOCNT > 0 OR UFLAG = 128"
tblFields.AppendRow
tblFields(1, "FIELDNAME") = "BNAME"
tblFields.AppendRow
tblFields(2, "FIELDNAME") = "LOCNT"
tblFields.AppendRow
tblFields(3, "FIELDNAME") = "UFLAG"
If RFC_READ_TABLE.Call = True Then
If tblData.RowCount > 0 Then
filOutput.WriteLine "UserName,FailedLogins,LockedFlag"
' MsgBox tblData.RowCount
For intRow = 1 To tblData.RowCount
filOutput.WriteLine tblData(intRow, "WA")
Next
Else
filOutput.WriteLine "NO FAILED LOGINS OR LOCKED USERS"
End If
Else
filOutput.WriteLine "ERROR CALLING SAP REMOTE FUNCTION CALL -
FAILED LOGINS UNKNOWN"
End If
End If
Set filOutput = Nothing
MailProfile = "MS Exchange Settings"
Set objSession = CreateObject("MAPI.Session")
LogonOK = objSession.Logon(MailProfile)
Set objMessage = objSession.Outbox.Messages.Add
objMessage.Subject = "SAP Users Report - Locked Users + Failed Logins"
strSetMessage = "There are " & tblData.RowCount & " users that are
either locked due to failed logins, or have at least 1 failed login attempt
on system " & objWindowsScriptShell.RegRead("HKLM\Software\Accant iaEDI\SID")
& vbcrlf &
reward if useful

Similar Messages

  • Simple example code connect Ldap server...

    Hi all.
    I am beginning working with Ldap.
    Please help me a simple example source code to connect with Ldap server.
    I install Ldap administrator and see a public Server : ldap://directory.d-trust.de:389 How to connect it ?
    Thanks in advance
    Diego

    Hi ThuCT,
    Just have a read of the following links :
    http://www.javaworld.com/javaworld/jw-03-2000/jw-0324-ldap.html
    http://java.sun.com/products/jndi/tutorial/ldap/index.html

  • Simple Example of PDK Servlet and PreferenceStore

    I'm currently using Portal 10g, Release 2. Unfortunately, there are no newly updated PDK samples available for this version, but I've referenced the previous Portal examples and haven't been able to find a simple example that walks through the entire process of establishing/registering a store, storing preference data, and reading preference data from a PDK Servlet.
    If anyone has examples that illustrate the following, it would be greatly appreciated:
    1. How to create a File-based PreferenceStore for an PDK HttpServlet
    2. How to associate a preference store with the Portlet (when using the PortletRequestRender.getProviderInstance().getPreferenceStore(), I get null)
    3. How to store a preference value in the store
    4. How to read a preference value in the store
    Note: I have been able (with far too much code given a "development kit") to use the PDK to create a File-base PreferenceStore and store values. Unfortunately the read operations look for the .dat file in a path that consists of the path that I established in the store and appends it with a value of /df/. As a result, the preferences can't be read.
    Thanks for any opinions/advice on this.
    John

    Hi John,
    You could try looking up at any sample portlets on the Portal Integration website: http://www.oracle.com/technology/products/ias/portal/point.html
    All the JPDK based portlets use file preference stores.
    1. How to create a File-based PreferenceStore for an
    PDK HttpServlet
    2. How to associate a preference store with the
    Portlet (when using the
    PortletRequestRender.getProviderInstance().getPreferen
    eStore(), I get null)You need to use the following code:
    // Get access to the PortletRenderRequest
    PortletRenderRequest pReq = (PortletRenderRequest)
    request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    // Get access to the user's preference store for this portlet
    NameValuePersonalizationObject data = (NameValuePersonalizationObject)
    PortletRendererUtil.getEditData(pReq);
    // Get access to the Edit Defaults data which would be applciable to all users (who have not yet customized that attribute)
    NameValuePersonalizationObject editData = (NameValuePersonalizationObject)
    PortletRendererUtil.getEditDefaultData(pReq);
    3. How to store a preference value in the store
    4. How to read a preference value in the storeLook at the APIs for NameValuePersonalizationObject at http://www.oracle.com/technology/products/ias/portal/html/javadoc/apidoc/index.html
    >
    Note: I have been able (with far too much code given
    a "development kit") to use the PDK to create a
    File-base PreferenceStore and store values.
    Unfortunately the read operations look for the .dat
    file in a path that consists of the path that I
    established in the store and appends it with a value
    of /df/. As a result, the preferences can't be
    read.
    Thanks for any opinions/advice on this.
    JohnI hope this helps ..
    thanks,
    Harsha

  • Connect SAP and Xcelsius

    Hi,
    I want to connect to SAP from Xcelsius to get the latest data refreshed in Xcelsius.
    One option is to create a OLAP universe and then access it using the Qaaws. But I want to find out if I can connect without making the universe. One example would to have a SAP RFC called from Excel/VBA.
    Has anyone tried this approach or any other approach? Pls. let me know.

    Hi Mandar,
    Xcelsius is so new that almost no one know how to do it.  I think the following info is helpful to you.
    Install Part #1
    /people/ingo.hilgefort/blog/2008/09/17/businessobjects-and-sap--installation-and-configuration-part-1-of-4
    Install Part #2
    /people/ingo.hilgefort/blog/2008/09/17/businessobjects-and-sap--installation-and-configuration-part-2-of-4
    Install Part #3
    /people/ingo.hilgefort/blog/2008/09/17/businessobjects-and-sap--installation-and-configuration-part-3-of-4
    Install Part #4
    /people/ingo.hilgefort/blog/2008/09/17/businessobjects-and-sap--installation-and-configuration-part-4-of-4
    SAP Authentication
    /people/ingo.hilgefort/blog/2008/09/19/businessobjects-and-sap--configure-sap-authentication
    Regards
    Jonas

  • Simple example of a profile and publication setup

    Post Author: cbaumann
    CA Forum: WebIntelligence Reporting
    Hi
    I am using Windows 2000 Server with Business Objects XI Release 2, SP3, english.
    I am trying to create a profile and publication to test some scenarios what's the best way to use it. I did not really found a good docu or description, how to set it up. Has anybody a good explanation, maybe using this beach universe ?
    I can then try to map this to my universe and see, how to use it.
    thanks, Chris

    JonWat wrote:
    If, for example, you wanted to write in some data and add the time it was added, then sending to Oracle something like:
    INSERT INTO MyTab(datacolumns,DateAdded)
    VALUES (datavalues, SYSDATE)
    where the data values are bound variables from your app, might be the best way to go about it.
    Rather than
    (Execute) MyInsertProc(datavalues)
    where the InsertProc actually does the insertI'd disagree actually; if you've got code occuring on the database then it's much easier to optimize it if the code is all in one place - ie. in a package/procedure/function somewhere in PL/SQL.
    I'm with Tom Kyte in that I prefer everything to go through transactional API's - that is, if you're intending to add a new user, have a procedure that calls the inserts into the various tables, updates, etc, rather than having the front end call each insert itself.
    If the system is trying to do bulk uploads, well there are better methods of doing that (SQL*Loader or external tables) than row by row single inserts.
    This thread is an interesting read, but specifically, Tom's answer here is relevant.

  • I need  a simple example of shopping cart(newbie)

    Has any one come across a simple example of shopping cart and the process
    behind it i.e. from jsp to ejb. So far I have looked at the buybeans example
    and it still is not clear the approach that was used.
    I would be greatful for any assistance thank you
    Kenneth A-Adjei

    Take a look at:
    http://java.sun.com/docs/books/tutorial/servlets/overview/example.html
    "Ken Adjei" <[email protected]> wrote in message
    news:3960a901$[email protected]..
    Has any one come across a simple example of shopping cart and the process
    behind it i.e. from jsp to ejb. So far I have looked at the buybeansexample
    and it still is not clear the approach that was used.
    I would be greatful for any assistance thank you
    Kenneth A-Adjei

  • I want simple example of UTL_FILE package

    I want simple example of UTL_FILE package , and please I want this example be complete as possible as you can ( i mean - as I understand - we suppose make Create Directory statement at beginning and so on ... ) .
    even if you know any links for simple examples for UTL_FILE package .... I will be so grateful to post it .

    Maybe something like this?
    http://www.oracle-base.com/articles/9i/GeneratingCSVFi
    les.phpthanks Jens Petersen .... it's good one.

  • Is there a simple example, I can see how to connect to a db using Flash 8 and actionscript? (not with components)

    I have been looking all over for a simple "hello world"
    example, on how to connect to a database, and pass a param, and
    return a dataset. I would like one that does not use components.
    (Actionscript only). That uses ColdFusion 7.x and Flash 8. Can
    anyone point me to one?

    Thanks Craig, I saw that example, but it was meant for Flash
    MX, and according to the Flash 8 documentation, the NetServices is
    now deprecated. Anyway, I posted my question on another site and
    some supplied me with a simple example. Here is the url if anyone
    is interested...
    sample

  • Simple Examples of data connectivity and transfer of data from an .asp.vb to javascript in an .aspx file

    What forum might be useful in solving this issue:
    Simple Examples of data connectivity and transfer of data from an .asp.vb to javascript in an .aspx file

    They'll help you here in the Microsoft ASP.net forums.
    http://forums.asp.net/
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • Difference between connection pooling and simple connection

    Anybody please tell me what is the Difference between connection pooling and simple connection and also where we define connection pooling and how.
    Thanks
    Please reply soon
    amitindia

    Creating and closing connection to the database is a relatively slow process. Equally connections use database resources so you can't just open as many as you want.
    A connection pool maintains a number of open connections throughout the lifetime of the application. Instead of opening and closing the connections your application just "borrows" them from the pool when they're needed.
    If the pool runs out of connections it will usually create new ones as needed until you reach some predefined upper limit.
    A good connection pool will also manage connections which have failed for any reason, and report code which fails to return connections to the pool (ie connection leaks).
    The number of connections created at startup is referred to as the "low water mark" and the maximum number that the pool will allow to be opened at any given time is the "high water mark". If no connections are available client code will generally block until one is released.
    If by "defined" you mean where can you get a working implementation then your database or application server vendor is likely to provide one. Also the Apache Jakarta Commons includes [url http://jakarta.apache.org/commons/dbcp/]an implementation which you can use with any JDBC driver.
    Dave.

  • CR2008 connectivity issue with BOE Universes(sap and non sap universes)

    Hi Experts !!
    Recently we tried to build/connect to a Universe in Crystal Reports2008 via 'Make a new connection tab'.
    The universes are of SAP BW or non SAP Lying in BOE Servers and we are trying to build reports on them by conncting/utilizing the universes as a database for Crystal Reporting.
    Our issue is most of the time we are not able to connect to the Universes and the connectivity blows out by some 'communication Error' thing initially.
    While at some other points in time, the connectivity takes us to the Universe and we are able to select few characteristics and key figures from the Universe but the moment we go futher and try to run by pressing 'OK' button it blows out and say' LOGON FAILED'.
    Apparantly, it is an connectivity issue with BOE server and from the different blogs it looks like it is a known issue for long.
    The proposed issue resolution were like either CR2008 should be SP2 with BOE SP3 or there should be some additional .dll files defined in the paths in case of MSSQL database. None of this applies to us as we are on CR2008 with SP3 and going back to SP2 is probably not a viable option for us, and we are using Oracle as underlying database in this specific case.( i would like to tell you here that we are able to connect to Oracle Database directly though).
    We have raised a message with SAP and was just wondering if we do have some solution/workaround already available to this known issue in place please?
    Thanks&Regards.
    Edited by: AMIT GHILDYAL on Aug 1, 2011 2:41 PM
    Edited by: AMIT GHILDYAL on Aug 1, 2011 2:44 PM
    Edited by: AMIT GHILDYAL on Aug 1, 2011 3:14 PM

    Hi Amit,
    Moved to Universe Forum.
    If you have a case logged then no point posting here also, this is a public site and not a case management tool.
    Once you do get the solution from your case please post it here also to help others if they have the same problem.
    Thank you
    Don

  • Error Connecting SAP Business One and Crystal Report

    Hi All,
    I installed Crystal Report 2008 on my system for creating a report in Crystals.
    I clicked on "New Report" and it opened a window called "Database Exert." However, when I look in the Database Expert, I cannot see "SAP Business One" in it. How can I connect SAP Business One 8.8 with Crystal Report?
    Regards,
    Bharath S

    Hi
    On your computer, locate the Crystal folder according to the following directory path: C:\Program Files\SAP\SAP Business One\Crystal. Then double-click the file: SAP Business One Crystal Report Integration Package.exe. and follow the step of the setup status screen.
    Regards
    Christian Carrasco

  • Connect SAP R/3 and BW to Crystal Reports

    Hello,
      I am trying to connect crystal reports to SAP R/3 and BW
    I have installed the SAP XI Integration for SAP solutions kit. I have zipped all the files to a folder on my local machine. What do I need to do now to make this work? If anyone can give me a step by step direction that is easy, please let me know! I have a folder called Transports from the zipped file which has some files in it, however if someone can please explain where I need to go in either crystal or SAP that would be extremely helpful, thanks!
    Fahad

    Hi,
    it would actually help if you would share the error message here as well.
    You need Crystal Reports 2008, INtegration Kit for SAP and BusinessObjects Enterprise.
    correct - Transports are required as well and need to be installed.
    You can find all the details in the Installation and Administration Guide for the SAP Integration Kit on help.sap.com
    ingo

  • I cannot make a simple purchase of a $.99 of Beethoven's 9 symphony 4th Movement. When I click on the orchestra, a pop-up states "connecting - loading" and nothing happens. When I click on "View iTunes" for this selection, nothing happens.

    I cannot make a simple purchase of a $.99 of Beethoven's 9 symphony 4th Movement. When I click on the orchestra, a pop-up states "connecting - loading" and nothing happens. When I click on "View iTunes" for this selection, nothing happens.

    AlexCarey, I've been having issues purchasing recently and place a number of calls to the support team. On Oct. 5th, and on my own decision, I went into my itunes profile and re-entered my credit card expiration date and security code. (Notice, it is not displayed for safety measures.) Today, I received an email from Apple support verifying if I made changes made to my account. For the heck of it, I logged back into itunes; click "Buy". It's working again after three days of failure. However, diagnosis still displays "Secure link to itunes store failed". Very confusing state of affairs, lately. See my post on "Itunes dilemma"

  • SAP and TAS Connection through Web Services

    HI Experts,
    we are planning to Integrate SAp and another TAS system using web services (no XI/PI). Please tell me if this way is correct.
    XML format of iDoc will be the data format, web service technology will be used to exchange data between SAP and TAS.
    To Transfer data to TAS, the client application running on SAP server will try to connect to the web service running on TAS server. Once connection is established, idoc data will be sent to TAS, then the connection will be closed.
    To transfer data to SAP, the client application running on TAS server will try to make connection to the web service running on SAP server. Once connection is established, idoc data will be sent to SAP, then the connection will be closed.
    tnx and regards
    Edited by: Technical Group on Dec 6, 2011 4:18 AM

    Hello,
    What will be you Language used for Connection.
    One method i may suggest is use ABAP FTP.
    With this push the files to a file sever location and read it using webservice.
    like wise let webservice generate a file and place a file in location and let ABAP prog pick the file.
    this way you can maintain a status flag for the number of records, thus having a staging area.
    regards,
    Abhishek

Maybe you are looking for

  • Barra de Navegação cinza e preta encobrindo o link, como resolver?

    Instalei o Kubuntu 14.04 e, após a atualização do sistema, na barra de navegação do Firefox os links ficam encobertos pelas cores cina e preto, impedindo a leitura e atrapalhando a navegação. Mudei o esquema de cores padrão do sistema, e alterei o te

  • Recording from a mixer to my compu

    Currently I am using a Behringer EurotrackUB802 mixer that is connected to my soundcard (sb li've! 24-bit) using a rca-to-/8th jack. Im using this soundcard until I get the money to get a digidesign or protools compatable soundcard with rca inputs. W

  • 'Device sharing same IP address as your computer' - what does this mean?

    I purchased an Airport Express yesterday and was having connection problems after setting it up to only join my existing network (to play wireless audio to speakers in the kitchen) - I seem to have solved the issue by switching off WPS on my base sta

  • Post with clearing: FB05  No open items were found

    Hi, I am using FB05 (have selected 'transfer posting with clearing) to clear the vendor open items and post to a GL account, but I encounter the message 'No open items were found' (Msg F5 170) eventhough the vendor has open  items and morever it is n

  • Need help updating an old driv

    I need to update my sound driver for a Dell desktop that's a couple years old. When I tried to check into the correct download I was directed to a page that said there weren't any updates for my driver. I know this is not correct. I currently have SB