pub trait GuiApplication_Impl<T: HasIDispatch = Self>: HasIDispatch<T> {
Show 27 methods // Provided methods fn allow_system_messages(&self) -> Result<bool> { ... } fn set_allow_system_messages(&self, value: bool) -> Result<()> { ... } fn buttonbar_visible(&self) -> Result<bool> { ... } fn set_buttonbar_visible(&self, value: bool) -> Result<()> { ... } fn children(&self) -> Result<GuiComponentCollection> { ... } fn connection_error_text(&self) -> Result<String> { ... } fn connections(&self) -> Result<GuiComponentCollection> { ... } fn history_enabled(&self) -> Result<bool> { ... } fn set_history_enabled(&self, value: bool) -> Result<()> { ... } fn major_version(&self) -> Result<i32> { ... } fn minor_version(&self) -> Result<i32> { ... } fn new_visual_design(&self) -> Result<bool> { ... } fn patchlevel(&self) -> Result<i32> { ... } fn revision(&self) -> Result<i32> { ... } fn statusbar_visible(&self) -> Result<bool> { ... } fn set_statusbar_visible(&self, value: bool) -> Result<()> { ... } fn titlebar_visible(&self) -> Result<bool> { ... } fn set_titlebar_visible(&self, value: bool) -> Result<()> { ... } fn toolbar_visible(&self) -> Result<bool> { ... } fn set_toolbar_visible(&self, value: bool) -> Result<()> { ... } fn utils(&self) -> Result<GuiUtils> { ... } fn add_history_entry(&self, p0: String, p1: String) -> Result<bool> { ... } fn create_gui_collection(&self) -> Result<GuiCollection> { ... } fn drop_history(&self) -> Result<bool> { ... } fn ignore(&self, p0: i16) -> Result<()> { ... } fn open_connection(&self, p0: String) -> Result<SAPComponent> { ... } fn open_connection_by_connection_string( &self, p0: String ) -> Result<SAPComponent> { ... }
}

Provided Methods§

source

fn allow_system_messages(&self) -> Result<bool>

source

fn set_allow_system_messages(&self, value: bool) -> Result<()>

source

fn buttonbar_visible(&self) -> Result<bool>

source

fn set_buttonbar_visible(&self, value: bool) -> Result<()>

source

fn children(&self) -> Result<GuiComponentCollection>

Examples found in repository?
examples/simple.rs (line 37)
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
59
60
61
62
63
fn main() -> crate::Result<()> {
    // Initialise the environment.
    let com_instance = SAPComInstance::new().expect("Couldn't get COM instance");
    let wrapper = com_instance.sap_wrapper().expect("Couldn't get SAP wrapper");
    let engine = wrapper.scripting_engine().expect("Couldn't get GuiApplication instance");

    let connection = match sap_scripting::GuiApplication_Impl::children(&engine)?.element_at(0)? {
        SAPComponent::GuiConnection(conn) => conn,
        _ => panic!("expected connection, but got something else!"),
    };
    eprintln!("Got connection");
    let session = match sap_scripting::GuiConnection_Impl::children(&connection)?.element_at(0)? {
        SAPComponent::GuiSession(session) => session,
        _ => panic!("expected session, but got something else!"),
    };

    if let SAPComponent::GuiMainWindow(wnd) = session.find_by_id("wnd[0]".to_owned())? {
        wnd.maximize().unwrap();

        if let SAPComponent::GuiOkCodeField(tbox_comp) =
            session.find_by_id("wnd[0]/tbar[0]/okcd".to_owned())?
        {
            tbox_comp.set_text("/nfpl9".to_owned()).unwrap();
            wnd.send_v_key(0).unwrap();
        } else {
            panic!("no ok code field!");
        }
    } else {
        panic!("no window!");
    }

    Ok(())
}
More examples
Hide additional examples
examples/charge.rs (line 9)
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
fn main() -> crate::Result<()> {
    let com_instance = SAPComInstance::new().expect("Couldn't get COM instance");
    let wrapper = com_instance.sap_wrapper().expect("Couldn't get SAP wrapper");
    let engine = wrapper.scripting_engine().expect("Couldn't get GuiApplication instance");

    let connection = match sap_scripting::GuiApplication_Impl::children(&engine)?.element_at(0)? {
        SAPComponent::GuiConnection(conn) => conn,
        _ => panic!("expected connection, but got something else!"),
    };
    eprintln!("Got connection");
    let session = match sap_scripting::GuiConnection_Impl::children(&connection)?.element_at(0)? {
        SAPComponent::GuiSession(session) => session,
        _ => panic!("expected session, but got something else!"),
    };

    if let SAPComponent::GuiMainWindow(wnd) = session.find_by_id("wnd[0]".to_owned())? {
        wnd.maximize().unwrap();
        session.start_transaction("fpe1".to_string())?;

        match session.find_by_id("wnd[0]/usr/ctxtFKKKO-BLART".to_string())? {
            SAPComponent::GuiCTextField(ctxt) => ctxt.set_text("P1".to_string())?,
            _ => panic!("expected doc type ctextfield")
        }
        match session.find_by_id("wnd[0]/usr/ctxtFKKKO-WAERS".to_string())? {
            SAPComponent::GuiCTextField(ctxt) => ctxt.set_text("GBP".to_string())?,
            _ => panic!("expected currency ctextfield")
        }
        match session.find_by_id("wnd[0]/usr/txtFKKKO-XBLNR".to_string())? {
            SAPComponent::GuiTextField(txt) => txt.set_text("XA12345678".to_string())?,
            _ => panic!("expected reference textfield")
        }
    } else {
        panic!("no window!");
    }

    Ok(())
}
source

fn connection_error_text(&self) -> Result<String>

source

fn connections(&self) -> Result<GuiComponentCollection>

source

fn history_enabled(&self) -> Result<bool>

source

fn set_history_enabled(&self, value: bool) -> Result<()>

source

fn major_version(&self) -> Result<i32>

source

fn minor_version(&self) -> Result<i32>

source

fn new_visual_design(&self) -> Result<bool>

source

fn patchlevel(&self) -> Result<i32>

source

fn revision(&self) -> Result<i32>

source

fn statusbar_visible(&self) -> Result<bool>

source

fn set_statusbar_visible(&self, value: bool) -> Result<()>

source

fn titlebar_visible(&self) -> Result<bool>

source

fn set_titlebar_visible(&self, value: bool) -> Result<()>

source

fn toolbar_visible(&self) -> Result<bool>

source

fn set_toolbar_visible(&self, value: bool) -> Result<()>

source

fn utils(&self) -> Result<GuiUtils>

source

fn add_history_entry(&self, p0: String, p1: String) -> Result<bool>

source

fn create_gui_collection(&self) -> Result<GuiCollection>

source

fn drop_history(&self) -> Result<bool>

source

fn ignore(&self, p0: i16) -> Result<()>

source

fn open_connection(&self, p0: String) -> Result<SAPComponent>

source

fn open_connection_by_connection_string( &self, p0: String ) -> Result<SAPComponent>

Implementors§