Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with LDAP connector

Former Member
0 Kudos
2,941

Hi ,

We have done all the required configuration for LDAP and we are able to connecto to active directory.

But when I trying to hit "FIND" button it says "LDAP server is not active".

Hitting "FIND" button in LDAP is equvivalent to using function module "LDAP_SEARCH".

My aim is to read all the relavant entires ( based on a filter ) and update a custom table.

How can I over the error? Am i missing some config?

Has any one faced a similar situation?

Thanks,

krishna

14 REPLIES 14

Former Member
0 Kudos
647

Hello,

I am having a similar problem with an LDAP connection. The LDAP Active Directory has been configured and we are able to connect.

When executing a test of sending data (execution of RPLDAP_EXTRACT) I am receiving a "LDAP server is not active". Stepping through the code in de-bug mode I find that function 'LDAP_SEARCH' is called, then an attempt to call 'LDAPRFC_SEARCH' is done. This function (LDAPRFC_SEARCH) does NOT exist in our development system.

This is strange because when stopping the program in Function 'LDAP_SEARCH' and checking the return code 'ldaprc' BEFORE attempting to call 'LDAPRFC_SEARCH this is set to '0'. After checking the code at the next statement below 'LDAPRFC_SEARCH, the return code 'ldaprc' IS NOW SET TO '81' - 'LDAP server is not active'.

Any responses or suggestions would be appreciated.

Thanks,

Bill

RahulKeshav
Active Contributor
0 Kudos
647

hi ALL,

whr r the sdn experts...

i m another victim of this problem.....

plz help me on this....

in my case.....

Operation failed

Message no. LDAPRC001

Diagnosis

This is an error message that is triggered by the directory server.

It is not possible to analyze the error in the SAP system.

Procedure

Check the log files for the directory server (if they exist), to see if they contain more information.

now how to deal with this...

wt does that mean...

rohit

rainer_hbenthal
Active Contributor
0 Kudos
647

DID you configure the tcpip connection in TA SM59 correct? What settiungs did you enter there? The program ldap_rfc is registered as a server program?

MDMP and unicode settings are correct?

0 Kudos
647

Hi RH,

we have created RFC des...program ldap_rfc is registered as a server program...

and we have givn the gateway Host and gateway service as our sap server's has...(do we use LDAP server's Details ,plz confirm)

while Connection Test it is successful...

i dont knw abt MDMP & unicode....but while exicuting unicode ,it says Target is a unicode system (character size 2)...

plz help me on that...

thnx Rohit

Edited by: Rohit Kumar on Aug 28, 2008 1:14 PM

Edited by: Rohit Kumar on Aug 28, 2008 1:16 PM

0 Kudos
647

Goto to the MDMP&Unicode Tab in SM59 of your tcpip connection. Set unicode to true. save and exit.

go to ta LDAP. Click on LDAP SERVERS

you need to have the hostname of your ldap server there.

doucleclick on the servername. in the following screen you need to enter the hostname, the port, the type of ldap directory (java, MS AD, Sun or whatever) and the right ldap protocol. Ask your basis guays for the correct values.

0 Kudos
647

Thnx for reply RH...

regarding MDMP&Unicode Tab in SM59 ....you mean to say that under "Communication type with target system" Block -


select unicode radiobutton...

if that so ....i did that ...on your suggestion.....

and regarding LDAP server its already done...

do we have to do some configuration or any setup in LDAP server????

as error message is showing... "This is an error message that is triggered by the directory server"

plz help me.....

Edited by: Rohit Kumar on Aug 28, 2008 3:41 PM

0 Kudos
647

You need to specify which kind of ldap server you are using and the protocol. If you configured your ldap transaction as SUN 5.2 you can connect to an AD server but the questionnaire will fail.

It will fail if the ldap protocol isnt the same. Read again my posting concerning the transaction ldap, ask your gurus what kind of ldap server you have, which protocol it is uning,m which hostname does it have and what type it is.

0 Kudos
647

I got it ...

thnx a lot RH...

