Skip to Content
avatar image
Former Member

Excel VBA SAP logon pad

Hello,

I have successfully written VBA code to emulate user interaction with SAP on one "system".  However when i want to switch over to another SAP system i have been unsuccessful.  I may be using the wrong terminology referring to the systems, for example, on the SAP logon pad 710 i have a list of 56 system's i can log in to.  I only use two of those systems, one is called SAP ECC production [BH1] and the other is called SAP SCM 5.0 Production [BA1].  in the middle of my code i would like to switch over to the second system (SAP SCM 5.0) but i have not been able to do it.  Any help would be tremendous!  Thank you 😊

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Sep 24, 2013 at 08:53 AM

    Hi Jason,

    Basically, you need to change the sap connection to the other system using either OpenConnection or OpenConnectionByConnectionString method on the GuiApplication object.

    Can you share the codes that you have and indicate at which point do you want to change?

    Thanks,

    Sayuti

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Actually here is how i solved it:

                  For r = 0 To 15                If session.findbyid("/app/con[0]/ses[0]/wnd[0]/usr/tblSAPDV70ATC_NAST3/txtNAST-DATVR[8," & r & "]").Text = "" Then                    If session.findbyid("/app/con[0]/ses[0]/wnd[0]/usr/tblSAPDV70ATC_NAST3/txtNAST-UHRVR[9," & r & "]").Text <> "" Then                        session.findbyid("wnd[0]/usr/tblSAPDV70ATC_NAST3").getAbsoluteRow(r).Selected = True                    Else                    End If                Else                End If          Next r