Created
February 7, 2023 03:49
-
-
Save khanhkhuu/8049607345b7f413ce02db113eb5aa76 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Sub Check_Stock() | |
Dim sap As New SapClient | |
sap.ConnectionString = "CONNECTION STRING GO HERE" | |
sap.HideGui = True | |
sap.OpenSAP | |
Dim stock As String | |
sap.session.StartTransaction "md04" | |
sap.session.FindById("wnd[0]/usr/tabsTAB300/tabpF01/ssubINCLUDE300:SAPMM61R:0301/ctxtRM61R-MATNR").Text = "E105ACXXXXX" | |
sap.session.FindById("wnd[0]/usr/tabsTAB300/tabpF01/ssubINCLUDE300:SAPMM61R:0301/ctxtRM61R-WERKS").Text = "VN11" | |
sap.session.FindById("wnd[0]").SendVKey (0) | |
stock = sap.session.FindById("wnd[0]/usr/subINCLUDE1XX:SAPMM61R:0750/tblSAPMM61RTC_EZ/txtMDEZ-MNG02[9,0]").Text | |
sap.session.EndTransaction | |
sap.CloseSAP | |
Debug.Print "E105ACXXXXX: " & stock | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment