Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting child objects in SAP
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Shridevi,

U can use descriptive programming for this.

Use the FindAllByID property of the object. Usually id will have soem values like
/app/con[0]/ses[0]/wnd[1]/usr/sub:ZC_RMSERIDR1:0200/chkI_ZMFCANC-FLAG[0,0]

Usually one of the values at last (here [0,0]) will change(Usually incremented by one). Chk which values is changing so that u can use a counter for that. In my case the first value is changing(incremented by 1) and the second one remains same.

Use the below code once u identify the changes....

Code:
intStartIndex=0 'As this the start index for my object. This might chanse. Please initialize as per ur object

'Get the no of checkboxes
Set ObjCount=SAPGuiSession("Session").SAPGuiWindow("Select the serial Numbers").Object.FindAllByName("I_ZMFCANC-FLAG","GuiCheckBox")
intTotalCount=ObjCount.count

'Select all the checkboxes
For i=intStartIndex to intTotalCount-1
    Set ObjCheckBox=SAPGuiSession("Session").SAPGuiWindow("Select the serial Numbers").Object.FindById("/app/con[0]/ses[0]/wnd[1]/usr/sub:ZC_RMSERIDR1:0200/chkI_ZMFCANC-FLAG["&intStartIndex&",0]")
    ObjCheckBox.selected=True
Next

'Release the object
Set ObjCount=Nothing
Set ObjCheckBox=Nothing

Do let me know if it works.

Regards,
Ankesh


'Descriptin of the below line...

Parameters passed in FindAllByName methods are
Code:
FindAllByName(<ObjectName>,<type>).

In sap , the object name remains same for all the checkboxes(as per the scrinshot).

Code:
Set ObjCount=SAPGuiSession("Session").SAPGuiWindow("Select the serial Numbers").Object.FindAllByName("I_ZMFCANC-FLAG","GuiCheckBox")


Messages In This Thread
RE: Getting child objects in SAP - by MVChowdary - 10-20-2011, 01:23 PM
RE: Getting child objects in SAP - by MVChowdary - 10-20-2011, 03:48 PM
RE: Getting child objects in SAP - by Ankesh - 10-20-2011, 04:52 PM
RE: Getting child objects in SAP - by syoutaikon - 08-15-2013, 01:23 PM
RE: Getting child objects in SAP - by Ankur - 08-15-2013, 02:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  SwfTreeview - Color validation for child item YogeshCallappa 0 2,290 11-10-2016, 04:55 PM
Last Post: YogeshCallappa
  Driver Script to control child scripts sumanhyd 1 3,180 07-26-2016, 07:06 PM
Last Post: Ankesh
  UFT 12.50 unable to recognize child objects from a Dialog Class in Firefox jesusisaac 1 3,802 08-20-2015, 11:39 PM
Last Post: ADITI1992
  Child object shwetakondekar 0 2,135 07-01-2015, 03:28 PM
Last Post: shwetakondekar
  How to write a script for fly out menus (Parent - Child - Sub Child) rajkumarsm 3 4,715 09-02-2014, 10:01 AM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 3 Guest(s)