saltext.sap_nwabap._modules.sap_nwabap#

SaltStack extension for SAP NetWeaver AS ABAP Copyright (C) 2022 SAP UCC Magdeburg

SAP NetWeaver AS ABAP execution module#

SaltStack execution module for SAP NetWeaver AS ABAP.

codeauthor

Benjamin Wegener, Alexander Wilke

maturity

new

depends

pyrfc

platform

All

This module implements functions for SAP NetWeaver utilizing the SAP NetWeaver RFC SDK and the python wrapper pyrfc.

saltext.sap_nwabap._modules.sap_nwabap.__virtual__()[source]#

Only load this module if all libraries are available

saltext.sap_nwabap._modules.sap_nwabap.process_bapiret2(ret)[source]#

Processes the returned BAPIRET2 table

ret

BAPIRET2 return table

CLI Example:

salt "*" sap_nwabap.process_bapiret2 ret='{...}'
saltext.sap_nwabap._modules.sap_nwabap.call_fms(function_modules, sid=None, client=None, message_server_host=None, message_server_port=None, logon_group=None, username=None, password=None, conn=None, continue_on_error=False, raise_on_error=False, **kwargs)[source]#

Calls multiple function modules in sequence with the same connection. Required for calls like BAPI_USER_CHANGE -> BAPI_TRANSACTION_COMMIT.

function_modules should be a dictionary with:

{
    "<function module>": {
        "<arg_name>": "<arg_value>",
        ...
    },
    ...
}

The function will return two values, execution success (True/False) and result of the function modules as a dict, if there are any.

function_modules

Function modules and parameters to execute.

sid

SID of the SAP system (optional if a connection is given).

message_server_host

Host of the message server (optional if a connection is given).

message_server_port

Port of the message server (optional if a connection is given).

client

Client to connect to (optional if a connection is given).

logon_group

Logon group to use (optional if a connection is given).

username

Username (optional if a connection is given).

password

Password (optional if a connection is given).

conn

Existing pyrfc connection to user (optional if the parameters above are given).

continue_on_error

Continue with the execution of the next function module (True|False), default is False. Not evaluated if raise_on_error=True.

raise_on_error

Raise an exception (True|False) when an error occurs, default is False.

CLI Example:

salt "*" sap_nwabap.call_fms function_modules='{"RFC_PING": {}}' sid="S4H" client="000" message_server_host="s4h" message_server_port="3600" logon_group="SPACE" username="DDIC" password="Abcd1234$"
saltext.sap_nwabap._modules.sap_nwabap.ping(sid, message_server_host, message_server_port, client, logon_group, username, password, **kwargs)[source]#

Calls the function module RFC_PING.

sid

SID of the SAP system.

message_server_host

Host of the message server.

message_server_port

Port of the message server.

client

Client to connect to.

logon_group

Logon group to use.

username

Username to use for the connection.

password

Password to use for the connection.

CLI Example:

salt "*" sap_nwabap.ping sid="S4H" client="000" message_server_host="s4h" message_server_port="3600" logon_group="SPACE" username="DDIC" password="Abcd1234$"
saltext.sap_nwabap._modules.sap_nwabap.read_table(table_name, fields=None, sid=None, client=None, message_server_host=None, message_server_port=None, logon_group=None, username=None, password=None, conn=None, delimiter=';', **kwargs)[source]#

Reads and returns an ABAP table as list of dicts.

Note

All read fields may only have a combined length of 512 characters. If you want to retrieve more data, you need to call this function multiple times. This is a restriction by the function modules RFC_GET_TABLE_ENTRIES and RFC_READ_TABLE.

table_name

Name of the table to read.

fields

Fields that should be retrieved. All will be retrieved if no list is given.

sid

SID of the SAP system (optional if a connection is given).

message_server_host

Host of the message server (optional if a connection is given).

message_server_port

Port of the message server (optional if a connection is given).

client

Client to connect to (optional if a connection is given).

logon_group

Logon group to use (optional if a connection is given).

username

Username (optional if a connection is given).

password

Password (optional if a connection is given).

conn

Existing pyrfc connection to user (optional if the parameters above are given).

delimiter

Delimiter to use for the function module RFC_READ_TABLE, default is ;.

CLI Example:

salt "*" sap_nwabap.read_table table_name="SLDAGADM" fields='["PROGNAME", "ACTIVE", "SEQNR", "RFCDEST", "DORFC", "DOBTC", "BTCMIN"]' sid="S4H" client="000" message_server_host="s4h" message_server_port="3600" logon_group="SPACE" username="DDIC" password="Abcd1234$"