Mapping the SAP Data Fields to Directory Attributes 
In transaction LDAP, choose LDAP Servers.
The system displays the Display View "Server Names": Overview screen.
Switch to change mode and select the directory server for which you want to map fields to attributes.
Choose the Mapping option from the Dialog Structure tree by double-clicking it.
The system displays the Mapping Overview screen (transaction LDAPMAP). The name of the selected logical directory server automatically appears in the Server Name field.
Choose the option for importing the proposal.
This provides a list of all SAP data fields and attributes, so that you only have to adjust the attribute mapping. The LDAP attributes displayed in this list are only an example, you should replace them with the actual values of your connected LDAP directory. You must map at least the following attributes:
User name USERNAME/BAPIBNAME
To define the LDAP attribute that contains the ABAP user ID, proceed as follows:
Go to the Mapping Details screen by choosing Display Details or by double-clicking the second row containing the entry BAPIBNAME.
Replace the default LDAP attribute sapUsername with the corresponding LDAP attribute that contains the ABAP user ID.
SAP roles (ACTIVITYGROUPS/AGR_NAME)
The SAP_ESH_SEARCH end-user role must be assigned to all synchronized users so that they can use SAP NetWeaver Enterprise Search:
Go to the Mapping Details screen by choosing Display Details or by double-clicking the row that contains the entry ACTIVITYGROUPS.
Remove all entries from the SAP System area except the ACTIVITYGROUPS (Table Name)/AGR_NAME (Field Name) entry.
Set the Function Module value to MAP_CONSTANT.
Enter the Enterprise Search user role SAP_ESH_SEARCH under Mapping Parameters in the Parameter field.
Note
If there is no suitable user group available that contains all end users, you can map a suitable LDAP directory field that all the users have in common (for example, company name) to a user group field in the ABAP user store, so that the imported users are all assigned to one user group. Then you can assign the user group to the SAP_ESH_SEARCH role instead of each individual user.
Logon user type (LOGONDATA-USTYP)
The imported users must be assigned the logon user type Communication User, so that these users cannot log on to the SAP NetWeaver Enterprise Search ABAP system directly.
Go to the Mapping Details screen by choosing Display Details or by double-clicking the row that contains the LOGONDATA-USTYP entry.
Set the Function Module value to MAP_CONSTANT.
Enter the value C for Communication User below Mapping Parameters in the Parameter field.
Leave the Mapping Overview by choosing Back.
The system checks and saves your entries.