Symptom
You may receive an error "Daylight Saving Time Indicator of parameter DATETIME is not valid" while executing an MDRO in the results section of application log.
Environment
Cloud for customer Addins; Business Bydesign
Reproducing the Issue
- Go to Work Center XXXX. ( XXXX stands for Custom Work Center name).
- Navigate to the view YYYY.( YYYY stands for Custom Work Center view).
- Select the Run ID.
- Choose Schedule to execute the Mass Data Run as Immidiately.
- Open the application log.
- Check the Result section for details
- You will see an error "Daylight Saving Time Indicator of parameter DATETIME is not valid"
Cause
The error is occurring while trying to execute custom logic as you have not set the value of daylightSavingTimeIndicator for this.OldLastRunDate and is calling 'this.OldLastRunDate.ConvertToGlobalDateTime() with daylightSavingTimeIndicator not correctly set for the corresponding input value.
Note - Reuse library function LocalDateTime.ConvertToGlobalDateTime does not automatically set daylightSavingTimeIndicator.This is the expected behavior.
You can raise a new requirement request for automatic calculation of daylightSavingTimeIndicator in LocalDateTime.ConvertToGlobalDateTime or a similar API for the same, via the Influence Portal (links are mentioned below for Influence Portal ).
https://influence.sap.com/sap/ino/#/campaign/1868
https://influence.sap.com/sap/ino/#/campaign/1867
Based on voting and feedback our product development team will condiser this in on of the future releases.
Resolution
As a work around, you have to first use LocalDateTime.ParseFromString and then call ConvertToGlobalDateTime()
You can prepare a string from the input value in this.OldLastRunDate(for eg: string as "20191015120000 CET").
This string can be passed as input to LocalDateTime.ParseFromString. Further,the output from LocalDateTime.ParseFromString can be passed as input to LocalDateTime.ConvertToGlobalDateTime.
******************************************************************************
Sample code snippet(just for an example)
var string_123 = this.LastRunDate.content.ToString() + " " + this.LastRunDate.timeZoneCode ;
var mno = LocalDateTime.ParseFromString(string_123);
mno.ConvertToGlobalDateTime();
*******************************************************************************
Note: The above mentioned example is just for the purpose of explanation to you . Please try out a similar logic,test it thoroughly before releasing the code and using it productively.
See Also
Please refer to SAP Help documentation Section 7.2.5.1.11 and refer to example given there for LocalDateTime.ConvertToGlobalDateTime for more details.
Keywords
MRD run hangs;Daylight Saving Time Indicator of parameter DATETIME is not valid;MDR failed. , KBA , day light saving indicator , mdr fails , AP-RC-BDS-MDR , ByDesign Studio Mass Data Run , Problem