Insert Drop down SAPs bar Code

vitor

New Member
Joined
Sep 26, 2017
Messages
5
Hello!

i'd like to print the reservations already made.In this case, i have to mark each file that i want to print. i 'd like to insert this code on my script everytime it needs to drop down the bar, otherwise it will stop printing.

session.findById("wnd[0]").sendVKey 82


Thanks!

Sub Press()


Dim application


If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(Connection) Then
Set Connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = Connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If


session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").Text = "/nzmb25"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtWERKS-LOW").Text = "1104"
session.findById("wnd[0]/usr/ctxtWERKS-HIGH").Text = ""
session.findById("wnd[0]/usr/ctxtBDTER-LOW").Text = Range("I5").Value 'DATA
session.findById("wnd[0]/usr/txtUSNAM-LOW").Text = Range("I7").Value 'USURARIO
session.findById("wnd[0]/usr/txtUSNAM-LOW").SetFocus
session.findById("wnd[0]/usr/txtUSNAM-LOW").caretPosition = 5
session.findById("wnd[0]/tbar[1]/btn[8]").press




For i = Range("I2").Value To Range("J2").Value 'Count


session.findById("wnd[0]/usr/chk[1," & i & "]").Selected = True 'alteração para as celulas de acordo com o loop
session.findById("wnd[0]/usr/chk[1," & i & "]").SetFocus
session.findById("wnd[0]/tbar[1]/btn[20]").press
session.findById("wnd[1]/tbar[0]/btn[6]").press
session.findById("wnd[2]/usr/chkITCPP-TDDELETE").Selected = True
session.findById("wnd[2]/usr/chkITCPP-TDIMMED").Selected = True
session.findById("wnd[2]/usr/chkITCPP-TDIMMED").SetFocus
session.findById("wnd[2]/usr/chkITCPP-TDDELETE").SetFocus
session.findById("wnd[2]/tbar[0]/btn[86]").press
session.findById("wnd[0]/usr/chk[1," & i & "]").Selected = False


Next i




End Sub

Regards,​

 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top