cancel
Showing results for 
Search instead for 
Did you mean: 

[LDAP] SAP user <> LDAP User

guillaume-hrc
Active Contributor
0 Kudos

Hi,

I would like to know if it is possible not to change the LDAP structure (we do not want to additional fields such as sapAccountName...) and still be able to map different SAP Usernames with LDAP users.

I am really struggling to use the MAP_xxx function but with no result so far.

Even tough the mapping yields the expected SAP Username, it is ignored by the RSLDAPSYNC_USER program.

Example:

country = FR

sAMAccountName = MARTIN

--> I would like to generate the FRMART user

I copied the MAP_CONCAT_CHAR and tried to modify it but I am not very familiar with this... (the OPERATION field seems to be a switch for the direction : LDAP --> SAP, SAP --> LDAP, ...)

Thanks in advance for your help.

Best regards,

Guillaume

Accepted Solutions (0)

Answers (1)

Answers (1)

guillaume-hrc
Active Contributor
0 Kudos

Hi,

I managed to build the SAP username from my 2 LDAP fields with something like this

  idx = 1.   " hold the current attribute position
  DO maxcount TIMES.
    CLEAR: wa_val-val,
           valuein.

    LOOP AT fields_ldap INTO wa_fields_ldap.
      idx2 = sy-tabix.

      READ TABLE attributes_ldap INTO wa_attribute_ldap WITH KEY name = wa_fields_ldap-name.

      CLEAR: wa_val,
             wa_offset.
      READ TABLE: wa_attribute_ldap-vals INTO wa_val    INDEX idx,
                  params                 INTO wa_offset INDEX idx2.

      IF wa_offset = '*'.
        CONCATENATE valuein-val wa_val-val              INTO valuein-val RESPECTING BLANKS.
      ELSE.
        CONCATENATE valuein-val wa_val-val+0(wa_offset) INTO valuein-val RESPECTING BLANKS.
      ENDIF.
    ENDLOOP.

    APPEND valuein TO wa_attribute-vals.
    ADD 1 TO idx.
  ENDDO.

but I now face another issue

1) The Export flag for USERNAME-BAPIBNAME is disabled so that it cannot be changed

2) The function is "destructive" by itself: I mean that some information is lost in the way LDAP -> SAP, and the RSLDAPSYNC_USER program is - unfortunately - trying to perform the reciprocal function (??)

Any idea ?

Thanks in advance.

Best regards,

Guillaume