Skip to main content

Driving a transactional document manually

For documents without a curated helper (see Supplier invoice and Bank statement for the ones that have one), use the session actions directly. Follow the open → set → derive → post/activate shape and hold the sessionId (why).

Soft-state (BOPF)

from abstra.connectors import run_connection_action

def call(action, params):
return run_connection_action(connection_name="my_sap", action_name=action, params=params)

opened = call("softstate/open_headers", {}) # returns { sessionId, keys }
sid = opened["sessionId"]

call("softstate/update_headers", { # MERGE header fields
"sessionId": sid,
"CompanyCode": "1000",
"DocumentDate": "2026-01-31",
})
call("softstate/do_assignment", {"sessionId": sid}) # derive items
# call("softstate/post", {"sessionId": sid}) # effectivate (when ready)

Fiori Draft

opened = call("draft/open_c_arbankstatement", {})
sid = opened["sessionId"]

# Read the auto-created child rows, fill the first via update:
items = call("draft/read", {"sessionId": sid, "path": "to_Item"})
# call("draft/update_c_arbankstatement_item", { sessionId, key, ...fields }) # fill auto-row
# call("draft/add_c_arbankstatement_item", { sessionId, ...fields }) # extra lines
# call("draft/activate", { "sessionId": sid }) # effectivate
Read before you add

After open, call read on the line navigation (e.g. to_Item) to see the auto-created row. Fill that row with update_*; use add_* only for additional rows (it posts them through the parent navigation for you).

Don't send fields inline at open

Inline/deep-insert payloads on these services are silently ignored or rejected. Open with an (almost) empty body, then set fields with update_* — that is what makes SAP run its determinations.