SAP Function SO_DLI_INSERT_API1 - SAPoffice: Insert distribution list using RFC

Parameter Reference Type Length Default Optional Text
DLI_INSERT_DATA SODLICHGI1 u 95 Attributes of new distribution list
FOLDER_ID SOFOLDATI1-OBJECT_ID C 17 ID of folder in which DLI is to be inserted

Parameter Reference Type Length Text
DLI_INFO SODLIDATI1 u 395 Complete attributes after creation

Parameter Reference Length Optional Text
DLI_ENTRIES SODLIENTI1 1280 Entries in distribution list

Exception Text
DLI_ALREADY_EXIST Name of distribution list exists already
ENQUEUE_ERROR Required locks could not be set
FOLDER_NOT_EXIST Specified folder does not exist
OPERATION_NO_AUTHORIZATION No authorization to create DLI
PARAMETER_ERROR Invalid combination of parameter values
X_ERROR Internal error or database inconsistency

Functionality
This function module is used to create a new distribution list.

Import parameters
FOLDER_ID
Object ID of the folder in which the distribution list is to becreated.
DLI_INSERT_DATA
This structure must contain the attributes of the distribution list tobe created.

  • OBJ_NAME

  • Name of the distribution list. The name must be unique for the sharedfolders or the private area of each user.
    • OBJ_DESCR

    • Title (short description) of the distribution list.
      • OBJ_LANGU

      • Language of the distribution list.
        • OBJ_SORT

        • Sort field of the distribution list. This term can be searched for inthe attribute search.
          • OBJ_EXPDAT.

          • This field is not used.
            • SENSITIVTY

            • Sensitivity of the distribution list.
              A private distribution list can have the following sensitivity:
              'O' : standard, normal sensitivity
              'F' : functional, entry possible but no difference to standard
              'P' : confidential, not visible to the substitute
              Only the sensitivity 'O' is allowed for shared distribution lists.
              • OBJ_PRIO

              • This field is not used.
                • NO_CHANGE

                • This field is not used.
                  • PRIORITY

                  • This field is not used.
                    • EXPIRY_DAT

                    • This field is not used.
                      • SUBSCRIPT

                      • If this flag is set ('X'), the distribution list is a subscriptionlist. Since only shared distribution lists can be subscription lists,the flag SHARED_DLI must therefore also be set.
                        • SHARED_DLI

                        • If this flag is set ('X'), the distribution list is a shareddistribution list.

                          Export parameters
                          DLI_INFO
                          This structure contains the attributes of the newly createddistribution list.

                          • OBJECT_ID

                          • Object ID of the distribution list.
                            • OBJ_TYPE

                            • Type of document ('DLI').
                              • OBJ_NAME

                              • Name of distribution list.
                                • OBJ_DESCR

                                • Title (short description) of distribution list.
                                  • OBJ_LANGU

                                  • Language of distribution list.
                                    • OBJ_SORT

                                    • Sort field of the distribution list. This term can be searched for inthe attribute search.
                                      • CREATOR_ID

                                      • SAPoffice ID of the creator of the distribution list.
                                        • CREAT_NAME

                                        • SAPoffice name of the creator of the distribution list. The SAPofficename is unique client-wide.
                                          • CREAT_FNAM

                                          • Full name of the creator of the distribution list from the addressmanagement.
                                            • CREAT_DATE

                                            • Date distribution list was created.
                                              • CREAT_TIME

                                              • Time distribution list was created.
                                                • CHANGER_ID

                                                • SAPoffice ID of person who last changed the distribution list.
                                                  • CHANG_NAME

                                                  • SAPoffice name of person who last changed the distribution list. TheSAPoffice name is unique client-wide.
                                                    • CHANG_FNAM

                                                    • Full name of person who last changed the distribution list from theaddress management.
                                                      • CHANG_DATE

                                                      • Date of last change.
                                                        • CHANG_TIME

                                                        • Time of last change.
                                                          • OWNER_ID

                                                          • SAPoffice ID of the owner of the distribution list.
                                                            • OWNER_NAM

                                                            • SAPoffice name of the owner of the distribution list. The SAPofficename is unique client-wide.
                                                              • OWNER_FNAM

                                                              • Full name of the owner of the distribution list from the addressmanagement.
                                                                • LAST_ACCES

                                                                • Date distribution list was created/changed. Contains the latest of thetwo values.
                                                                  • OBJ_EXPDAT

                                                                  • This field is not used.
                                                                    • SENSITIVTY

                                                                    • Sensitivity of the distribution list.
                                                                      A private distribution list can have the following sensitivity:
                                                                      'O' : standard, normal sensitivity
                                                                      'F' : functional, entry possible but no difference to standard
                                                                      'P' : confidential, not visible to substitute
                                                                      Only sensitivity 'O' is allowed for shared distribution lists.
                                                                      • OBJ_PRIO

                                                                      • This field is not used.
                                                                        • NO_CHANGE

                                                                        • This field is not used.
                                                                          • PROC_TYPE

                                                                          • This field is not used.
                                                                            • PROC_NAME

                                                                            • This field is not used.
                                                                              • PROC_SYST

                                                                              • This field is not used.
                                                                                • PROC_CLIENT

                                                                                • This field is not used.
                                                                                  • SKIP_SCREEN

                                                                                  • This field is not used.
                                                                                    • TO_DO_OUT

                                                                                    • This field is not used.
                                                                                      • FREE_DEL

                                                                                      • This field is not used.
                                                                                        • SUBSCRIPT

                                                                                        • If this flag is set ('X'), the distribution list is a subscriptionlist. Since only shared distribution lists can be subscription lists,the flag SHARED_DLI is therefore also set.
                                                                                          • SIZE

                                                                                          • Contains the number of entries in the distribution list.
                                                                                            • SHARED_DLI

                                                                                            • If this flag is set ('X'), the distribution list is a shareddistribution list.
                                                                                              • PRIORITY

                                                                                              • This field is not used.
                                                                                                • EXPIRY_DAT

                                                                                                • This field is not used.

                                                                                                  Table parameters
                                                                                                  DLI_ENTRIES
                                                                                                  This table must contain the entries of the distribution list to becreated.

                                                                                                  • MEMBER_NAM

                                                                                                  • Unique name of the entry. Depending on the entry type, it may be theSAPoffice name of a user, the name of a private or shared distributionlist, or the name of the ID of an external address.
                                                                                                    • MEMBER_ID

                                                                                                    • ID of the entry.
                                                                                                      • MEMBER_TYP

                                                                                                      • Type of entry.
                                                                                                        ' ' : Internal user
                                                                                                        'P' : Private distribution list
                                                                                                        'C' : Shared distribution list
                                                                                                        'A' : External address
                                                                                                        'U' : Internet address
                                                                                                        'X' : X.400 address
                                                                                                        'F' : Fax number
                                                                                                        'R' : Remote SAP name
                                                                                                        • FULL_NAME

                                                                                                        • Descriptive name of the entry. If the entry is an internal user, therelevant name from the address management is used here. In the case ofexternal addresses, an exact description of the address is inserted.
                                                                                                          • MEMBER_ADR

                                                                                                          • If the entry is an external address, it is specified fully in thisfield.
                                                                                                            The following address types are possible:
                                                                                                            a fax number in the form of the structure SADRFD
                                                                                                            an Internet address in the form of the structure SADRUD
                                                                                                            an SAP remote address in the form of the structure SADR7D
                                                                                                            an X.400 address in the form of the structure SADR8D
                                                                                                            The meaning of the value entered here can be derived from the fieldMEMBER_TYP.

                                                                                                            Exceptions
                                                                                                            DLI_ALREADY_EXIST
                                                                                                            The name of the distribution list to be created already exists. If youtried to create a private distribution list, there is already adistribution list with the same name in the outbox, a private folder,or in the private trash. If you tried to create a shared distributionlist, there is already one with this name in a shared folder or theshared trash.
                                                                                                            FOLDER_NOT_EXIST
                                                                                                            The folder in which the distribution list is to be created does notexist. An incorrect ID may have been passed or the relevant folder hasbeen deleted.
                                                                                                            OPERATION_NO_AUTHORIZATION
                                                                                                            It was not possible to create the distribution list. This may bebecause it was to be created in the private area of another user or ina shared folder for which the active user does not have a createauthorization for distribution lists.
                                                                                                            PARAMETER_ERROR
                                                                                                            An invalid combination of parameter values was passed to the functionmodule.
                                                                                                            X_ERROR
                                                                                                            An internal error or a database inconsistency occurred.
                                                                                                            ENQUEUE_ERROR
                                                                                                            The folder in which the distribution is to be created could not belocked. It may be being processed by another user.

                                                                                                            Example
                                                                                                            Creating an empty subscription list in the shared folders.
                                                                                                            DATA: TAB_ENTRIES LIKE SODLIENTI1 OCCURS 0 WITH HEADER LINE.
                                                                                                            DATA: DLI_CHNG LIKE SODLICHGI1.
                                                                                                            DATA: USER_DATA LIKE SOUDATAI1.
                                                                                                            CALL FUNCTION 'SO_USER_READ_API1'
                                                                                                            IMPORTING
                                                                                                            USER_DATA = USER_DATA
                                                                                                            EXCEPTIONS
                                                                                                            OTHERS = 1.
                                                                                                            IF SY-SUBRC <> 0.
                                                                                                            WRITE: / 'User data could not be read !'.
                                                                                                            EXIT.
                                                                                                            ENDIF.
                                                                                                            DLI_CHNG-OBJ_NAME = 'RUMOURS'.
                                                                                                            DLI_CHNG-OBJ_DESCR = 'Gossip for everyone'.
                                                                                                            DLI_CHNG-OBJ_LANGU = SY-LANGU.
                                                                                                            DLI_CHNG-SENSITIVTY = 'O'.
                                                                                                            DLI_CHNG-SUBSCRIPT = 'X'.
                                                                                                            DLI_CHNG-SHARED_DLI = 'X'.
                                                                                                            CALL FUNCTION 'SO_DLI_INSERT_API1'
                                                                                                            EXPORTING
                                                                                                            FOLDER_ID = USER_DATA-SHAREDFOL
                                                                                                            DLI_INSERT_DATA = DLI_CHNG
                                                                                                            TABLES
                                                                                                            TAB_ENTRIES
                                                                                                            EXCEPTIONS
                                                                                                            DLI_ALREADY_EXIST = 1
                                                                                                            OPERATION_NO_AUTHORIZATION = 3
                                                                                                            ENQUEUE_ERROR = 6
                                                                                                            OTHERS = 99.
                                                                                                            CASE SY-SUBRC.
                                                                                                            WHEN 0.
                                                                                                            WRITE: / 'Distribution list was created !'.
                                                                                                            WHEN 1.
                                                                                                            WRITE: / 'Distribution list with this name already exists !'.
                                                                                                            WHEN 3.
                                                                                                            WRITE: / 'No authorization to create a distribution list !'.
                                                                                                            WHEN 6.
                                                                                                            WRITE: / 'Relevant folder is currently being processed !'.
                                                                                                            WHEN OTHERS.
                                                                                                            WRITE: / 'Unknown error occurred !'.
                                                                                                            ENDCASE.

                                                                                                            Notes
                                                                                                            The function modules SO_FOLDER_INSERT_API1 or SO_DOCUMENT_INSERT_API1must be used to create folders or documents.

                                                                                                            Further information
                                                                                                            Information on calling the function module SO_USER_READ_API1 can befound in the documentation of the function module.