ฉันต้องการอ่านค่าของเซลล์บนตาราง - ตัวอย่างธุรกรรม C202 ด้านล่าง
ฉันสามารถใช้ SAP GUI Scripting Recorder ไปที่ "check"
หรือ "select"
(row = 5, column = 1)
ซึ่งอยู่ถัดจาก "0122"
และ (row = 5, column = 1)
ซึ่งอยู่ถัดจาก "0125"
มันให้รหัสง่ายๆแก่ฉัน:
''' selects 0122
session.findById("wnd[0]/usr/tabsTABSTRIP_RECIPE/tabpVOUE/ssubSUBSCREEN_RECIPE:SAPLCPDI:4401/tblSAPLCPDITCTRL_4401").getAbsoluteRow(4).selected = true
'''selects 0125
session.findById("wnd[0]/usr/tabsTABSTRIP_RECIPE/tabpVOUE/ssubSUBSCREEN_RECIPE:SAPLCPDI:4401/tblSAPLCPDITCTRL_4401").getAbsoluteRow(7).selected = true
อย่างไรก็ตาม จะแตกต่างกันไปตามแถวที่มีอยู่
บางครั้งจะมี:
0100, 0110, 0120, 0121, 0122, 0123, 0124, 0125, 0130, 0140
-sometimes there will be 0100, 0110, 0122, 0123, 0124, 0125, 0140
-sometimes there will be 0100, 0121, 0122, 0123, 0124, 0125, 0140
-sometimes there will be 0100, 0122, 0123, 0125, 0130, 0140
etc
ฉันต้องการอ่านคอลัมน์ = 2 เลยรู้ว่าเป็น 0122 หรือ 0125 แล้วตรวจสอบดู
ฉันจะใส่ค่านี้ในตัวแปรและใช้ msgbox เพื่อแสดงได้อย่างไร
PSEUDO CODE
dim readVariable as string
for row = 1 to NumberOfRows
readVariable = Table.Read (row,2)
if readVariable = 0122
msgbox "row = " & row " & " is 0122"
end if
if readVariable = 0125
msgbox "row = " & row " & " is 0125"
end if
next
ฉันลองติดตาม ลิงก์แต่ทำไม่ได้ งาน.
ขอบคุณมาก!!!
session.findById("<the field ID>").caretPosition = 1
ดังนั้น VBS ของคุณเองจึงสามารถใช้ ID นี้:msgbox session.findById("<the field ID>").text
- person Sandra Rossi   schedule 19.12.2019text
จะเป็นสตริงเสมอ ฉันเดาว่าการเพิ่ม 1 หมายถึงการแปลงประเภทตามโมเดลประเภท VBScript - person Sandra Rossi   schedule 20.12.2019