SabBuildMAP - how to get date from SAP HR attribute "Valid End" in account aggregation?

I have a problem disconnecting the identities, they are being deleted automatically, due to the launch with a retroactive date by HR in “SAP HR”, for a solution I am trying to create a “SapBuildMap” connector rule, but I am unable to obtain an End Date “Valid End” at the time of aggregation.

Can you help me please?

Hi @thiagogosantanasi

Welcome to SailPoint Developer community.

Will you be able to share you Rule by removing sensitive data if any, so that we can have a look.

Thanks
Krish

Hi,

I haven’t developed the rule much yet, as I still haven’t been able to obtain the main data I need (Valid End).

I can capture the other data returned by the standard BAPI, such as first and last name, but for the end date the null value (Valid End) is returned.

{
    "description": "Calculates and transforms data from SAP during the aggregation process.",
    "type": "SAPBuildMap",
    "signature": {
        "input": [
            {
                "name": "destination",
                "description": "A connected/ready to use com.sap.conn.jco.JCoDestination object that can be used to call bapi, function modules and call to SAP tables. This is the main object used in making BAPI calls using the JCo interface. This destination object is shared with the connector implementation and the connector controls the destination's lifecycle.",
                "type": null
            },
            {
                "name": "object",
                "description": "A reference to a SailPoint attributes object (basically a Map object with some added convenience methods) that holds the attributes that have been built up by the default connector implementation. The rule should modify this object to change, add or remove attributes from the map.",
                "type": null
            },
            {
                "name": "connector",
                "description": "A reference to the current SAP Connector",
                "type": null
            },
            {
                "name": "state",
                "description": "A Map that can be used to store and share data between executions of this rule during a single aggregation run.",
                "type": null
            },
            {
                "name": "application",
                "description": "The application whose data file is being processed.",
                "type": null
            },
            {
                "name": "schema",
                "description": "A reference to the Schema object for the Delimited File source being read.",
                "type": null
            }
        ],
        "output": null
    },
    "sourceCode": {
        "version": "1.0",
        "script": "  import java.util.HashMap;\r\n\r\nString dEnd = object.get(\"Valid End\");\r\n\r\nlog.info(\"TH-LOGS 01: \"+ dEnd);"
    },
    "attributes": {
        "sourceVersion": "1.0"
    },
    "id": "cxcxfczf45367457",
    "name": "TesteBuild",
    "created": "2023-01-01T13:16:32.454Z",
    "modified": "2023-01-01T14:34:11.747Z"
}

------------------------------------------

import java.util.HashMap;

String dEnd = object.get("Valid End");

log.info("TH-LOGS 01: "+ dEnd);

Then I see it is config issue, check with your SAP application team why IDN is not able to read that attribute.

Hi,

It seems to me that it is normal for the valid end value (VALIDEND) not to appear, I found some rules that look for the value directly from SAP HR, according to the attached function.

// function captures the begin date and end date
  public HashMap getDateData(JCoTable commTable, HashMap commAttrsList, String commType) {
    Date validBegDate = commTable.getDate("VALIDBEGIN");
    Date validEndDate = commTable.getDate("VALIDEND");
    if ( validBegDate != null && validEndDate != null ) {
      if (commType.equals(SUBTYPE_EMAIL)) {
        commAttrsList.put("emailBegin", validBegDate);
        commAttrsList.put("emailEnd", validEndDate);
      } else if (commType.equals(SUBTYPE_PHONE)) {
        commAttrsList.put("phoneBegin", validBegDate);
        commAttrsList.put("phoneEnd", validEndDate);
      }else if (commType.equals(SUBTYPE_SY_USERNAME)) {
        commAttrsList.put("syUserBegin", validBegDate);
        commAttrsList.put("syUserEnd", validEndDate);
      }
    }
    return commAttrsList;
  }

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.