community.sap.sap_company (1.0.0) — module

This module will manage a company entities in a SAP S4HANA environment

| "added in version" 1.0.0 of community.sap"

Authors: Rainer Leber (@rainerleber)

Install collection

Install with ansible-galaxy collection install community.sap:==1.0.0


Add to requirements.yml

  collections:
    - name: community.sap
      version: 1.0.0

Description

The M(community.sap.sap_user) module depends on C(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 C(BAPI_COMPANY_CLONE) and C(BAPI_COMPANY_DELETE) to manage company entities.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create SAP Company
  community.sap.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: "test@test.de"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# pass in a message and have changed true
- name: Delete SAP Company
  community.sap.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: "test@test.de"

Inputs

    
city:
    description: The city where the company is located.
    required: false
    type: str

host:
    description: The required host for the SAP system. Can be either an FQDN or IP Address.
    required: true
    type: str

name:
    description: The company name.
    required: false
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - The decision what to do with the company.
    required: false
    type: str

sysnr:
    default: '01'
    description:
    - The system number of the SAP system.
    - You must quote the value to ensure retaining the leading zeros.
    required: false
    type: str

client:
    default: '000'
    description:
    - The client number to connect to.
    - You must quote the value to ensure retaining the leading zeros.
    required: false
    type: str

e_mail:
    description: General E-Mail address.
    required: false
    type: str

name_2:
    description: Additional company name.
    required: false
    type: str

street:
    description: Street where the company is located.
    required: false
    type: str

country:
    description: The country code for the company. For example, C('DE').
    required: false
    type: str

post_code:
    description: The post code from the city.
    required: false
    type: str

street_no:
    description: Street number.
    required: false
    type: str

time_zone:
    description: The timezone.
    required: false
    type: str

company_id:
    description: The company id.
    required: true
    type: str

conn_password:
    description: The required password for the SAP system.
    required: true
    type: str

conn_username:
    description: The required username for the SAP system.
    required: true
    type: str

Outputs

msg:
  description: A small execution description.
  returned: always
  sample: Company address COMP_ID created
  type: str
out:
  description: A complete description of the executed tasks. If this is available.
  elements: dict
  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" } ] } }'
  type: list