SAP Jobsuche bei DV-Treff


Suchen
Littlered
vor 18 Jahre
Hallo,

habe einen Report geschrieben der die Daten aus dem HR-Personalstamm in das Active Directory schießen soll. Dabei übergibt er die Attribute die ich vorgesehen habe an den Funktionsbaustein SPLDAP_RECEIVE_ATTRIBUTES. Diese Funktion ist bereits im SAP vorhanden, nun hab ich das Problem dass trotzdem mein Report mit der Fehlermeldung abbricht, dass diese Funktion nicht "available" ist. Kann es sein dass dieser Funktionsbaustein erst freigegeben werden muss (wobei ich den unterschide zwischen freigeben und SAP intern freigeben nicht ganz verstehe)? Sorry wenns ne doofe Frage ist aber ich bin relativ neu auf dem Gebiet ;O)
danielA.
vor 18 Jahre
Hallo LittleRed,

bin noch nicht zum schreiben gekommen, aber Du scheinst ja ein Stück weitergekommen zu sein.

Ich habe hier ein 4.6c System, dort gibt es den Fuba nicht.
Wenn Du aber mit dem Fuba Hinweise suchst, das hab ich gerade gemacht, so kommen dort einige. Meist gibt es Probleme beim Datenexport........das kann Dir wohl helfen.

Gruß
daniel A.

PS: im Übrigen, ich bin nun mittlerweile selbst dran interessiert 😉.
Littlered
vor 18 Jahre
Leider hilft mir das kein bisschen. Der Funktionsbaustein ist vorhanden, freigegeben aber die Fehlermeldung, dass er nicht "available" ist kommt trotzdem. Da scheint intern irgendwie die Übergabe der ausgelesenen Attribute an diesen Funktionsbaustein nicht zu funktionieren.

Woran kann dass liegen?
danielA.
vor 18 Jahre
Moin,

hast Du denn mal die Hinweise durchgeguckt?
Bei mir gibt es den Fuba leider nicht.

Gruß
danielA.
Littlered
vor 18 Jahre
Ich hab mir die Hinweise mal angeguckt. Leider habe die alle andere Probleme geschildert als ich hab. Das Problem mit dem ansprechen des Fuba hab ich nun gelöst. Das Problem war, dass ich ihn Remote aufgerufen habe mit einer RFC Destination. Ich nahm an dass er die braucht um auf den LDAP Connector zuzugreifen. Da ich aber ein System höher als 4.6 verwende, muss ich die Angabe der Destination weglassen so dass der RFC lokal aufgerufen werden kann.

Nun ergibt sich aber ein neuer Fehler. Jetzt sagt der Dump dass der Fuba einen Parameter vermisst, den Attribut_L. Gib ich ihm das Attribut, dann schmeisst er mir einen Typenkonflikt-Fehler raus. Ich häng den Report mal unten an um den es geht.

Er steigt dann immer beim Aufruf der Funktion CALL SPLDAP_RECEIVE_ATTRIBUTES aus.



