Hi Experts,
I have been trying to figure out a way to use if statement with a SAP GUI Script but unsure how to tackle this.
I have tried searching but have failed, maybe am not understanding or this is not covered .
I want the script to cycle through around 4 - 10 fields and if the contents match defined code then perform a transaction.
This will be using SAP Tcode IW52, i want to search for task "ENGR" or "EXCH" and if matches check see if field is editable and select line and close.
Below is the filed name in SAP when i select and enter a code.
Code would be executed if matched to close line
Below is the screen, notice ENGR apears in one field but its not editable so i would want to move on.
I have been trying to figure out a way to use if statement with a SAP GUI Script but unsure how to tackle this.
I have tried searching but have failed, maybe am not understanding or this is not covered .
I want the script to cycle through around 4 - 10 fields and if the contents match defined code then perform a transaction.
This will be using SAP Tcode IW52, i want to search for task "ENGR" or "EXCH" and if matches check see if field is editable and select line and close.
Below is the filed name in SAP when i select and enter a code.
VBA Code:
session.findById("wnd[0]/usr/tabsTAB_GROUP_10/tabp10\TAB11/ssubSUB_GROUP_10:SAPLIQS0:7120/tblSAPLIQS0MASSNAHMEN_VIEWER/ctxtVIQMSM-MNCOD[2,2]").text = "ENGR"
Code would be executed if matched to close line
VBA Code:
session.findById("wnd[0]/usr/tabsTAB_GROUP_10/tabp10\TAB11/ssubSUB_GROUP_10:SAPLIQS0:7120/tblSAPLIQS0MASSNAHMEN_VIEWER/txtVIQMSM-QSMNUM[0,2]").setFocus
session.findById("wnd[0]/usr/tabsTAB_GROUP_10/tabp10\TAB11/ssubSUB_GROUP_10:SAPLIQS0:7120/tblSAPLIQS0MASSNAHMEN_VIEWER/txtVIQMSM-QSMNUM[0,2]").caretPosition = 0
session.findById("wnd[0]/usr/tabsTAB_GROUP_10/tabp10\TAB11/ssubSUB_GROUP_10:SAPLIQS0:7120/btnFC_ERLEDIGT").press
Below is the screen, notice ENGR apears in one field but its not editable so i would want to move on.