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("name:=wnd\[0\]","type:=GuiMainWindow").SAPGuiButton("name:=btn\[0\]","type:=GuiButton").Click
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 ..
Thanks
kathirvel Nagaraj