sapwnd[0]/usr/lbl 如何获取栏位信息 sap获取栏位信息

48 篇文章 3 订阅

Dim sapWin, tCols as long, tRows as long
set sapWin = session.FindbyId("wnd[1])
tColumns = sapWin.WorkingPaneWidth
tRows = sapWin.WorkingPaneHeight

		sapWin = session.findbyid("wnd[0]")
        tColumns = sapWin.WorkingPaneWidth
        tRows = sapWin.WorkingPaneHeight
        print('text', tRows, tColumns)

        for i in range(0, tRows):
            try:
                status = session.findById(f"wnd[0]/usr/lbl[56,{i}]").text
                job_name = session.findById(f"wnd[0]/usr/lbl[4,{i}]").text
                print('status', status)
                print('job_name', job_name)
           except:
           		pass

在这里插入图片描述
参考
https://answers.sap.com/questions/10673834/how-to-count-the-rows-of-a-gui-label-object.html

另一种

      layout = session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell")
        row_count = layout.RowCount
        print('row_count', row_count)
        for i in range(0, row_count):
            job_name = layout.GetCellValue(i, "JOBNAME")
            status = layout.GetCellValue(i, "STATUSNAME")
            start_date = layout.GetCellValue(i, "STRTDATE")
            start_time = layout.GetCellValue(i, "STRTTIME")
            print(i, job_name, status, start_date, start_time)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值