Menu

41KB JavaScript snippet created on August 4, 2022.

{
    "name": "Block Duplicates",
    "flow": [
        {
            "id": 10,
            "module": "celonis:celonisTrigger",
            "version": 3,
            "parameters": {
                "__IMTHOOK__": 593
            },
            "mapper": {},
            "metadata": {
                "designer": {
                    "x": -18,
                    "y": -56
                },
                "restore": {
                    "__IMTHOOK__": {
                        "label": "My Celonis Trigger webhook"
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTHOOK__",
                        "type": "hook",
                        "label": "Webhook",
                        "required": true
                    }
                ]
            }
        },
        {
            "id": 11,
            "module": "celonis:queryData",
            "version": 3,
            "parameters": {
                "__IMTCONN__": 3767
            },
            "mapper": {
                "dataPool": "64836bfd-f7e6-42a2-82b7-daa5c7e40b21",
                "columns": [
                    {
                        "formula": "\"BSEG\".\"MANDT\"",
                        "sorting": "none",
                        "columnName": "MANDT"
                    },
                    {
                        "formula": "\"BSEG\".\"BUKRS\"",
                        "sorting": "none",
                        "columnName": "BUKRS"
                    },
                    {
                        "formula": "\"BSEG\".\"GJAHR\"",
                        "sorting": "none",
                        "columnName": "GJAHR"
                    },
                    {
                        "formula": "\"BSEG\".\"BELNR\"",
                        "sorting": "none",
                        "columnName": "BELNR"
                    },
                    {
                        "formula": "\"BSEG\".\"BUZEI\"",
                        "sorting": "none",
                        "columnName": "BUZEI"
                    }
                ],
                "filter": [
                    {
                        "filterName": "Remove automatic reversals ",
                        "filterExpression": "FILTER \"DUPLICATE_INVOICES\".\"GROUP_STATUS\" = 'Possible Duplicate' "
                    },
                    {
                        "filterName": "Remove Manual Reversals ",
                        "filterExpression": "FILTER  PU_SUM (\"GROUPS_DUPLICATE_INVOICES\",  CASE WHEN      \"BSEG\".\"SHKZG\" = 'H' THEN      \"BSEG\".\"WRBTR\" ELSE 0 -      \"BSEG\".\"WRBTR\" END)          >  PU_MAX (\"GROUPS_DUPLICATE_INVOICES\",  CASE WHEN      \"BSEG\".\"SHKZG\" = 'H' THEN      \"BSEG\".\"WRBTR\" ELSE 0 -      \"BSEG\".\"WRBTR\" END) "
                    },
                    {
                        "filterName": "Filter correct invoice",
                        "filterExpression": "FILTER \"GROUPS_DUPLICATE_INVOICES\".\"GROUP_UUID\" = '{{10.jsonData.record_id}}'; "
                    }
                ],
                "limit": "50",
                "dataModel": "e3aafaa2-5b90-489c-aeb5-b21ecfc99591"
            },
            "metadata": {
                "designer": {
                    "x": 270,
                    "y": -57
                },
                "restore": {
                    "__IMTCONN__": {
                        "label": "My Celonis User connection "
                    },
                    "dataPool": {
                        "mode": "chose",
                        "label": "SAP ECC - A/P Execution App - Duplicate Checking Module - Restore"
                    },
                    "columns": {
                        "mode": "chose",
                        "items": [
                            {
                                "sorting": {
                                    "mode": "chose",
                                    "label": "None (Default)"
                                }
                            },
                            {
                                "sorting": {
                                    "mode": "chose",
                                    "label": "None (Default)"
                                }
                            },
                            {
                                "sorting": {
                                    "mode": "chose",
                                    "label": "None (Default)"
                                }
                            },
                            {
                                "sorting": {
                                    "mode": "chose",
                                    "label": "None (Default)"
                                }
                            },
                            {
                                "sorting": {
                                    "mode": "chose",
                                    "label": "None (Default)"
                                }
                            }
                        ]
                    },
                    "filter": {
                        "mode": "chose",
                        "items": [
                            "undefined",
                            "undefined",
                            "undefined"
                        ]
                    },
                    "dataModel": {
                        "mode": "chose",
                        "label": "SAP ECC - Analytical (FI open + cleared)"
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTCONN__",
                        "type": "account",
                        "label": "Connection",
                        "required": true
                    }
                ],
                "expect": [
                    {
                        "name": "dataPool",
                        "type": "select",
                        "label": "Data Pool",
                        "required": true
                    },
                    {
                        "name": "columns",
                        "spec": [
                            {
                                "name": "columnName",
                                "type": "text",
                                "label": "Column Name"
                            },
                            {
                                "name": "formula",
                                "type": "text",
                                "label": "Formula",
                                "required": true
                            },
                            {
                                "name": "sorting",
                                "type": "select",
                                "label": "Column Sorting",
                                "required": true,
                                "options": [
                                    {
                                        "label": "None (Default)",
                                        "value": "none"
                                    },
                                    {
                                        "label": "Ascending",
                                        "value": "ASC"
                                    },
                                    {
                                        "label": "Descending",
                                        "value": "DESC"
                                    }
                                ]
                            }
                        ],
                        "type": "array",
                        "label": "Columns",
                        "labels": {
                            "add": "Add Column"
                        },
                        "required": true,
                        "sequence": true
                    },
                    {
                        "name": "filter",
                        "spec": [
                            {
                                "name": "filterName",
                                "type": "text",
                                "label": "Filter Name"
                            },
                            {
                                "name": "filterExpression",
                                "type": "text",
                                "label": "Filter Expression",
                                "required": true
                            }
                        ],
                        "type": "array",
                        "label": "Filter",
                        "labels": {
                            "add": "Add Filter"
                        }
                    },
                    {
                        "name": "limit",
                        "type": "integer",
                        "label": "Row Limit"
                    },
                    {
                        "name": "dataModel",
                        "type": "select",
                        "label": "Data Model",
                        "required": true
                    }
                ],
                "interface": [
                    {
                        "name": "MANDT",
                        "label": "MANDT",
                        "type": "text"
                    },
                    {
                        "name": "BUKRS",
                        "label": "BUKRS",
                        "type": "text"
                    },
                    {
                        "name": "GJAHR",
                        "label": "GJAHR",
                        "type": "text"
                    },
                    {
                        "name": "BELNR",
                        "label": "BELNR",
                        "type": "text"
                    },
                    {
                        "name": "BUZEI",
                        "label": "BUZEI",
                        "type": "text"
                    }
                ]
            }
        },
        {
            "id": 12,
            "module": "sap:generic",
            "version": 2,
            "parameters": {
                "__IMTCONN__": 3925
            },
            "mapper": {
                "rfm": "/CELONIS/FI_DOCUMENT_CHANGE",
                "IV_AWORG": " ",
                "IV_AWSYS": " ",
                "IV_BELNR": "{{11.BELNR}}",
                "IV_BSEGC": {},
                "IV_BUKRS": "{{11.BUKRS}}",
                "IV_BUZEI": "{{11.BUZEI}}",
                "IV_GJAHR": "{{11.GJAHR}}",
                "IV_KUNNR": " ",
                "IV_LIFNR": " ",
                "IV_OBZEI": " ",
                "IT_ACCCHG": [
                    {
                        "FDNAME": "ZLSPR",
                        "NEWVAL": "C"
                    }
                ],
                "bapiTransactionHandling": "COMMIT"
            },
            "metadata": {
                "designer": {
                    "x": 584,
                    "y": -60
                },
                "restore": {
                    "IT_ACCCHG": {
                        "mode": "chose",
                        "items": [
                            "undefined"
                        ]
                    },
                    "__IMTCONN__": {
                        "label": "My SAP connection"
                    },
                    "bapiTransactionHandling": {
                        "mode": "chose",
                        "label": "Commit"
                    }
                },
                "parameters": [
                    {
                        "name": "__IMTCONN__",
                        "type": "account",
                        "label": "Connection",
                        "required": true
                    }
                ],
                "expect": [
                    {
                        "name": "customErrorHandling",
                        "type": "boolean",
                        "label": "Custom Error Handling"
                    },
                    {
                        "name": "rfm",
                        "type": "text",
                        "label": "Remote Function Module",
                        "nested": "rpc://sap/2/getFunctionInputs",
                        "required": true
                    },
                    {
                        "name": "bapiTransactionHandling",
                        "type": "select",
                        "label": "BAPI Transaction Handling",
                        "validate": {
                            "enum": [
                                "COMMIT",
                                "COMMIT_AND_WAIT",
                                "NONE"
                            ]
                        }
                    },
                    {
                        "name": "IV_AWORG",
                        "type": "text",
                        "validate": {
                            "max": 10
                        }
                    },
                    {
                        "name": "IV_AWREF",
                        "type": "text",
                        "validate": {
                            "max": 10
                        }
                    },
                    {
                        "name": "IV_AWSYS",
                        "type": "text",
                        "validate": {
                            "max": 10
                        }
                    },
                    {
                        "name": "IV_AWTYP",
                        "type": "text",
                        "validate": {
                            "max": 5
                        }
                    },
                    {
                        "name": "IV_BELNR",
                        "type": "text",
                        "validate": {
                            "max": 10
                        }
                    },
                    {
                        "name": "IV_BUKRS",
                        "type": "text",
                        "validate": {
                            "max": 4
                        }
                    },
                    {
                        "name": "IV_BUZEI",
                        "type": "text",
                        "validate": {
                            "max": 3
                        }
                    },
                    {
                        "name": "IV_GJAHR",
                        "type": "text",
                        "validate": {
                            "max": 4
                        }
                    },
                    {
                        "name": "IV_KUNNR",
                        "type": "text",
                        "validate": {
                            "max": 10
                        }
                    },
                    {
                        "name": "IV_LIFNR",
                        "type": "text",
                        "validate": {
                            "max": 10
                        }
                    },
                    {
                        "name": "IV_LOCK",
                        "type": "text",
                        "validate": {
                            "max": 1
                        }
                    },
                    {
                        "name": "IV_OBZEI",
                        "type": "text",
                        "validate": {
                            "max": 3
                        }
                    },
                    {
                        "name": "IT_ACCCHG",
                        "spec": [
                            {
                                "name": "FDNAME",
                                "type": "text",
                                "validate": {
                                    "max": 30
                                }
                            },
                            {
                                "name": "OLDVAL",
                                "type": "text",
                                "validate": {
                                    "max": 50
                                }
                            },
                            {
                                "name": "NEWVAL",
                                "type": "text",
                                "validate": {
                                    "max": 50
                                }
                            }
                        ],
                        "type": "array"
                    },
                    {
                        "name": "IV_BSEGC",
                        "spec": [
                            {
                                "name": "MANDT",
                                "type": "text",
                                "validate": {
                                    "max": 3
                                }
                            },
                            {
                                "name": "BUKRS",
                                "type": "text",
                                "validate": {
                                    "max": 4
                                }
                            },
                            {
                                "name": "BELNR",
                                "type": "text",
                                "validate": {
                                    "max": 10
                                }
                            },
                            {
                                "name": "GJAHR",
                                "type": "text",
                                "validate": {
                                    "max": 4
                                }
                            },
                            {
                                "name": "RFZEI",
                                "type": "text",
                                "validate": {
                                    "max": 3
                                }
                            },
                            {
                                "name": "CCINS",
                                "type": "text",
                                "validate": {
                                    "max": 4
                                }
                            },
                            {
                                "name": "CCNUM",
                                "type": "text",
                                "validate": {
                                    "max": 25
                                }
                            },
                            {
                                "name": "CCFOL",
                                "type": "text",
                                "validate": {
                                    "max": 10
                                }
                            },
                            {
                                "name": "DATAB",
                                "type": "text",
                                "validate": {
                                    "min": 8
                                }
                            },
                            {
                                "name": "DATBI",
                                "type": "text",
                                "validate": {
                                    "min": 8
                                }
                            },
                            {
                                "name": "CCNAME",
                                "type": "text",
                                "validate": {
                                    "max": 40
                                }
                            },
                            {
                                "name": "CSOUR",
                                "type": "text",
                                "validate": {
                                    "max": 1
                                }
                            },
                            {
                                "name": "AUTWR",
                                "type": "text",
                                "validate": {
                                    "max": 11
                                }
                            },
                            {
                                "name": "CCWAE",
                                "type": "text",
                                "validate": {
                                    "max": 5
                                }
                            },
                            {
                                "name": "SETTL",
                                "type": "text",
                                "validate": {
                                    "max": 1
                                }
                            },
                            {
                                "name": "AUNUM",
                                "type": "text",
                                "validate": {
                                    "max": 10
                                }
                            },
                            {
                                "name": "AUTRA",
                                "type": "text",
                                "validate": {
                                    "max": 15
                                }
                            },
                            {
                                "name": "AUDAT",
                                "type": "text",
                                "validate": {
                                    "min": 8
                                }
                            },
                            {
                                "name": "AUTIM",
                                "type": "text",
                                "validate": {
                                    "min": 6
                                }
                            },
                            {
                                "name": "MERCH",
                                "type": "text",
                                "validate": {
                                    "max": 15
                                }
                            },
                            {
                                "name": "LOCID",
                                "type": "text",
                                "validate": {
                                    "max": 10
                                }
                            },
                            {
                                "name": "TRMID",
                                "type": "text",
                                "validate": {
                                    "max": 10
                                }
                            },
                            {
                                "name": "CCBTC",
                                "type": "text",
                                "validate": {
                                    "max": 10
                                }
                            },
                            {
                                "name": "CCTYP",
                                "type": "text",
                                "validate": {
                                    "max": 2
                                }
                            },
                            {
                                "name": "CCARD_GUID",
                                "type": "text",
                                "validate": {
                                    "max": 32
                                }
                            },
                            {
                                "name": "SETRA",
                                "type": "text",
                                "validate": {
                                    "max": 15
                                }
                            },
                            {
                                "name": "RCAVR",
                                "type": "text",
                                "validate": {
                                    "max": 4
                                }
                            },
                            {
                                "name": "RCAVA",
                                "type": "text",
                                "validate": {
                                    "max": 4
                                }
                            },
                            {
                                "name": "RCAVZ",
                                "type": "text",
                                "validate": {
                                    "max": 4
                                }
                            },
                            {
                                "name": "RCRSP",
                                "type": "text",
                                "validate": {
                                    "max": 4
                                }
                            },
                            {
                                "name": "RTEXT",
                                "type": "text",
                                "validate": {
                                    "max": 40
                                }
                            },
                            {
                                "name": "REACT",
                                "type": "text",
                                "validate": {
                                    "max": 1
                                }
                            },
                            {
                                "name": "KUNNR",
                                "type": "text",
                                "validate": {
                                    "max": 10
                                }
                            },
                            {
                                "name": "OPBEL",
                                "type": "text",
                                "validate": {
                                    "max": 10
                                }
                            }
                        ],
                        "type": "collection",
                        "label": "IV_BSEGC"
                    }
                ],
                "interface": [
                    {
                        "help": "General Flag",
                        "name": "EV_RES",
                        "type": "text"
                    },
                    {
                        "help": "Reference Organizational Units",
                        "name": "IV_AWORG",
                        "type": "text"
                    },
                    {
                        "help": "Reference Document Number",
                        "name": "IV_AWREF",
                        "type": "text"
                    },
                    {
                        "help": "Logical System",
                        "name": "IV_AWSYS",
                        "type": "text"
                    },
                    {
                        "help": "Reference Transaction",
                        "name": "IV_AWTYP",
                        "type": "text"
                    },
                    {
                        "help": "Accounting Document Number",
                        "name": "IV_BELNR",
                        "type": "text"
                    },
                    {
                        "help": "Company Code",
                        "name": "IV_BUKRS",
                        "type": "text"
                    },
                    {
                        "help": "Number of Line Item Within Accounting Document",
                        "name": "IV_BUZEI",
                        "type": "text"
                    },
                    {
                        "help": "Fiscal Year",
                        "name": "IV_GJAHR",
                        "type": "text"
                    },
                    {
                        "help": "Customer Number",
                        "name": "IV_KUNNR",
                        "type": "text"
                    },
                    {
                        "help": "Account Number of Vendor or Creditor",
                        "name": "IV_LIFNR",
                        "type": "text"
                    },
                    {
                        "help": "Data Element for Domain BOOLE: TRUE (='X') and FALSE (=' ')",
                        "name": "IV_LOCK",
                        "type": "text"
                    },
                    {
                        "help": "Number of Line Item in Original Document",
                        "name": "IV_OBZEI",
                        "type": "text"
                    },
                    {
                        "help": "Return Parameter",
                        "name": "ES_MSG",
                        "spec": [
                            {
                                "help": "Message Type: S Success, E Error, W Warning, I Info, a Abort",
                                "name": "TYPE",
                                "type": "text"
                            },
                            {
                                "help": "Message Class",
                                "name": "ID",
                                "type": "text"
                            },
                            {
                                "help": "Message Number",
                                "name": "NUMBER",
                                "type": "text"
                            },
                            {
                                "help": "Message Text",
                                "name": "MESSAGE",
                                "type": "text"
                            },
                            {
                                "help": "Application Log: Log Number",
                                "name": "LOG_NO",
                                "type": "text"
                            },
                            {
                                "help": "Application Log: Internal Message Serial Number",
                                "name": "LOG_MSG_NO",
                                "type": "text"
                            },
                            {
                                "help": "Message Variable",
                                "name": "MESSAGE_V1",
                                "type": "text"
                            },
                            {
                                "help": "Message Variable",
                                "name": "MESSAGE_V2",
                                "type": "text"
                            },
                            {
                                "help": "Message Variable",
                                "name": "MESSAGE_V3",
                                "type": "text"
                            },
                            {
                                "help": "Message Variable",
                                "name": "MESSAGE_V4",
                                "type": "text"
                            },
                            {
                                "help": "Parameter Name",
                                "name": "PARAMETER",
                                "type": "text"
                            },
                            {
                                "help": "Lines in Parameter",
                                "name": "ROW",
                                "type": "text"
                            },
                            {
                                "help": "Field in Parameter",
                                "name": "FIELD",
                                "type": "text"
                            },
                            {
                                "help": "Logical System from Which Message Originates",
                                "name": "SYSTEM",
                                "type": "text"
                            }
                        ],
                        "type": "collection"
                    },
                    {
                        "help": "Changes in an FI Document",
                        "name": "IT_ACCCHG",
                        "spec": [
                            {
                                "help": "Field Name",
                                "name": "FDNAME",
                                "type": "text"
                            },
                            {
                                "help": "Receipt: Old Field Contents",
                                "name": "OLDVAL",
                                "type": "text"
                            },
                            {
                                "help": "Receipt: New Field Contents",
                                "name": "NEWVAL",
                                "type": "text"
                            }
                        ],
                        "type": "array"
                    },
                    {
                        "help": "Document: Data on Payment Card Payments",
                        "name": "IV_BSEGC",
                        "spec": [
                            {
                                "help": "Client",
                                "name": "MANDT",
                                "type": "text"
                            },
                            {
                                "help": "Company Code",
                                "name": "BUKRS",
                                "type": "text"
                            },
                            {
                                "help": "Accounting Document Number",
                                "name": "BELNR",
                                "type": "text"
                            },
                            {
                                "help": "Fiscal Year",
                                "name": "GJAHR",
                                "type": "text"
                            },
                            {
                                "help": "Payment Card Item",
                                "name": "RFZEI",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Card Type",
                                "name": "CCINS",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Card Number",
                                "name": "CCNUM",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Payment Card Suffix",
                                "name": "CCFOL",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Valid from",
                                "name": "DATAB",
                                "type": "date"
                            },
                            {
                                "help": "Payment Cards: Valid to",
                                "name": "DATBI",
                                "type": "date"
                            },
                            {
                                "help": "Payment Cards: Name of Cardholder",
                                "name": "CCNAME",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Entry Mode",
                                "name": "CSOUR",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Authorized Amount",
                                "name": "AUTWR",
                                "type": "text"
                            },
                            {
                                "help": "Currency Key",
                                "name": "CCWAE",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Settlement Carried Out",
                                "name": "SETTL",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Authorization Number",
                                "name": "AUNUM",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Authoriz. Reference Code of Clearing House",
                                "name": "AUTRA",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Authorization Date",
                                "name": "AUDAT",
                                "type": "date"
                            },
                            {
                                "help": "Payment Cards: Authorization Time",
                                "name": "AUTIM",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Merchant ID at the Clearing House",
                                "name": "MERCH",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Point of Receipt for the Transaction",
                                "name": "LOCID",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Terminal",
                                "name": "TRMID",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Settlement Run",
                                "name": "CCBTC",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Card Category",
                                "name": "CCTYP",
                                "type": "text"
                            },
                            {
                                "help": "Reference to Encrypted Payment Card Data",
                                "name": "CCARD_GUID",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Settlement Reference No. of Clearing House",
                                "name": "SETRA",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Result of Address Check (Address Result)",
                                "name": "RCAVR",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Result of Address Check (Address Approval)",
                                "name": "RCAVA",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Result of Address Check (ZIP Code Result)",
                                "name": "RCAVZ",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Result of Card Check (Response Code)",
                                "name": "RCRSP",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Result Text",
                                "name": "RTEXT",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Response to Settlement Result",
                                "name": "REACT",
                                "type": "text"
                            },
                            {
                                "help": "Customer Number",
                                "name": "KUNNR",
                                "type": "text"
                            },
                            {
                                "help": "Payment Cards: Document Number of Reopened Receivable",
                                "name": "OPBEL",
                                "type": "text"
                            }
                        ],
                        "type": "collection"
                    }
                ]
            }
        }
    ],
    "metadata": {
        "instant": false,
        "version": 1,
        "scenario": {
            "roundtrips": 10,
            "maxErrors": 3,
            "autoCommit": true,
            "autoCommitTriggerLast": true,
            "sequential": false,
            "confidential": false,
            "dataloss": false,
            "dlq": false
        },
        "designer": {
            "orphans": []
        },
        "zone": "integromat.eu-3.k8s.celonis.cloud"
    }
}