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")