Trait sap_scripting::types::GuiSession_Impl
source · pub trait GuiSession_Impl<T: HasIDispatch = Self>: HasIDispatch<T> {
Show 53 methods
// Provided methods
fn acc_enhanced_tab_chain(&self) -> Result<bool> { ... }
fn set_acc_enhanced_tab_chain(&self, value: bool) -> Result<()> { ... }
fn acc_symbol_replacement(&self) -> Result<bool> { ... }
fn set_acc_symbol_replacement(&self, value: bool) -> Result<()> { ... }
fn active_window(&self) -> Result<SAPComponent> { ... }
fn busy(&self) -> Result<bool> { ... }
fn set_busy(&self, value: bool) -> Result<()> { ... }
fn info(&self) -> Result<GuiSessionInfo> { ... }
fn is_active(&self) -> Result<bool> { ... }
fn is_list_box_active(&self) -> Result<bool> { ... }
fn list_box_curr_entry(&self) -> Result<i32> { ... }
fn list_box_curr_entry_height(&self) -> Result<i32> { ... }
fn list_box_curr_entry_left(&self) -> Result<i32> { ... }
fn list_box_curr_entry_top(&self) -> Result<i32> { ... }
fn list_box_curr_entry_width(&self) -> Result<i32> { ... }
fn list_box_height(&self) -> Result<i32> { ... }
fn list_box_left(&self) -> Result<i32> { ... }
fn list_box_top(&self) -> Result<i32> { ... }
fn list_box_width(&self) -> Result<i32> { ... }
fn passport_pre_system_id(&self) -> Result<String> { ... }
fn set_passport_pre_system_id(&self, value: String) -> Result<()> { ... }
fn passport_system_id(&self) -> Result<String> { ... }
fn set_passport_system_id(&self, value: String) -> Result<()> { ... }
fn passport_transaction_id(&self) -> Result<String> { ... }
fn set_passport_transaction_id(&self, value: String) -> Result<()> { ... }
fn progress_percent(&self) -> Result<i32> { ... }
fn progress_text(&self) -> Result<String> { ... }
fn record(&self) -> Result<bool> { ... }
fn set_record(&self, value: bool) -> Result<()> { ... }
fn record_file(&self) -> Result<String> { ... }
fn set_record_file(&self, value: String) -> Result<()> { ... }
fn save_as_unicode(&self) -> Result<bool> { ... }
fn set_save_as_unicode(&self, value: bool) -> Result<()> { ... }
fn show_dropdown_keys(&self) -> Result<bool> { ... }
fn set_show_dropdown_keys(&self, value: bool) -> Result<()> { ... }
fn suppress_backend_popups(&self) -> Result<bool> { ... }
fn set_suppress_backend_popups(&self, value: bool) -> Result<()> { ... }
fn test_tool_mode(&self) -> Result<i32> { ... }
fn set_test_tool_mode(&self, value: i32) -> Result<()> { ... }
fn as_std_number_format(&self, p0: String) -> Result<String> { ... }
fn clear_error_list(&self) -> Result<()> { ... }
fn create_session(&self) -> Result<()> { ... }
fn enable_jaws_events(&self) -> Result<()> { ... }
fn end_transaction(&self) -> Result<()> { ... }
fn find_by_position(&self, p0: i32, p1: i32) -> Result<SAPComponent> { ... }
fn get_icon_resource_name(&self, p0: String) -> Result<String> { ... }
fn get_object_tree(&self, p0: String) -> Result<String> { ... }
fn get_v_key_description(&self, p0: i32) -> Result<String> { ... }
fn lock_session_ui(&self) -> Result<()> { ... }
fn send_command(&self, p0: String) -> Result<()> { ... }
fn send_command_async(&self, p0: String) -> Result<()> { ... }
fn start_transaction(&self, p0: String) -> Result<()> { ... }
fn unlock_session_ui(&self) -> Result<()> { ... }
}
Provided Methods§
fn acc_enhanced_tab_chain(&self) -> Result<bool>
fn set_acc_enhanced_tab_chain(&self, value: bool) -> Result<()>
fn acc_symbol_replacement(&self) -> Result<bool>
fn set_acc_symbol_replacement(&self, value: bool) -> Result<()>
fn active_window(&self) -> Result<SAPComponent>
fn busy(&self) -> Result<bool>
fn set_busy(&self, value: bool) -> Result<()>
fn info(&self) -> Result<GuiSessionInfo>
fn is_active(&self) -> Result<bool>
fn is_list_box_active(&self) -> Result<bool>
fn list_box_curr_entry(&self) -> Result<i32>
fn list_box_curr_entry_height(&self) -> Result<i32>
fn list_box_curr_entry_left(&self) -> Result<i32>
fn list_box_curr_entry_top(&self) -> Result<i32>
fn list_box_curr_entry_width(&self) -> Result<i32>
fn list_box_height(&self) -> Result<i32>
fn list_box_left(&self) -> Result<i32>
fn list_box_top(&self) -> Result<i32>
fn list_box_width(&self) -> Result<i32>
fn passport_pre_system_id(&self) -> Result<String>
fn set_passport_pre_system_id(&self, value: String) -> Result<()>
fn passport_system_id(&self) -> Result<String>
fn set_passport_system_id(&self, value: String) -> Result<()>
fn passport_transaction_id(&self) -> Result<String>
fn set_passport_transaction_id(&self, value: String) -> Result<()>
fn progress_percent(&self) -> Result<i32>
fn progress_text(&self) -> Result<String>
fn record(&self) -> Result<bool>
fn set_record(&self, value: bool) -> Result<()>
fn record_file(&self) -> Result<String>
fn set_record_file(&self, value: String) -> Result<()>
fn save_as_unicode(&self) -> Result<bool>
fn set_save_as_unicode(&self, value: bool) -> Result<()>
fn show_dropdown_keys(&self) -> Result<bool>
fn set_show_dropdown_keys(&self, value: bool) -> Result<()>
fn suppress_backend_popups(&self) -> Result<bool>
fn set_suppress_backend_popups(&self, value: bool) -> Result<()>
fn test_tool_mode(&self) -> Result<i32>
fn set_test_tool_mode(&self, value: i32) -> Result<()>
fn as_std_number_format(&self, p0: String) -> Result<String>
fn clear_error_list(&self) -> Result<()>
fn create_session(&self) -> Result<()>
fn enable_jaws_events(&self) -> Result<()>
fn end_transaction(&self) -> Result<()>
fn find_by_position(&self, p0: i32, p1: i32) -> Result<SAPComponent>
fn get_icon_resource_name(&self, p0: String) -> Result<String>
fn get_object_tree(&self, p0: String) -> Result<String>
fn get_v_key_description(&self, p0: i32) -> Result<String>
fn lock_session_ui(&self) -> Result<()>
fn send_command(&self, p0: String) -> Result<()>
fn send_command_async(&self, p0: String) -> Result<()>
sourcefn start_transaction(&self, p0: String) -> Result<()>
fn start_transaction(&self, p0: String) -> Result<()>
Examples found in repository?
examples/charge.rs (line 21)
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(())
}