Esempio n. 1
0
def main_po(bussines_partner, materials):
    session = initialization()
    purchase_order = create_po(session, bussines_partner, materials)
    print(f"PO {purchase_order}")
    inbound_delivery = create_indlvs(session, purchase_order)
    print(f"INDLS {inbound_delivery}")
    open_indls_for_trx(session, inbound_delivery)
    print(f"INDLS {inbound_delivery} opened in TRX")
    return inbound_delivery
Esempio n. 2
0
def make_session(system):
    session, connection, application, sap_gui_auto = initialization()
    db_connection = create_hana_connection(system)
    cursor = db_connection.cursor()
    data = {
        "session": session,
        "connection": connection,
        "application": application,
        "sap_gui_auto": sap_gui_auto,
        "cursor": cursor,
        "user": os.environ.get("SAP_USER"),
        "system": system,
        "db_connection": db_connection
    }
    return data
Esempio n. 3
0
    session.FindById("wnd[0]/tbar[1]/btn[9]").press()
    session.FindById("wnd[1]/tbar[0]/btn[0]").press()


def main_po(bussines_partner, materials):
    session = initialization()
    purchase_order = create_po(session, bussines_partner, materials)
    print(f"PO {purchase_order}")
    inbound_delivery = create_indlvs(session, purchase_order)
    print(f"INDLS {inbound_delivery}")
    open_indls_for_trx(session, inbound_delivery)
    print(f"INDLS {inbound_delivery} opened in TRX")
    return inbound_delivery


if __name__ == '__main__':
    sess = initialization()
    bp = "5000000044"
    materials = ["1000357", "1000358"]
    # data = {}
    #
    # # data["purchase_order"] = create_po(sess, bp, materials)
    # data["purchase_order"] = "4500000352"
    # data["indls"] = create_indlvs(sess, data["purchase_order"])
    # # data["indls"] = "180000240"
    # open_indls_for_trx(sess, data["indls"])
    # # print(data)

    main_po(sess, bp, materials)
    # tzmonex(sess)
Esempio n. 4
0
def session():
    session = initialization()
    return session
Esempio n. 5
0
            full_attr = sap.Children(0).Children(0).Info.SystemName

            print(full_attr)
            sess = sap.FindById("ses[0]")
            sess.FindById("wnd[0]").maximize()
            break

        except:
            time.sleep(1)

    return sess


if __name__ == '__main__':
    # pass
    # open_sap_gui()
    # session = make_session()
    session = initialization()
    session.StartTransaction(Transaction="YWMQUEUE")

    session.FindById('wnd[0]/usr/radR1').select()
    session.FindById('wnd[0]/usr/chkP_ROUTEP').selected = True
    session.FindById('wnd[0]/tbar[1]/btn[8]').Press()

    grid_users = session.FindById(
        "wnd[0]/usr/shell/shellcont[1]/shell/shellcont[1]/shell")
    ps = session.FindById("wnd[0]/usr/").verticalScrollbar.PageSize
    print(ps)
    session.FindById("wnd[0]/usr").horizontalScrollbar.position = 100
    session.EndTransaction()