SAP Connection R/3 using a SSO in Visual Basic

Hello,  I have been trying to get an R/3 connection to SAP using VB.
I log into SAP by getting a SSO ticket and running SAPGUI with the ticket.
Is there a way to use R/3 and the SSO ticket to log in using VIsual Basic?
Set R3 = CreateObject("SAP.Functions")
R3.Connection.Client = "000"
R3.Connection.User = "123456789"
R3.Connection.Language = "EN"
R3.Connection.System = "0"
If R3.Connection.logon(0, True) <> True Then
    MsgBox "No connection to R/3 System"
    Exit Sub                                    
End If
I have a string from the .SAP file each time it is downloaded, I assume it is the single use password..
[User]
Name=123456789+
at="MYSAPSSO2=thisIsAReallyLongStringOfCharectersEndingWIthA="
Language=EN
Thanks.

solved it: SAPJCO was not included in the Windows Environment Path Variable. I included D:\usr\sap\yyyy\j2ee\j2ee_00\os_libs;D:\usr\sap\yyyy\j2ee\j2ee_00\cluster\server\additional-lib
Bye
Christoph

Similar Messages

  • Using Crystal Reports in Visual Basic 2010

    I am trying to add several Crystal Reports to a new project and having a major problem.  Here's the situation. I created a new Visual Basic 2010 project with only one form, In visual Basic I added Crystal Reports.   I then imported a form that was created in Crystal Reports 8.5.
    There were no errors and the report with valid data was visible. I then tried to run...it wouldn't run and 31 errors appeared.
    Obviously I missed something. I have searched for a very simple basic tutorial and  either can't find one or didn't recognize one.
    Can anyone point me in the right direction.
    Milt

    Ok. So, you added the report to the project. Now we have to add the CR assemblies to the project, add the viewer (if need be) and fire it off. Simplest code would be:
    Public Sub New()
            ' This call is required by the designer.
            InitializeComponent()
            ' Add any initialization after the InitializeComponent() call.
            CrystalReportViewer1.ReportSource = ("path to report")
        End Sub
    In this case you are using the viewer SDK to runt he report. The report will prompt for any logon parameters - but you can code these also. You can load the report via the engine as bellow. Again, the report will prompt. I prefer to use the engine as it is way more "extensible"...
    Public Sub New()
            ' This call is required by the designer.
            InitializeComponent()
            ' Add any initialization after the InitializeComponent() call.
            Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
            crReportDocument.Load("path to report")
            'Bind the report to the viewer
            CrystalReportViewer1.ReportSource = crReportDocument
        End Sub
    If you have a report added to the project (strongly typed) the code would be:
    CrystalReportViewer1.ReportSource = New myReport()
    For more details, I'd recommend looking at the sample app vbnet_win_simplepreviewreport.zip available from the following location:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    The developer help files are here:
    [SAP Crystal Reports .NET SDK Developer Guide|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_dg_2010_en.zip]
    [SAP Crystal Reports .NET API Guide|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_api_2010_en.zip]
    - Ludek

  • How do i use directX in microsoft visual basic studio 2010 express ?

    i am writing code to graph stock market prices using microsoft visual basic studio express
    i want fast response (i do machine language) using directX
    this is my problem
    i have never used directX, and i have never used directX in visual basic studio
    i followed a tutorial that went like this
      Reference: Microsoft.DirectX
                 Microsoft.DirectX.Direct3D
                 Microsoft.DirectX.Direct3DX
        Imports: Microsoft.DirectX
                 Microsoft.DirectX.Direct3D
                 Microsoft.DirectX.Direct3DX
        Declare: Private D3Ddev As Device = Nothing
                 Private D3Dpp As PresentParameters = Nothing
                 Private DP As DisplayMode = Nothing
    i found the reference dll's at C:\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2902.0
    when i imported microsoft.directX.direct3DX i got error #1
    namespace or type specified in the imports 'microsoft.directX.direct3DX' doesn't contain any public member or cannot be found...
    the same error occurs wether i use direct3DX \1.0.2911.0 or \1.0.2902.0
    when i built and ran, i got error #2
    microsoft visual basic 2010 express is waiting for an operation to complete ...
    it hangs and i have to soft reset ctrl-alt-del
    error #3
    when i reference
      Microsoft.DirectX
      Microsoft.DirectX.Direct3D and
      Microsoft.DirectX.Direct3DX
      from C:\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2902.0,
    all my declares work:
            D3Dpp = New PresentParameters()                             'Initialize
    some stuff for the Presentation parameters
            D3Dpp.BackBufferFormat = DP.Format
            D3Dpp.BackBufferWidth = DP.Width
            D3Dpp.BackBufferHeight = DP.Height
            D3Dpp.SwapEffect = SwapEffect.Discard                       'There's flip, copy, and discard. Flip and Discard
    are used most often.
            D3Dpp.PresentationInterval = PresentInterval.Immediate      'Present the scene immediately
    but when i start debugging (f5), i get this error message:
    mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information
    i dont fully understand the visual studio process, but i think 'mixed mode' means run and debug. two seperate app's
    i know this is a long question, but the forums don't answer it properly
    i want it answered concisly. i am running windows 7 basic, and this is my question
    can somebody give me a dozen lines of directX code that will work with my system, so that i can at least draw a line using directX 2D and 3D ?
    thanks everybody :)

    Hi,
    Thank you for your post.
    I am afraid that the issue is out of support range of VS General Question forum which mainly discusses
    WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    Since your issue is related to DirectX, I suggest you consult on DirectX forum:
    http://xboxforums.create.msdn.com/forums/ for better response.
    Thanks,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How do I print the displayed graph? I am using Measurement Studio for Visual Basic.

    a

    It is true that calling the PrintForm method is the easiest way to print your graph. However, if you wish to print only the graph, and not the rest of your form, there is a way to do this also.
    The CWGraph control, and some other CW controls, supports the ControlImage method which returns a Windows metafile containing an image of the graph. You can then send this image to your printer using environment-specific printer commands.
    In Visual Basic, use the Printer.PaintPicture command to send the metafile, and top and left coordinates to the printer. Then call Printer.EndDoc to flush the job to the printer:
    Printer.PaintPicture CWGraph1.ControlImage, 0, 0
    Printer.EndDoc
    In the above code, the second and third parameters specify the position of the image o
    n the page; you can also enlarge or shrink the image by specifying width and height. You may want to take a look at the Visual Basic PaintPicture function help for more details on this function.
    J.R. Allen

  • How to use java applets inside visual basic

    hi everyone,
    i am new to programming specially java so please bear with me.
    having said that i am looking for a way to embed java applets in visual basic. so
    1) is it possibele?
    2) if yes(which i believe) then how?
    we are supposed to use VB but i hate it so looking for this way .
    any suggestions and help is whole-heartedly welcome.
    kindly help me.
    you can post ur replies here or mail me directly at my e-mail id
    [email protected]

    thanx
    i have 2 more queries.
    1) is this IE ACTIVE-X CONTROL present by default in VB or do i have to download some add-ons?
    2) how do i write a concurrent server in java . i mean is there any thing equivalent to the UNIX system's FORK()?what if i have to implement this in an applet?
    thanx again.

  • ORA-12154 when connect to Ora10 using an odbc from visual C++

    Hello
    I have the follong problem , I have a machine that must access to an oracle database , I have made an Odbc Conection and if I make atest there is no one problem and the test is sucessfully . My problem is when I 'm trying to access using my visual c++ program in this case I get an ORA -12154 error , using the same odbc connection that I have probe, also I have probe this program over others machines and there is no problem to access to the database . Can anyone tell me something ??
    The machine is an windows XP and the programa is a Visual C++.net .

    Well we have find the problem , was the path of the application . this has 84 characters we have put our program in a shortest path and now works!!!!

  • I am using NI-CAN with Visual Basic 5.0. Opening and using the can bus works without any errors

    . When I use ncCloseObject with the same object handle that I use with the other functions, I get an error. The error I get is 80010004. This is a bad parameter error. The only parameter that is used is the Object Handle. How do I eliminate the error?I am using it on a Windows 95 machine and a PCICan card. I cannot close my program and restart it again. It will not reopen the CAN port.

    . When I use ncCloseObject with the same object handle that I use with the other functions, I get an error. The error I get is 80010004. This is a bad parameter error. The only parameter that is used is the Object Handle. How do I eliminate the error?Hello Vernon,
    I've attached an example in VB for CAN below. This example ( Object to Object) transmits data from one port and reads from the other port. If you have a Two port CAN card, then you can connect the cable between the two ports and run this example.
    In any case, you can verify whether you are closing the object handle in the same sequence as the example.
    Let me know if the error still shows up with the example too.
    Attachments:
    nicanvb.zip ‏8 KB

  • Is it possible to convert a LabView .ldd Instrument Driver into a dll that can be used with MAX and visual basic?

    I got the following problem. I'm using a Stanford DS360 UltraLow Destortion Function Generator, and would like to access it with the CwIVIFgen ActiveX Controll. In the driver database i found a instrument driver for LabView (ds360fg.llb). But its a llb file and i am not sure what to do.
    Is it possible to convert it?
    Is it possible to use it anyways?
    Maybe i overread the answer, but i search the forums for quite a while now and i am not a bit wiser.
    Thanks in advance
    Felix

    If you have LabVIEW and the application builder, a dll can be created from it but it cannot be used as an IVI driver. The only way to create an IVI instrument driver is with LabWindows/CVI. I personally don't have the time right now to create the dll but maybe if you post to the LabVIEW forum and get someone there to do it. Another other option is to hire an Alliance member to create either a dll from the LabVIEW code or to create an IVI driver from scratch.

  • Best Practices for SAP, connections to use without BW

    Hello,
    Could you help me to solve a problem with Best Practices 4.31?
    SAP Integration Kit XI 3.1 SP3 has 4 options  :
    u2022     SAP Infosets
    u2022     SAP BW MDX Query
    u2022     SAP BW Query
    u2022     Table, cluster ou function
    When I install SAP Integration Kit XI 3.1 SP3 for serveur, I have one additional service in my CCM,  BW Publisher 12. This service is from SAP BW.
    From the article /people/glen.spalding/blog/2010/08/04/the-full-montypart-13bobj-integration-kit-sp3-install-configure and installation guide for IIntegration Kit XI 3.1 SP3 I've learned that I need SAP BW to use Infosets dans Crystal Reports.
    Dans notre installation nous avons
    u2022     SAP ERP système without BW,
    u2022     BOBJ Server Setup,
    u2022     BOBJ Edge Integration Kit for SAP XI 3.1 SP3 server
    u2022     BOBJ Client Setup,
    u2022     BOBJ Edge Integration Kit for SAP XI 3.1 SP3 client
    u2022     Crystal Reports 2008
    u2022     Xcelsius 2008
    I've got Best Practices reports via « Table, cluster ou fonction » connection. There is no problem with this type of connection !
    I suppose that « SAP Infosets », « SAP BW MDX Query » et « SAP BW Query » connections should be used with SAP BW.
    Could you give me your opinion about this question?
    Thanks beforehand,
    Malika

    Hi,
    the InfoSets are a connection option for the classic InfoSets in an ERP system. Would suggest you take a look at the user guide for the SAP Integration Kit
    ingo

  • How to use for my own macro the Bex SAP Connection?

    Hello,
    with
    Dim sapConn As Object 'Declare variant
        Set sapConn = CreateObject("SAP.Functions") 'Create ActiveX object
        If sapConn.Connection.Logon(0, False) <> True Then 'Try Logon
           MsgBox "Cannot Log on to SAP"
        End If
        'Define function
        Dim objRfcFunc As Object
        Set objRfcFunc = sapConn.Add("RFC_READ_TABLE")
    you are able to connect to SAP via a VB macro and you can use it e.g. for a RFC call.
    Is it possible to use from my macro the connection that is establised by BEX? If yes - how? I haven't found any method to get the established connection. In the macro edior is BExAnalyzer.xla with all general functions. Test.XLS ist my workbook, but here is no variable with the connection. It seems that Test.XLS only call a sub of BExAnalyzer.xla.
    Best regards,
    Alexander

    [Hello Alexander,|http://chandranonline.blogspot.com]
    Yes its possible,
    SAP Note Number: 492561
    BEx Analyzer: Connection to the BW Server in a VBA macro
    Symptom
    Customer has written VBA macros which automate functions in the BEx Analyzer via the Analyzer's VBA-API. The customer wants to automate the logon as well, i.e. the user should not be forced to process the BEx Analyzer's dialog screen manually.
    Other terms
    Logon, Login, Visual Basic for Applications
    Solution
    The following VBA code sample shows how to create an RFC connection for the BEx Analyzer without bringing up the logon dialog. It assumes that the BEx Analyzer (i.e. the Add-in SAPBEX.XLA) has been loaded already.
    Function logonToBW() As Boolean
         logonToBW = False
        On Error GoTo leave
        Dim myConnection As Object
        Set myConnection = Run("SAPBEX.XLA!SAPBEXgetConnection")
        With myConnection
    '      .client =
    '       .user =
    '      .password =
    '      .Language =
    '       .systemnumber =
    '      .system =
    '      .systemid =
    '        .ApplicationServer =
    '       .SAProuter =
             .logon 0, True
            If .isConnected <> 1 Then
                 .logon 0, False
                If .isConnected <> 1 Then
                     MsgBox "something went wrong ..."
                     Exit Function
                 End If
            End If
        End With
        Run "SAPBEX.XLA!SAPBEXinitConnection"
         logonToBW = True
    leave:
    End Function
    Also see
    [SAP Network Blog: Accessing SAP Functions from Excel using Visual Basic Applications |/people/vikas.sreedharan/blog/2007/12/12/accessing-sap-functions-from-excel-using-visual-basic-applications]
    [Thanks|http://chandranonline.blogspot.com]
    [Chandran|http://chandranonline.blogspot.com]

  • SAP HR Dashboarding/Reporting using BW or BO?

    I need you suggestion in our BW HR implementation, like Payroll, Time Mgt, Employee Relations, Learning & Dev etc..
    All our reports are currently in SAP BO XI3.1, since we dont have any reports in BW, i am trying to avaluate the PROS and CONS of HR Dashboard Reporting in BO. Is BO tool XCelcius Capable for HR Dashboarding or what is the best Dashbording option for HR,
    1) I would like to know how are HR BW Reports handled in BO tools(XCelcius/WebI) in view of HR Time Dependant data.
    2) How is BW HR Authorizations handled for Payroll and Training moduled etc.
    3) How will BO Dashboard Inherit the Authorization

    You can leverage the BOE enterprise security and other features if you use Xcelsius.
    You can also leverage your existing Universe and use 'QaaWS' - Query as WebService as the connection model and using SSO feature - LDAP or WinAD authentication enable RowLevel  security on the data as well (feature of Universe)
    We have done many projects using the Xcelsius, QaaWS with Univers

  • Connecting BW to EP for SSO

    Hi There All
    I have three R/3 backends connected to our portal using SSo and all works fine.  I got a request in to connect our BW system to EP so I duly followed the same principles that I used for connecting the R/3 systems and the tests from the portal work fine.
    However I have created an iView called BW reports which basically calls the following URL:
    http://<BW Server hostname> :8000/sap/bw/bex
    When I preview this iView I get the logon screen appearing, I have tried other transaction codes and still I get the logon screen.
    Any help would be greatly appreciated

    Hi,
      The blogs below explain the steps.. check if you have missed any of them..
    Blog1:
    Connecting SAP systems to Enterprise portal with SSO.
    Blog2:
    /people/julia.kielbasiewicz/blog/2005/04/17/integration-of-sap-business-warehouse-and-enterprise-portal-150-single-sign-on
    Hope that helps.
    Regards,
    S.Divakar

  • PI 7.11: Cannot connect to server using message server:...

    Hello Guys,
    we make the Application Management for a Customer PI System.
    Scenario:
    - the SAP Gui Connection to the ABAP Stack is routed via SAPRouter and Works fine.
      SAP Gui -> our SAP Router -> VPN Box from Customer -> Firewall Customer -> ABAP Stack PI System
    - WebAccess its working fine, the Customer use Webdispatcher on every PI Server...
      Browser -> VPN Box from Customer -> Firewall Customer -> Java Stack (Port: 5xx00 btw. 81xx (Webdispatcher))
    Problem:
    Our Problem ist, we can not proceed the Integration Builder or the ESB, the Java Web Start works fine and open the Logon Screen Correctly -> but i fill the Logon Screen with my User name and Password and press Logon come the follwing Error:
    "Cannot connect to server using message server: ms://<hostname>.<domain>:8134/P4"
    In the Details from the Error Message:
    "<hostname>.<domain>:53404 Reason: com.sap.engine.services.rmi_p4.P4IOException:
    Cannot open connection to host: <IP-Adress of Central Instance> and Port: 53404"
    The Customer says, the Firewall is open with the IP Adresses and P4 Port but i dont think so...
    Can everybody help me, or have tips for me! I have checked a lot of OSS Messages (PI High Availabilty etc... its all correct on the System)
    Sorry for my bad English
    Best Regards,
    Markus

    Hi Markus,
    did you check if the browser is using a proxy? (In this case your scenario unfortunately won't work).
    P4-port should generally be routed via a proxy (described in the help.sap.com), but within the PI-Tools(JNLP) the proxy-usage is not implemented.  There is even a SAP-note that describes how to check the JavaWebStart-Proxyconfiguration, but this won't help either.
    If there is a proxy defined in the browser everything is working fine till you pass the logon-screen but even with the correct "javaws"-settings you won't be able to go on.
    (This problem is pretty bad if you do have developers and the SAP-servers seperated because of security issues. I'm hoping that this malfunction will be solved with upcoming patches.)
    Solution: Establish a connection without any proxy in between.
      E.g.: a terminal server in the same network
    It would be helpful to find more people with the same problem to force a fix from SAP for that.
    If anyone else is having problems with this, please add a comment to this thread.
    Best regards
    Christian

  • How to create a iview in eclipse for connecting  R/3 using JCA?

    Hi everybody,
           I want to create a iview in eclipse for connecting  R/3 using JCA. Can any body send me java code for this purpose. i tried one example from sdn in eclipse but i did't get any code for the same.
    thanking you
    Rajendra

    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/sap connector examples download.htm

  • Add new System to SAP connection adapter - HAL

    Hi. I would like to add a new System ID to Application Link's SAP connection adapter (HAL).
    I mean: we have been changing SAP environment (i.e System ID) and I would like to add a new System ID in the list; however, as I create a new SAP connection, only a list of old System ID is displayed.
    Even if I create and test correctly the new connection, the new System ID is still not displayed. Any advice?
    Thanks a lot in advance

    You have recieved or are starting SAP Logon pad and not SAP Logon.
    C:\Program Files\SAP\FrontEnd\SAPgui\
    C:\Program Files\SAP\SapSetup\setup\SAL\
    saplgpad.*
    saplogon.*
    Regards,
    /Wim
    PS, to SAP developers: there are multiple companies frowning upon the decision to display the grayed-out buttons in saplgpad. I would hate to roll-out 720 with a in-house launcher for saplgpad that hides the buttons using some dirty hack.

Maybe you are looking for