on 06-03-2010 4:17 PM
Hello,
We want to synchronize the Active Directory attribute 'accountExpires' with the field 'GLTGB' in SAP by using the program RSLDAPSYNC_USER.
When running the program the field 'GLTGB' is filled, but in most cases the value is very strange (e.g. 73.67.1290). The input value that is recieved from Active Directory is not a regular date format, but the number of 100-nanosecond intervals since 12:00 AM January 1, 1601 (e.g. 129067739400000000).
Does anyone know how to convert this value in SAP to a format which SAP can read?
Daniella Rebel
I tried to apply the follow code:
v_data_ad = '129076488000000000' " Sample of AD Data
v_data_ad_conv = v_data_ad / ( 60 * 1440 * 10000000 ) - ( 299 * '365.24' ) + 1.
v_data_sap = ''19000101' + v_data_ad_conv.
In excel this formula works fine, but it doesnt work as it should in ABAP, there is a difference between 3 to 4 days.
If you improve it, please let me know.
Regards.
Diovani.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Diovani,
Thanks for your reply.
With the help of a collegue I found a solution: there are function modules to add a duration (for example a number of seconds) to a date and time.
I have used the function module TIMESTAMP_DURATION_ADD and the CONVERT-statement (to convert the result of the function module to my timezone).
See below for an example code:
DATA: seconds(11) TYPE n,
date TYPE sy-datum,
time TYPE uzeit,
output TYPE timestamp.
seconds = strange date value / 10000000.
CALL FUNCTION 'TIMESTAMP_DURATION_ADD'
EXPORTING
TIMESTAMP_IN = 16010101000000
TIMEZONE = 'UTC'
DURATION = seconds
UNIT = 'S'
IMPORTING
TIMESTAMP_OUT = output.
CONVERT time stamp output TIME ZONE sy-zonlo
INTO DATE date TIME time.
Daniëlla
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.