VBA with SAP MB5L

CLYS

New Member
Joined
Jan 12, 2022
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
Hi,

I've recorded the script from SAP and pasted it to excel, and it managed to run using excel VBA.

However, there is no way for me to change the period based on my need (e.g. "Select balance, current period", "Select balance, previous period").

The VBA will run based on the recording script which is "Current Period" data.

Is there anyway for me to select the period in excel before execute the VBA?


session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").Text = "/n/epcos/MB5L"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtBUKRS-LOW").Text = Range("B7").Value
session.findById("wnd[0]/usr/radAKSALDO").SetFocus
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/usr/lbl[1,5]").SetFocus <-- i guessed this is where the period has been selected during the sript recording.
session.findById("wnd[0]").sendVKey 2

Thanks.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,215,065
Messages
6,122,945
Members
449,095
Latest member
nmaske

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