SAP Function SO_FOLDER_INSERT_API1 - SAPoffice: Create folder using RFC

Parameter Reference Type Length Default Optional Text
FOLDER_INSERT_DATA SOFOLCHGI1 u 86 Attributes of folder to be created
PARENT_FOLDER_ID SOFOLDATI1-OBJECT_ID C 17 ID of required parent folder

Parameter Reference Type Length Text
FOLDER_ID SOFOLDATI1-OBJECT_ID C 17 ID of created folder
FOLDER_INFO SOFOLDATI1 u 361 Information about new folder

Exception Text
ENQUEUE_ERROR Required locks could not be set
OPERATION_NO_AUTHORIZATION No authorization to create folder
PARAMETER_ERROR Invalid combination of parameter values
PARENT_FOLDER_NOT_EXIST Specified parent folder does not exist
PARENT_FOLDER_NO_AUTHORIZATION No authorization for parent folder
X_ERROR Internal error or database inconsistency

Functionality
This function module allows the creation of a new folder in thespecified parent folder.

Import parameter
PARENT_FOLDER_ID
Object ID of the parent folder in which the new folder shall becreated.
FOLDER_INSERT_DATA
This structure must contain the attributes of the folder to be created.

  • OBJ_NAME

  • Folder name.
    • OBJ_DESCR

    • Folder title (brief description).
      • OBJ_LANGU

      • Folder language.
        • OBJ_SORT

        • Folder sort field. This term can be searched for in the attributesearch.
          • OBJ_EXPDAT

          • This field is not used.
            • SENSITIVTY

            • Folder sensitivity.
              A private folder can have the following sensitivity:
              'O' : Standard, normal sensitivity
              'F' : Functional, entry possible, but no difference from standard
              'P' : Confidential, not visible for substitute
              In shared folders only sensitivity 'O' is allowed.
              • OBJ_PRIO

              • This field is not used.
                • NO_CHANGE

                • This field is not used.
                  • FOLSECTION

                  • Folder category.
                    The following entries are possible:
                    'P' : Private folder
                    'M' : Client folder
                    'G' : Group folder
                    If the parent folder is in the user's private folder area only thevalue 'P' is allowed. If the parent folder is in the shared folderarea only 'M' or 'G' may be specified.
                    If the entry of this value is missing the field is automaticallysupplied.
                    • AUTHORITY

                    • Basic access authorization in shared folders.
                      The following entries are possible:
                      '1' : Documents in the folder may be read only
                      '2' : Documents in the folder may be read and changed
                      '3' : All accesses to folders and their contents are allowed

                      Exportparameter
                      FOLDER_ID
                      Object ID of the newly created folder.
                      FOLDER_INFO
                      This structure contains the attributes of the newly created folder.

                      • OBJECT_ID

                      • Object ID of the folder.
                        • OBJ_TYPE

                        • Folder type ('FOL').
                          • OBJ_NAME

                          • Folder name.
                            • OBJ_DESCR

                            • Folder title (brief description).
                              • OBJ_LANGU

                              • Folder language.
                                • OBJ_SORT

                                • Folder sort field. This term can be searched for in the attributesearch.
                                  • CREATOR_ID

                                  • SAPoffice ID of the folder creator.
                                    • CREAT_NAME

                                    • SAPoffice name of the folder creator. The SAPoffice name is unique forthe whole client.
                                      • CREAT_FNAM

                                      • Full name of the folder creator from address management.
                                        • CREAT_DATE

                                        • Folder creation date.
                                          • CREAT_TIME

                                          • Folder creation time.
                                            • CHANGER_ID

                                            • SAPoffice ID of the last changer of the folder.
                                              • CHANG_NAME

                                              • SAPoffice name of the last changer of the folder. The SAPoffice nameis unique for the whole client.
                                                • CHANG_FNAM

                                                • Full name of the last changer of the folder from address management.
                                                  • CHANG_DATE

                                                  • Last change date.
                                                    • CHANG_TIME

                                                    • Last change time.
                                                      • OWNER_ID

                                                      • SAPoffice ID of folder owner. The SAPoffice name is unique for thewhole client.
                                                        • OWNER_NAM

                                                        • SAPoffice name of folder owner.
                                                          • OWNER_FNAM

                                                          • Full name of folder owner from address management.
                                                            • LAST_ACCES

                                                            • Folder creation/change date. Contains the newer of the two values.
                                                              • OBJ_EXPDAT

                                                              • This field is not used.
                                                                • SENSITIVTY

                                                                • Folder sensitivity.
                                                                  A private folder can have the following sensitivity:
                                                                  'O' : Standard, normal sensitivity
                                                                  'F' : Functional, entry possible, but no difference from standard
                                                                  'P' : Confidential, not visible for substitute
                                                                  In shared folders only sensitivity 'O' is allowed.
                                                                  • OBJ_PRIO

                                                                  • This field is not used.
                                                                    • NO_CHANGE

                                                                    • This field is not used.
                                                                      • FOLREGION

                                                                      • Folder area.
                                                                        The following values are possible:
                                                                        'P' : Private folders
                                                                        'Q' : Shared folders
                                                                        • FOLSECTION

                                                                        • Folder category

                                                                        • The following values are possible:
                                                                          'P' : Private folder
                                                                          'M' : Client folder
                                                                          'G' : Group folder
                                                                          • PARENTFOL

                                                                          • Object ID of parent folder.
                                                                            • NO_ENTRIES

                                                                            • Number of subfolders.
                                                                              • NO_DOC

                                                                              • Number of documents in the folder.

                                                                                Exceptions
                                                                                PARENT_FOLDER_NOT_EXIST
                                                                                The specified parent folder does not exist. Probably either an
                                                                                incorrect ID was transferred or the affected folder was deleted in themeantime.
                                                                                PARENT_FOLDER_NO_AUTHORIZATION
                                                                                Access to the specified parent folder is not allowed. This is becausethe parent folder is either a private folder of a different user or agroup folder to which the user does not have access. Folders in sharedtrash may only be accessed by the SAPoffice administrator.
                                                                                OPERATION_NO_AUTHORIZATION
                                                                                You were not allowed to create the folder. The user probably does nothave authorization to create shared folders.
                                                                                PARAMETER_ERROR
                                                                                An invalid combination of parameter values was transferred to thefunction module. There are several possible sources of error.Possibly you tried to assign the category of a client folder or a groupfolder to a private folder or the category of a private folder to ashared folder. If a sensitivity other than standard is assigned to ashared folder this also leads to this exception.
                                                                                X_ERROR
                                                                                An internal error or a database inconsistency has occured.
                                                                                ENQUEUE_ERROR
                                                                                The parent folder could not be locked. It is probably being processedby another user.

                                                                                Example
                                                                                Creation of a client folder, the contents of which other users may onlyhave read access to. The folder is appended to the root folder ofshared folders. The necessary ID is determined via the function moduleSO_USER_READ_API1.
                                                                                DATA: USER_DATA LIKE SOUDATAI1.
                                                                                DATA: FOL_DATA LIKE SOFOLCHGI1.
                                                                                CALL FUNCTION 'SO_USER_READ_API1'
                                                                                IMPORTING
                                                                                USER_DATA = USER_DATA
                                                                                EXCEPTIONS
                                                                                OTHERS = 1.
                                                                                IF SY-SUBRC <> 0.
                                                                                WRITE: / 'Error occured when reading user data!'.
                                                                                EXIT.
                                                                                ENDIF.
                                                                                FOL_DATA-OBJ_NAME = 'API-MAPPE'.
                                                                                FOL_DATA-OBJ_DESCR = 'A folder created via the API module'.
                                                                                FOL_DATA-OBJ_LANGU = SY-LANGU.
                                                                                FOL_DATA-SENSITIVTY = 'O'.
                                                                                FOL_DATA-FOLSECTION = 'M'.
                                                                                FOL_DATA-AUTHORITY = '1'.
                                                                                CALL FUNCTION 'SO_FOLDER_INSERT_API1'
                                                                                EXPORTING
                                                                                PARENT_FOLDER = USER_DATA-SHAREDFOL
                                                                                FOLDER_INSERT = FOL_DATA
                                                                                EXCEPTIONS
                                                                                PARENT_FOLDER_NO_AUTHORIZATION = 2
                                                                                OPERATION_NO_AUTHORIZATION = 3
                                                                                ENQUEUE_ERROR = 5
                                                                                OTHERS = 99.
                                                                                CASE SY-SUBRC.
                                                                                WHEN 0.
                                                                                WRITE: / 'The new folder was successfully created!'.
                                                                                WHEN 2.
                                                                                WRITE: / 'No access authorization for the parent folder!'.
                                                                                WHEN 3.
                                                                                WRITE: / 'No authorization to create folders!'.
                                                                                WHEN 5.
                                                                                WRITE: / 'The parent folder is already being processed!'
                                                                                WHEN OTHERS.
                                                                                WRITE: / 'Unknown error has occured!'.
                                                                                ENDCASE.

                                                                                Notes
                                                                                For the creation of documents or distribution lists the functionmodules SO_DOCUMENT_INSERT_API1 or SO_DLI_INSERT_API1 must be used.

                                                                                Further information
                                                                                Information for calling the function module SO_USER_READ_API1 are foundin the documentation for this function module.