SAP Function Modules

SO_USER_ADDRESS_INSERT SAP Function module - SAPoffice: Internal Address Assigned to Office User







SO_USER_ADDRESS_INSERT is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name SO_USER_ADDRESS_INSERT into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SOA3
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM SO_USER_ADDRESS_INSERT - SO USER ADDRESS INSERT





CALL FUNCTION 'SO_USER_ADDRESS_INSERT' "SAPoffice: Internal Address Assigned to Office User
  EXPORTING
*   company_adr = SPACE         " sadr-adrnr    Company address (if not filled -> Profile )
    user =                      " soud-usrnam
    user =                      " soud-usrnam   SAPoffice user ID
  IMPORTING
    address_name =              " sadr-name1
    adrnr =                     " sadr-adrnr
  EXCEPTIONS
    ADDRESS_EXIST = 1           "               Internal address already assigned to user
    ADDRESS_NOT_IN_PROFILE = 2  "               No address entered in the profile
    ADDR_NUMBER_OVERFLOW = 3    "
    COMPANY_ADR_NOT_EXIST = 4   "               Company address does not exist
    PARAMETER_ERROR = 5         "
    PROFILE_NOT_EXIST = 6       "               Profile does not exist
    USER_NOT_EXIST = 7          "               Office user does not exist
    X_ERROR = 8                 "
    .  "  SO_USER_ADDRESS_INSERT

ABAP code example for Function Module SO_USER_ADDRESS_INSERT





The ABAP code below is a full code listing to execute function module SO_USER_ADDRESS_INSERT including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_address_name  TYPE SADR-NAME1 ,
ld_adrnr  TYPE SADR-ADRNR .


SELECT single ADRNR
FROM SADR
INTO @DATA(ld_company_adr).


SELECT single USRNAM
FROM SOUD
INTO @DATA(ld_user).


SELECT single USRNAM
FROM SOUD
INTO @DATA(ld_user).
. CALL FUNCTION 'SO_USER_ADDRESS_INSERT' EXPORTING * company_adr = ld_company_adr user = ld_user user = ld_user IMPORTING address_name = ld_address_name adrnr = ld_adrnr EXCEPTIONS ADDRESS_EXIST = 1 ADDRESS_NOT_IN_PROFILE = 2 ADDR_NUMBER_OVERFLOW = 3 COMPANY_ADR_NOT_EXIST = 4 PARAMETER_ERROR = 5 PROFILE_NOT_EXIST = 6 USER_NOT_EXIST = 7 X_ERROR = 8 . " SO_USER_ADDRESS_INSERT
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_address_name  TYPE SADR-NAME1 ,
ld_company_adr  TYPE SADR-ADRNR ,
ld_adrnr  TYPE SADR-ADRNR ,
ld_user  TYPE SOUD-USRNAM ,
ld_user  TYPE SOUD-USRNAM .


SELECT single ADRNR
FROM SADR
INTO ld_company_adr.


SELECT single USRNAM
FROM SOUD
INTO ld_user.


SELECT single USRNAM
FROM SOUD
INTO ld_user.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name SO_USER_ADDRESS_INSERT or its description.