now i can view the ldap data thru my sap LDAP transaction.....

now the next thing is to read those data and get it into internal file.....

can you help me in that....because ther are some FM's but which/when to call...

as thy are nowhere use in sap std program.....i tried to find thru where use list....but no result...so plz help me on that...

Thnx once again RH....

Rohit

0 Kudos
647

to connect to the LDAP server via abap, use FM LDAP_SIMPLEBIND

to read from the LDAP server use FM LDAP_READ

to disconnect from the LDAP server use FM LDAP_UNBIND

the best thing is to build a small sample report using these three function modules and then debug the table you're getting from FM LDAP_READ

you will get tables in tables in tables and it is a little bit tricky to get the data out there. If you study the table in the debugger you will see where you desired information is.

this one will work fine:



report  z_ldap.

data:
  it_ldap type ldapetab.

call function 'LDAP_SIMPLEBIND'
  exporting
    serverid           = 'LDAP'
*   USR                = ''
*   PWD                = ''
*   USR_STRING         =
*   PWD_STRING         =
*   WAIT_TIME          = 0
* IMPORTING
*   LDAPRC             =
* CHANGING
*   HOLDSESS           = 0
  exceptions
    no_authoriz        = 1
    config_error       = 2
    nomore_conns       = 3
    ldap_failure       = 4
    not_alive          = 5
    other_error        = 6
    others             = 7
          .
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.

call function 'LDAP_READ'
  exporting
    base                = 'o=something'
*   BASE_STRING         =
    scope               = 2
    filter              = 'something else'
*   FILTER_STRING       =
*   TIMEOUT             =
*   ATTRIBUTES          =
  importing
*   LDAPRC              =
    entries             = it_ldap
  exceptions
    no_authoriz         = 1
    conn_outdate        = 2
    ldap_failure        = 3
    not_alive           = 4
    other_error         = 5
    others              = 6
          .
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.

call function 'LDAP_UNBIND'
* IMPORTING
*   LDAPRC             =
  exceptions
    conn_outdate       = 1
    ldap_failure       = 2
    not_alive          = 3
    other_error        = 4
    others             = 5
          .
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.

you have to change the base and filter.

hope that helps

Edited by: Rainer Hübenthal on Aug 28, 2008 2:57 PM

0 Kudos
647

Thnx RH

it working...

thanx a lot....

i cant give points, as this is not my thread...but its10/10

i have one issue...

Here users are maintained in LDAP under Regions....as..

1.OU=CUsers,OU=Chicago,DC=Microsoft,DC=corp

2.OU=BUsers,OU=Bankok,DC=Microsoft,DC=corp

3.OU=PUsers,OU=Paris,DC=Microsoft,DC=corp

here first OU is for Users second OU for region...

so now i m entring one of the region Base Entery...and it gives all the users under that region..

i want to get all the users under one DC=Microsoft,DC=corp..

so provide me some solution or suggestions for this...

Thnx

Rohit

0 Kudos
647

The best thing is to ask your ldap admin for querystrings and basesettings cause he knows best how the directory is build.

0 Kudos
647

i have already escalated it to them...thy are working on it...

finally i have to get the all the users in one internal table....

if it didnt work them i will maintain region in tvarv table and call the FM ldap_read to read them for each region and append it to final table...

thnx a lot RH...

i realy appriciate your efforts....and knowledge..

Hats of to U

I ll get back to u if i stuck ...

Thnx

Rohit

Edited by: Rohit Kumar on Aug 28, 2008 8:05 PM

0 Kudos
647

Hi Rahul,

We are encountering the same problem.

Operation failed

Message no. LDAPRC001

Diagnosis

This is an error message that is triggered by the directory server.

It is not possible to analyze the error in the SAP system.

Procedure

Check the log files for the directory server (if they exist), to see if they contain more information.

How were you able to resolve it? Please help.

Thanks,

Francis

RahulKeshav
Active Contributor
0 Kudos
647

Hi krishna prasad .

Can u award points to RH on my behalf...

he helped me a lot..