Showing results for 
Search instead for 
Did you mean: 

Printing Orders

Former Member
0 Kudos

Hello All,

I wrote a VB Program to add orders. The problem I am having now is to print this order automatically when the program is successful. Can anyone help? I tried using vOrd.Printed = 1 but I get an error Read-only.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Laura

You can capture the event of menu when one presses the keys of impression (to previsualize and to print) of the tools bar.

I cosay of menus is:

Print Preview 519

Print 520

And with the intention of ActiveForm you can know that to form this assets.

Former Member
0 Kudos

Hello Jose,

The problem is that the order is created behind the scenes. I can't capture the menu because I am at the Purchase order screen. My program creates a order if the Vendor of a Purchase Order is say "ABC". This is done automatic, but I would like to print the new Order. That is where I am having trouble. Can you help?

Thank You

Former Member
0 Kudos

Can anyone Help??

Former Member
0 Kudos

If anyone need the code to print order from your program instead of through the SAP Application.

aplication.ActivateMenuItem("2053") 'open invoice form
Dim fo As SAPbouiCOM.Form
fo = aplication.Forms.ActiveForm
fo.Mode =SapbouiCOM.BoFormMode.fm_FIND_MODE 'activates find
fo.Items.Item("8").Specific.value = numfac 
'numfac is the docentry you want to print
fo.Items.Item("1").Click() 'makes the search
SendKeys ("{TAB 100}")
SendKeys ("{ENTER 100}")
applic.ActivateMenuItem ("520") 'open printing dialog
SendKeys ("{TAB}"), True
SendKeys ("{ENTER}"), True
fo.Items.Item("1").Click() 'close the invoice form

This is Thanks to Salvador Biot, Juha Lassila, and myself working together.

Thank You All!!!!

Answers (0)