Skip to Content

Synchronization issue with SAP session1 and session2 using QTP/UFT automation

Hi Guys,

I am using UFT to automate SAP application. My scenario is to automate the SAP Mail creation using the SWBP transaction. During the execution of the script while clicking the New Message button then new SAP session should open and need to compose the mail. But, got the error New Message button during the execution. Below is my script

'Creating a description object for SAP session

Set sSAPSession = Description.Create()

'Add descriptions and properties for SAP session

sSAPSession("guicomponenttype").value = "12"

sSAPSession("name").value = "ses\[0\]"

SAPGuiSession(sSAPSession).SAPGuiWindow("name:=wnd[0\]","type:=GuiMainWindow").SAPGuiOKCode("name:=okcd","type:=GuiOkCodeField").Set "SBWP"


SAPGuiSession(sSAPSession).SAPGuiWindow("guicomponenttype:=21","transaction:=SBWP").SAPGuiButton("name:=btn\[16\]","text:=New message").Click

SAPGuiSession("guicomponenttype:=12","name:=ses\[1\]").SAPGuiWindow("guicomponenttype:=21","text:=Create Document and Send").Activate

=========Error during the runtime =======

Cannot find the "[ SAPGuiWindow ]" object's parent "[ SAPGuiSession ]" (class SAPGuiSession). Verify that parent properties match an object currently displayed in your application.

Line (20): "SAPGuiSession("guicomponenttype:=12","name:=ses\[1\]").SAPGuiWindow("guicomponenttype:=21","text:=Create Document and Send").Activate".


Please give u r suggestions to resolve the issue ..


kathirvel Nagaraj

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jul 06, 2016 at 02:51 PM

    Hello Kathirvel,

    you open with


    in your case

    SAPGuiButton("name:=btn\[16\]","text:=New message").Click

    a complete new session.

    In this case it is necessary to set a new session

    Set session1 = connection.Children(1)

    in UFT maybe like:


    sSAPSession1("name").value = "ses\[1\]"

    I am no UFT (Unified Functional Testing) expert, but this is the way in VBS.

    Let us know your result.



    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Stefan Schnell,

      Error occur while sending the different e-mails from the Business Workplace continuously.

      Also, i Have set the "Wait 10" as static .

      I there any possibility to get the exact wait time required for the different e-mails creation from the Business Workplace .


      kathirvel Nagaraj

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.