SAP Function SO_USER_ADDRESS_READ_API1 - SAPoffice: View addresses using RFC

Parameter Reference Type Length Default Optional Text
GET_PUNYCODE SONV-FLAG C 1 SPACE X Flag indicating whether e-mail addresses are returned in punycode form

Parameter Reference Length Optional Text
USER_ADDRESS SOUSRADRI1 1511 Users with their addresses

Exception Text
ENQUEUE_ERRROR Required locks could not be set
PARAMETER_ERROR Invalid combination of parameter values
X_ERROR Internal error or database inconsistency

Functionality
This function module allows the external address to be determined for auser or an ID. Since value transfer is carried out in table form,several addresses can be searched for with one call.

Table parameters
USER_ADDRESS
The entries in this table must be provided with an entry identifyingthe address being searched for. Only one of the fields USERID, SAPNAMEand OFFICENAME can be filled, additional entries may be required inCOM_TYPE and LFDNR. The other areas are supplemented by the functionmodule with the values being searched for.

  • USERID

  • ID of the address or user the address is assigned to. An address ID isconverted directly, if the ID refers to a user, however, additionalinformation on the communication method including sequential number ofthe address being searched for is required.
    • SAPNAME

    • SAP name of the user. The SAP name is used to log onto the system. Ifthis field is assigned a value, additional information on thecommunication method including sequential number of the relevantaddress is required.
      • OFFICENAME

      • SAPoffice name of the user. The SAPoffice name is unique client-wide.If this field is assigned a value, additional information on thecommunication method including sequential number of the relevantaddress is required.
        • COM_TYPE

        • If the address of a user is to be determined, the communication methodof the relevant address can be entered in this field. If the field isnot assigned a value, the standard communication method specified inthe address management is used.
          The following values are possible:
          'INT' : Internet address
          'FAX' : Fax number
          'X40' : X.400 address
          'RML' : Address for a remote SAP name
          • LFDNR

          • Sequential number from the address management. If the address of a useris to be determined, the sequential number of the communication methodfor the relevant address can be entered in this field. If the field isnot assigned a value, the sequential number specified in the addressmanagement is used.
            • ADDRESS

            • Address of the entry. Depending on the type of the specified ID of thecommunication method, one of the following address types is enteredhere:
              a fax number in the form of the structure SADRFD
              an Internet address in the form of the structure SADRUD
              a remote SAP name in the form of the structure SADR7D
              an X.400 address in the form of the structure SADR8D
              • RETRN_CODE

              • If the address could be determined, this field is filled by thefunction module with the value '0', otherwise a value not equal to '0'is entered.
                • LONG_NAME

                • This field is provided with a description of the address of the entrywhich is as precise as possible.

                  Exceptions
                  PARAMETER_ERROR
                  An invalid combination of parameter values was passed to the functionmodule. Values were probably assigned to too many fields of the tableUSER_ADDRESS or a value entered which is not supported.
                  X_ERROR
                  An internal error or a database inconsistency occurred.
                  ENQUEUE_ERROR
                  A lock involved in the search operation could not be set. Processing isprobably being carried out by another user.

                  Example
                  Outputting the preset Internet and X.400 address of the active user.
                  DATA: ADRLIST LIKE SOUSRADRI1 OCCURS 5 WITH HEADER LINE.
                  ADR_LIST-SAPNAME = SY_UNAME.
                  ADR_LIST-COM_TYPE = 'INT'.
                  APPEND ADR_LIST.
                  ADR_LIST-SAPNAME = SY-UNAME.
                  ADR_LIST-COM_TYPE = 'X40'.
                  APPEND ADR_LIST.
                  CALL FUNCTION 'SO_USER_ADDRESS_READ_API1'
                  TABLES
                  USER_ADDRESS = ATTLIST
                  EXCEPTIONS
                  OTHERS = 1.
                  IF SY-SUBRC <> 0.
                  WRITE: / 'Error occurred determining addresses !'.
                  EXIT.
                  ENDIF.
                  LOOP AT ADR_LIST.
                  CASE ATTLIST-COM_TYPE.
                  WHEN 'INT'.
                  WRITE: / 'Internet address :'.
                  WHEN 'X40'.
                  WRITE: / 'X.400 address :'.
                  ENDCASE.
                  IF ATTLIST-RETRN_CODE <> 0.
                  WRITE: 'not available or incorrect'.
                  CONTINUE.
                  ENDIF.
                  WRITE: ATTLIST-ADDRESS.
                  ENDLOOP.

                  Notes
                  In order to be able to deal with a determined address properly, it mustbe written to a field with a structure corresponding to the addresstype.