Created
December 30, 2022 03:14
-
-
Save khanhkhuu/ecac735500be01b2db120fc70f10fa39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cài Python 32Bit để chạy được script này | |
# Link: https://repo.anaconda.com/archive/Anaconda3-2021.05-Windows-x86.exe | |
import win32com.client | |
import ctypes | |
def main(): | |
connectionString = "Asia: (R/3 Test) CAI" | |
hidden = True | |
application = win32com.client.Dispatch("Sapgui.ScriptingCtrl.1") | |
connection = application.OpenConnection(connectionString + ("/INPLACE" if hidden else ""), True) | |
session = connection.Children(0) | |
# Kiểm tra stock E105AC00020 | |
session.startTransaction("md04") | |
session.findById("wnd[0]/usr/tabsTAB300/tabpF01/ssubINCLUDE300:SAPMM61R:0301/ctxtRM61R-MATNR").text = "E105AC00020"; | |
session.findById("wnd[0]/usr/tabsTAB300/tabpF01/ssubINCLUDE300:SAPMM61R:0301/ctxtRM61R-WERKS").text = "VN11" | |
session.findById("wnd[0]").sendVKey(0); | |
stock = session.findById("wnd[0]/usr/subINCLUDE1XX:SAPMM61R:0750/tblSAPMM61RTC_EZ/txtMDEZ-MNG02[9,0]").text; | |
session.endTransaction() | |
ctypes.windll.user32.MessageBoxW(0, "Stock hiện tại của " + "E105AC00020 là " + stock, "Kiểm tra stock", 1) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment