community.sap_libs.sap_company module – This module will manage a company entities in a SAP S4HANA environment
Note
This module is part of the community.sap_libs collection (version 1.1.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.sap_libs
.
To use it in a playbook, specify: community.sap_libs.sap_company
.
New in version 1.0.0: of community.sap_libs
Synopsis
The community.sap_libs.sap_user module depends on
pyrfc
Python library (version 2.4.0 and upwards). Depending on distribution you are using, you may need to install additional packages to have these available.This module will use the company BAPIs
BAPI_COMPANY_CLONE
andBAPI_COMPANY_DELETE
to manage company entities.
Requirements
The below requirements are needed on the host that executes this module.
pyrfc >= 2.4.0
Parameters
Parameter |
Comments |
---|---|
The city where the company is located. |
|
The client number to connect to. You must quote the value to ensure retaining the leading zeros. Default: “000” |
|
The company id. |
|
The required password for the SAP system. |
|
The required username for the SAP system. |
|
The country code for the company. For example, |
|
General E-Mail address. |
|
The required host for the SAP system. Can be either an FQDN or IP Address. |
|
The company name. |
|
Additional company name. |
|
The post code from the city. |
|
The decision what to do with the company. Choices:
|
|
Street where the company is located. |
|
Street number. |
|
The system number of the SAP system. You must quote the value to ensure retaining the leading zeros. Default: “01” |
|
The timezone. |
Examples
- name: Create SAP Company
community.sap_libs.sap_company:
conn_username: 'DDIC'
conn_password: 'HECtna2021#'
host: 100.0.201.20
sysnr: '01'
client: '000'
state: present
company_id: "Comp_ID"
name: "Test_comp"
name_2: "LTD"
country: "DE"
time_zone: "UTC"
city: "City"
post_code: "12345"
street: "test_street"
street_no: "1"
e_mail: "[email protected]"
# pass in a message and have changed true
- name: Delete SAP Company
community.sap_libs.sap_company:
conn_username: 'DDIC'
conn_password: 'HECtna2021#'
host: 100.0.201.20
sysnr: '01'
client: '000'
state: absent
company_id: "Comp_ID"
name: "Test_comp"
name_2: "LTD"
country: "DE"
time_zone: "UTC"
city: "City"
post_code: "12345"
street: "test_street"
street_no: "1"
e_mail: "[email protected]"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A small execution description. Returned: always Sample: “Company address COMP_ID created” |
|
A complete description of the executed tasks. If this is available. Returned: always Sample: “{ \”RETURN\”: [ { \”FIELD\”: \”\”, \”ID\”: \”01\”, \”LOG_MSG_NO\”: \”000000\”, \”LOG_NO\”: \”\”, \”MESSAGE\”: \”Company address COMP_ID created\”, \”MESSAGE_V1\”: \”COMP_ID\”, \”MESSAGE_V2\”: \”\”, \”MESSAGE_V3\”: \”\”, \”MESSAGE_V4\”: \”\”, \”NUMBER\”: \”078\”, \”PARAMETER\”: \”\”, \”ROW\”: 0, \”SYSTEM\”: \”\”, \”TYPE\”: \”S\” } ] } }” |
Authors
Rainer Leber (@rainerleber)