Vielleicht hat jemand einen ganz schlauen Tip warum der Fehler entsteht oder was ich falsch mache. ich hab keine Ahnung  ???
Littlered
vor 18 Jahre
<br><br>*&amp;---------------------------------------------------------------------*<br>*&amp; Report &nbsp;Z_SAP_HR_LDAP_1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br>*&amp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br>*&amp;---------------------------------------------------------------------*<br>*&amp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br>*&amp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br>*&amp;---------------------------------------------------------------------*<br><br>REPORT &nbsp;Z_SAP_HR_LDAP_1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<br><br>DATA: PLVAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LIKE OBJEC-PLVAR,<br> &nbsp; &nbsp; &nbsp;OBJID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LIKE HROBJECT-OBJID,<br> &nbsp; &nbsp; &nbsp;KEYDA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LIKE PLOG-BEGDA,<br> &nbsp; &nbsp; &nbsp;P_OBJECTS &nbsp; &nbsp; &nbsp; &nbsp;LIKE HROBJECT OCCURS 0,<br> &nbsp; &nbsp; &nbsp;P_OBJECTS_WA &nbsp; &nbsp; LIKE HROBJECT,<br> &nbsp; &nbsp; &nbsp;S_OBJECTS &nbsp; &nbsp; &nbsp; &nbsp;LIKE HROBJECT OCCURS 0,<br> &nbsp; &nbsp; &nbsp;S_OBJECTS_WA &nbsp; &nbsp; LIKE HROBJECT,<br> &nbsp; &nbsp; &nbsp;I1001_ITAB &nbsp; &nbsp; &nbsp; LIKE P1001 OCCURS 0 WITH HEADER LINE,<br> &nbsp; &nbsp; &nbsp;I1001_ITAB2 &nbsp; &nbsp; &nbsp;LIKE P1001 OCCURS 0 WITH HEADER LINE,<br> &nbsp; &nbsp; &nbsp;LDAPDESTINATION LIKE LDA_TYPES-LDAPDESTINATION,<br> &nbsp; &nbsp; &nbsp;LDAPSERVER LIKE LDA_TYPES-LDAPSERVER,<br> &nbsp; &nbsp; &nbsp;ldapinitialrun like lda_types-flag,<br> &nbsp; &nbsp; &nbsp;LOGSYS LIKE TBDLS-LOGSYS,<br> &nbsp; &nbsp; &nbsp;ERRORS LIKE BAPIRET2 OCCURS 0,<br> &nbsp; &nbsp; &nbsp;ERRORS_WA LIKE BAPIRET2.<br><br>* structure for short ldap-attributes<br>* fieldnames must be equal to basis strucutre LDA-ATTR_S (for RFC_CALL)<br>TYPES: &nbsp;BEGIN OF TS_LDAP_ATTR_S,<br> &nbsp; &nbsp; &nbsp; &nbsp; PERNR LIKE LDA_TYPES-PERNR,<br> &nbsp; &nbsp; &nbsp; &nbsp; ATTR_TAB LIKE LDA_TYPES-ATTR_TABNAME,<br> &nbsp; &nbsp; &nbsp; &nbsp; ATTR_FIELD LIKE LDA_TYPES-ATTR_FIELDNAME,<br> &nbsp; &nbsp; &nbsp; &nbsp; VALUE LIKE LDA_TYPES-VALUE_S,<br> &nbsp; &nbsp; &nbsp; &nbsp;END OF TS_LDAP_ATTR_S.<br><br>data: attributes type ts_ldap_attr_s occurs 0,<br> &nbsp; &nbsp; &nbsp;attributes_wa type ts_ldap_attr_s.<br><br>tables: pernr, rfcdes.<br>infotypes: 0001, 0002.<br><br>SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.<br>PARAMETERS: P_TEST default 'X' AS CHECKBOX.<br>SELECTION-SCREEN END OF BLOCK B1.<br><br>Parameters: LDAPSRV Default 'ADS_TESTSERVER' LIKE LDA_TYPES-LDAPSERVER,<br>* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LDAPDEST Default 'LDAPDEST' LIKE rfcdes-rfcdest.<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LDAPDEST Default 'LDAP_SAP_ADS_DC_1' LIKE rfcdes-rfcdest.<br>* ---------------------------------------------------------------------<br>at selection-screen.<br><br>clear: p_objects[], s_objects[], attributes[].<br><br>CALL FUNCTION 'RH_GET_PLVAR'<br> IMPORTING<br> &nbsp;PLVAR = PLVAR<br> EXCEPTIONS<br> &nbsp;no_plvar = 1<br> &nbsp;OTHERS = 2.<br>if sy-subrc &lt;&gt; 0.<br> MESSAGE E015(HRLDAP).<br>endif.<br>KEYDA = sy-datum.<br><br>* --------------------------------------------------------------------<br>get pernr.<br><br>rp-provide-from-last p0001 '' keyda keyda.<br>rp-provide-from-last p0002 '' keyda keyda.<br>ATTRIBUTES_WA-PERNR = p0001-pernr.<br><br>* lastname<br> attributes_wa-attr_tab = 'EMPLOYEE'.<br> attributes_wa-attr_field = 'LASTNAME'.<br> attributes_wa-value = p0002-nachn.<br> append attributes_wa to attributes.<br><br>* firstname<br> attributes_wa-attr_tab = 'EMPLOYEE'.<br> attributes_wa-attr_field = 'FIRSTNAME'.<br> attributes_wa-value = p0002-vorna.<br> append attributes_wa to attributes.<br><br>* sAMAccountName<br> attributes_wa-attr_tab = 'EMPLOYEE'.<br> attributes_wa-attr_field = 'SAMACCOUNTNAME'.<br><br>* --------------------------------<br>* Using the employee number a unique name is created<br>* for the sAMAccountName<br>* --------------------------------<br><br> concatenate 'E' p0001-pernr into attributes_wa-value.<br> append attributes_wa to attributes.<br><br>* other attributes have to added here.<br>* for each additional attribute an appropriate field<br>* has to defined in the structure EMPLOYEE<br>* for example you can choose the following:<br>*<br>* attributes_wa-attr_tab = 'EMPLOYEE'.<br>* attributes_wa-attr_field = 'TELEPHONE'.<br>*<br>* if you want to transfer the telephone number<br>* of an employee from SAP HR to Active Directory<br>* In the web Application Server an appropriate mapping<br>* has to be defined using transaction LDAP for each new<br>* attribute (here called TELEPHONE).<br>* ---------------------------------------------------------------------<br><br>end-of-selection.<br><br>* get own logical system<br>CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'<br> IMPORTING<br> &nbsp;OWN_LOGICAL_SYSTEM = LOGSYS<br> EXCEPTIONS<br> &nbsp;OWN_LOGICAL_SYSTEM_NOT_DEFINED = 1<br> &nbsp;OTHERS = 2.<br><br>IF SY-SUBRC NE 0.<br>* TODO: Komprimierung sy-mandt: 3 -&gt; 2 Stellen !!!<br> &nbsp;CONCATENATE SY-SYSID SY-MANDT INTO LOGSYS.<br>ENDIF.<br><br>loop at attributes into attributes_wa.<br> write: / ATTRIBUTES_WA-PERNR , attributes_wa-attr_tab.<br> write: attributes_wa-attr_field ,attributes_wa-value.<br>endloop.<br><br>IF P_TEST = 'X'.<br> EXIT.<br>ENDIF.<br><br>* ---------------------------------------------------------------------<br>* send attributes to ldap client<br>* send attributes<br>CALL FUNCTION 'SPLDAP_RECEIVE_ATTRIBUTES'<br>* DESTINATION LDAPDEST<br>EXPORTING<br> &nbsp; &nbsp; LOGSYS = LOGSYS<br> &nbsp; &nbsp; SERVERID = LDAPSRV<br> &nbsp; &nbsp; ATTRIBUTES_S = attributes[]<br> &nbsp; &nbsp; INITIAL_RUN = LDAPINITIALRUN<br>* &nbsp; &nbsp; &nbsp;ATTRIBUTES_L = TOTAL_ATTRS_L[]<br>* &nbsp; &nbsp; &nbsp;ATTRIBUTES_X = TOTAL_ATTRS_X[].<br>IMPORTING<br> RETURN = ERRORS[].<br><br>IF NOT ERRORS[] IS INITIAL.<br> &nbsp;READ TABLE ERRORS INDEX 1 INTO ERRORS_WA.<br> &nbsp;MESSAGE ID ERRORS_WA-ID TYPE ERRORS_WA-TYPE<br> &nbsp; NUMBER ERRORS_WA-NUMBER<br> &nbsp; WITH ERRORS_WA-MESSAGE_V1 ERRORS_WA-MESSAGE_V2<br> &nbsp; &nbsp; &nbsp; &nbsp;ERRORS_WA-MESSAGE_V3 ERRORS_WA-MESSAGE_V4.<br>ENDIF.<br><br>
Littlered
vor 18 Jahre
danielA.
vor 18 Jahre
Was war es?

Ich habe gesehen, dass Du 'TOTAL_ATTRS_L' nicht deklariert hast......dann ist der Fehler auch wieder logisch.

Gruß
daniel A.