Reputation: 1926
I am trying to retrieve user photos that are stored in Active Directory with LDAP integration. I want to display pictures in a BSP application. I handled the login operation with the 'LDAP_SIMPLEBIND' function. It is working like a charm. However I cannot get photos. I tried 'LDAP_SEARCH' with this filter:
(&(objectCategory=person)(objectClass=user)(samaccountname=*))
This function is returning "thumbnailphoto" attribute but it is not a byte array that can be converted into jpeg or png file, I think!
Function call:
CALL FUNCTION 'LDAP_SEARCH'
EXPORTING
base = base
* scope = scope
* mode = mode
* CROP = 'X'
filter = filter
* timeout = timeout
* IMPORTING
* LDAPRC = LDAPRC
TABLES
dns_out = lt_dns_out
attrs_io = lt_attrs_io
values_out = lt_vals_out
EXCEPTIONS
no_authoriz = 1
conn_outdate = 2
ldap_failure = 3
not_alive = 4
other_error = 5
OTHERS = 6.
In lt_attrs_io
and lt_vals_out table
, I have two lines about thumbnailphoto. I try to display in other views and in hex format.
For example:
?#???yN?????uF
88218628259840
What am I missing? I cannot find anything on the web about this issue in ABAP. There are some solutions in C#, Java or nodejs, but nothing for ABAP as far as I see.
Upvotes: 2
Views: 1529
Reputation: 10524
The function module LDAP_SEARCH
is marked as obsolete in its documentation. Please use LDAP_READ
and your thumbnailphoto should be available in a convenient form to be read from (XSTRING).
Upvotes: 3