Struct sap_scripting::types::SAPWrapper
source · pub struct SAPWrapper { /* private fields */ }
Expand description
A wrapper over the SAP scripting engine, equivalent to CSapROTWrapper.
Implementations§
source§impl SAPWrapper
impl SAPWrapper
sourcepub fn scripting_engine(&self) -> Result<GuiApplication>
pub fn scripting_engine(&self) -> Result<GuiApplication>
Get the Scripting Engine object from this wrapper.
Examples found in repository?
examples/simple.rs (line 36)
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
fn main() -> Result<()> {
// Initialise the environment.
let com_instance = SAPComInstance::new()?;
eprintln!("Got COM instance");
let wrapper = com_instance.sap_wrapper()?;
eprintln!("Got wrapper");
let engine = wrapper.scripting_engine()?;
eprintln!("Got scripting engine");
let connection = engine.get_connection(0)?;
eprintln!("Got connection");
let session = connection.children(0)?;
eprintln!("Got session");
if let SAPComponent::GuiMainWindow(wnd) = session.find_by_id("wnd[0]")? {
wnd.maximize().unwrap();
if let SAPComponent::GuiOkCodeField(tbox_comp) =
session.find_by_id("wnd[0]/tbar[0]/okcd")?
{
tbox_comp.set_text("/nfpl9").unwrap();
wnd.send_vkey(0).unwrap();
} else {
panic!("no ok code field!");
}
} else {
panic!("no window!");
}
Ok(())
}
Auto Trait Implementations§
impl RefUnwindSafe for SAPWrapper
impl !Send for SAPWrapper
impl !Sync for SAPWrapper
impl Unpin for SAPWrapper
impl UnwindSafe for SAPWrapper
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more