cancel
Showing results for 
Search instead for 
Did you mean: 

sap_core_getSapChangeNumberOrMaxChangeNumber

0 Kudos

Hi experts!

My scenario is IDM SP9 with SQL 2012

I'm having an error when doing initial load AD

sap_core_getSapChangeNumberOrMaxChangeNumber :: Could Not mskey retrieve mskey value is:

follows the standard script below

// Main function: sap_core_getSapChangeNumberOrMaxChangeNumber

/**

* This function returns either the change number (SAP_CHANGENUMBER) of the user or if not existing the highest change number value of the user.

* @param {mskeyValue} mskey value of the user e.g. USERMSKEYVALUE

* @return {int} change number (SAP_CHANGENUMBER) of the user or if not existing the highest change number value of the user

*/

function sap_core_getSapChangeNumberOrMaxChangeNumber(mskeyValue){

  var idStore = "%$glb.SAP_MASTER_IDS_ID%";

  dbtype="%$ddm.databasetype%"

  nolock="";

  if(dbtype==1) {

  nolock="WITH (NOLOCK)";

  }

  //get mskey for given mskey value

  var mskey = uIS_Get(idStore, mskeyValue);

  if (mskey == null || mskey.indexOf("ERROR") != -1){

  uError("sap_core_getSapChangeNumberOrMaxChangeNumber:: could not retrieve mskey for mskey value: " + mskeyValue);

  uSkip(1);

  }

  var currentChangeNumber = uSelect("SELECT aValue FROM idmv_value_basic_all "+nolock+" where mskey = " + mskey + " and AttrName = 'SAP_CHANGENUMBER'");

  if(currentChangeNumber == null || currentChangeNumber == "") {

  currentChangeNumber = sap_core_getMaxChangeNumber(mskey);

  uInfo("sap_core_getSapChangeNumberOrMaxChangeNumber:: user does not have a SAP_CHANGENUMBER, using now: " + currentChangeNumber);

  } else {

  uInfo("sap_core_getSapChangeNumberOrMaxChangeNumber:: user " + mskeyValue + " has already a SAP_CHANGENUMBER: " + currentChangeNumber);

  }

  return currentChangeNumber;

}

any idea what might be?

Thanks

Leandro

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos
Former Member
0 Kudos

Is this errormessage from the "WriteUsersChangenumber" pass? I thought the usage of the SAP_CHANGENUMBER had been removed from the provisioning framework in SP8 and replaced with context variables.

In any case it seems like the script is unable to find the mskey for one or more %userid% values in the sap%$rep.$NAME%user table. Do you have other errors in the log? Perhaps it failed to create one account and thats why it fails to find the mskeyvalue of it.

Br,

Chris

Former Member
0 Kudos

Is that a direct copy of the error message or typed in?  It doesn't match the script but it looks like you're passing a parameter with no MSKEYVALUE.

Alternatively the message might be thrown by something else thats calling this script.  Either way, I'd modify it to write the input to the log so you can see what's going on.

Peter

former_member2987
Active Contributor
0 Kudos

Hi Leandro!

Was that all there was to the error message?

Matt

0 Kudos

Hi Matt,

This error only appears on sytem log, the job log brought no error log!

Did not generate that log in html

thanks

Leandro