Exemplo n.º 1
0
    def enable_columns_to_filter(self, session):
        column_list = [filter1.field_name for filter1 in self.filters]
        if not len(column_list):
            return

        SAPGuiElements.call_menu(session, MENU_FIELDS_FOR_SELECTION)
        max_scroll = int(SAPGuiElements.get_max_scroll_position(session, GUI_CHILD_USER_AREA1))
        pos_scroll = 0
        startpos = 5
        do_cycle = True
        while do_cycle:
            SAPGuiElements.set_scroll_position(session, pos_scroll, GUI_CHILD_USER_AREA1)
            max_i = 0
            for i, element in SAPGuiElements.iter_elements_by_template(session,
                                                                 GUI_CHILD_USER_AREA1,
                                                                 "wnd[1]/usr/lbl[4,{0}]",
                                                                 startpos):
                max_i = i
                if element.text in column_list:
                    SAPGuiElements.set_checkbox(session, "wnd[1]/usr/chk[2,{0}]".format(i))
            if pos_scroll < max_scroll:
                new_pos_scroll = min(pos_scroll + max_i, max_scroll)
                startpos = max_i - (new_pos_scroll - pos_scroll) + 1
                pos_scroll = new_pos_scroll
            else:
                do_cycle = False

        SAPGuiElements.press_keyboard_keys(session, "Enter", GUI_CHILD_WINDOW1)
Exemplo n.º 2
0
 def __set_se16_parameters(session):
     SAPGuiElements.call_menu(session, MENU_USER_PARAMETERS)
     SAPGuiElements.select_element(session, FIELD_NAME_SELECTION)
     SAPGuiElements.select_element(session, ALV_GRID_SELECTION)
     SAPGuiElements.press_keyboard_keys(session, "Enter", GUI_CHILD_WINDOW1)
     TCodeSE16.first_call = False