SAP TREX_EXT_CREATE_CRAWL Function Module for creates a TREX crawl (cruise) object
TREX_EXT_CREATE_CRAWL is a standard trex ext create crawl SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for creates a TREX crawl (cruise) object processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for trex ext create crawl FM, simply by entering the name TREX_EXT_CREATE_CRAWL into the relevant SAP transaction such as SE37 or SE38.
Function Group: TREX_EXT_CRAWLER
Program Name: SAPLTREX_EXT_CRAWLER
Main Program: SAPLTREX_EXT_CRAWLER
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function TREX_EXT_CREATE_CRAWL pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'TREX_EXT_CREATE_CRAWL'"creates a TREX crawl (cruise) object.
EXPORTING
I_RFC_DESTINATION = "RFC destination to TREX
* I_PREPROCESSOR_POOL_SIZE = 3 "number of parallel requests to the PreProcessor processes
* I_DONT_INDEX_DIRS = 0 "1=do not index directories
* I_ACCESS_DELAY = 0 "time between 2 HTTP gets in ms
* I_MAX_RETRY_COUNT = 3 "max retry of HTTP gets
* I_USE_ROBOTRULES = 0 "1 = crawler is using robot rules
* I_IS_MULTILANGUAGE_INDEX = 0 "1 = using multi language index
* I_USER_AGENT = 'TREX' "user agent for HTTP get
* I_SCHEDULE_TIME = "if not empty, scheduler will be used
* I_PYTHON_COMMAND_ARGS = "Python command for scheduled execution
* I_RESULT_CONNECTOR_TYPE = 0 " (default )0=TREX index, 1=file, 2=dummy for python commands
I_CRUISE_NAME = "name of the crawl / cruise
* I_USE_QUEUESERVER = 1 "X=using queue server for crawling / indexing
* I_OPTIMIZE_EVERY = 1 "call an optimize after indexing n documents
* I_DEINDEX_FLAG = 1 "1= deindex documents which got an error during update crawl
* I_USE_FREESTYLE_CONTAINER = 0 "1= concatenate all attribute values to one
* I_GET_ACCESS_RIGHTS = 0 "1= extract ACLs from files
* I_USE_RAPTOR_ATTRIBUTES = 1 "extracting of standard attributes
* I_FILE_PATH = "connector type = 1 (file) where documents will be stored
I_CRUISE_DOCUMENT_INFO = "meta information like seedurl etc.
* I_CRUISE_EXTENSION_LIST = "TREX cruiser extension list for parameters
* I_CRUISE_PP_EXTENSION_LIST = "TREX cruiser extension list for parameters
* I_INDEX_ID = "indexid
* I_DOCKEY_CONVERSION_LIST = "cruiser list for convertion (e.g. document keys)
* I_HOST_INFORMATION = "TREX cruiser host information
* I_REGULAR_EXPRESSION = "regular expressions for the TREX cruiser/crawler
* I_POSITIVE_FILE_EXTENSIONS = "list of positive files extensions which will be crawled
* I_NEGATIVE_FILE_EXTENSION = "list of negative files extensions which will NOT be crawled
* I_EXCLUDE_DIRECTORIES = "directories which must not be craweld
* I_RESULT_CONNECTOR = "TREX cruiser result connector
* I_LANGUAGE = "Language according to ISO 639
* I_CREATE_SUSPENDED = 0 "1=cruise is suspended after creatation
* I_MAX_DEPTH = 0 "maximal depth which will be crawled
* I_MAX_DOCSIZE = 20000000 "maximal size in bytes which will be crawled
* I_MIN_DOCSIZE = 1 "minimal size in bytes which will be crawled
* I_CRAWLING_ALGORITHM = 0 "0=down the tree; 1= same server; 2=same domain; 3 = top level domain, 4= free
IMPORTING
E_RETURN_CODE = "Return Code
E_RETURN_TEXT = "Return Text
EXCEPTIONS
CONVERSION_ERROR = 1 ERROR = 2
IMPORTING Parameters details for TREX_EXT_CREATE_CRAWL
I_RFC_DESTINATION - RFC destination to TREX
Data type: TREX_RFC-RFC_DESTINATIONOptional: No
Call by Reference: Yes
I_PREPROCESSOR_POOL_SIZE - number of parallel requests to the PreProcessor processes
Data type: TREXS_CRUISER-POOL_SIZEDefault: 3
Optional: Yes
Call by Reference: Yes
I_DONT_INDEX_DIRS - 1=do not index directories
Data type: TREXS_CRUISER-NUMC1Optional: Yes
Call by Reference: Yes
I_ACCESS_DELAY - time between 2 HTTP gets in ms
Data type: TREXS_CRUISER-COUNTEROptional: Yes
Call by Reference: Yes
I_MAX_RETRY_COUNT - max retry of HTTP gets
Data type: TREXS_CRUISER-COUNTERDefault: 3
Optional: Yes
Call by Reference: Yes
I_USE_ROBOTRULES - 1 = crawler is using robot rules
Data type: TREXS_CRUISER-NUMC1Optional: Yes
Call by Reference: Yes
I_IS_MULTILANGUAGE_INDEX - 1 = using multi language index
Data type: TREXS_CRUISER-NUMC1Optional: Yes
Call by Reference: Yes
I_USER_AGENT - user agent for HTTP get
Data type: TREXS_CRUISER-STRING_FIELDDefault: 'TREX'
Optional: Yes
Call by Reference: Yes
I_SCHEDULE_TIME - if not empty, scheduler will be used
Data type: TREXS_CRUISER-STRING_FIELDOptional: Yes
Call by Reference: Yes
I_PYTHON_COMMAND_ARGS - Python command for scheduled execution
Data type: TREXS_CRUISER-STRING_FIELDOptional: Yes
Call by Reference: Yes
I_RESULT_CONNECTOR_TYPE - (default )0=TREX index, 1=file, 2=dummy for python commands
Data type: TREXS_CRUISER-NUMC1Optional: Yes
Call by Reference: Yes
I_CRUISE_NAME - name of the crawl / cruise
Data type: TREXS_CRUISER-CRUISE_NAMEOptional: No
Call by Reference: Yes
I_USE_QUEUESERVER - X=using queue server for crawling / indexing
Data type: TREXS_CRUISER-NUMC1Default: 1
Optional: Yes
Call by Reference: Yes
I_OPTIMIZE_EVERY - call an optimize after indexing n documents
Data type: TREXS_CRUISER-COUNTERDefault: 1
Optional: Yes
Call by Reference: Yes
I_DEINDEX_FLAG - 1= deindex documents which got an error during update crawl
Data type: TREXS_CRUISER-NUMC1Default: 1
Optional: Yes
Call by Reference: Yes
I_USE_FREESTYLE_CONTAINER - 1= concatenate all attribute values to one
Data type: TREXS_CRUISER-NUMC1Optional: Yes
Call by Reference: Yes
I_GET_ACCESS_RIGHTS - 1= extract ACLs from files
Data type: TREXS_CRUISER-NUMC1Optional: Yes
Call by Reference: Yes
I_USE_RAPTOR_ATTRIBUTES - extracting of standard attributes
Data type: TREXS_CRUISER-NUMC1Default: 1
Optional: Yes
Call by Reference: Yes
I_FILE_PATH - connector type = 1 (file) where documents will be stored
Data type: TREXS_CRUISER-STRING_FIELDOptional: Yes
Call by Reference: Yes
I_CRUISE_DOCUMENT_INFO - meta information like seedurl etc.
Data type: TREXS_CRUISE_DOCUMENT_INFOOptional: No
Call by Reference: Yes
I_CRUISE_EXTENSION_LIST - TREX cruiser extension list for parameters
Data type: TREXT_CRUISE_EXTENSION_LISTOptional: Yes
Call by Reference: Yes
I_CRUISE_PP_EXTENSION_LIST - TREX cruiser extension list for parameters
Data type: TREXT_CRUISE_EXTENSION_LISTOptional: Yes
Call by Reference: Yes
I_INDEX_ID - indexid
Data type: TREX_RFC-INDEX_IDOptional: Yes
Call by Reference: Yes
I_DOCKEY_CONVERSION_LIST - cruiser list for convertion (e.g. document keys)
Data type: TREXT_CRUISE_LISTOptional: Yes
Call by Reference: Yes
I_HOST_INFORMATION - TREX cruiser host information
Data type: TREXT_CRUISE_HOST_INFORMATIONOptional: Yes
Call by Reference: Yes
I_REGULAR_EXPRESSION - regular expressions for the TREX cruiser/crawler
Data type: TREXT_CRUISER_REG_EXPRESSIONOptional: Yes
Call by Reference: Yes
I_POSITIVE_FILE_EXTENSIONS - list of positive files extensions which will be crawled
Data type: TREXT_POSITIVE_FILE_EXTENSIONSOptional: Yes
Call by Reference: Yes
I_NEGATIVE_FILE_EXTENSION - list of negative files extensions which will NOT be crawled
Data type: TREXT_NEGATIVE_FILE_EXTENSIONSOptional: Yes
Call by Reference: Yes
I_EXCLUDE_DIRECTORIES - directories which must not be craweld
Data type: TREXT_EXCLUDE_DIRECTORIESOptional: Yes
Call by Reference: Yes
I_RESULT_CONNECTOR - TREX cruiser result connector
Data type: TREXT_CRUISE_RESULT_CONNECTOROptional: Yes
Call by Reference: Yes
I_LANGUAGE - Language according to ISO 639
Data type: LAISOOptional: Yes
Call by Reference: Yes
I_CREATE_SUSPENDED - 1=cruise is suspended after creatation
Data type: TREXS_CRUISER-NUMC1Optional: Yes
Call by Reference: Yes
I_MAX_DEPTH - maximal depth which will be crawled
Data type: TREXS_CRUISER-COUNTEROptional: Yes
Call by Reference: Yes
I_MAX_DOCSIZE - maximal size in bytes which will be crawled
Data type: TREXS_CRUISER-COUNTERDefault: 20000000
Optional: Yes
Call by Reference: Yes
I_MIN_DOCSIZE - minimal size in bytes which will be crawled
Data type: TREXS_CRUISER-COUNTERDefault: 1
Optional: Yes
Call by Reference: Yes
I_CRAWLING_ALGORITHM - 0=down the tree; 1= same server; 2=same domain; 3 = top level domain, 4= free
Data type: TREXS_CRUISER-NUMC1Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for TREX_EXT_CREATE_CRAWL
E_RETURN_CODE - Return Code
Data type: TREX_RFC-RETURN_CODEOptional: No
Call by Reference: Yes
E_RETURN_TEXT - Return Text
Data type: TREX_RFC-RETURN_TEXTOptional: No
Call by Reference: Yes
EXCEPTIONS details
CONVERSION_ERROR - Error during conversion to UTF-8
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR - Error, see error message
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for TREX_EXT_CREATE_CRAWL Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_e_return_code | TYPE TREX_RFC-RETURN_CODE, " | |||
| lv_conversion_error | TYPE TREX_RFC, " | |||
| lv_i_rfc_destination | TYPE TREX_RFC-RFC_DESTINATION, " | |||
| lv_i_preprocessor_pool_size | TYPE TREXS_CRUISER-POOL_SIZE, " 3 | |||
| lv_i_dont_index_dirs | TYPE TREXS_CRUISER-NUMC1, " 0 | |||
| lv_i_access_delay | TYPE TREXS_CRUISER-COUNTER, " 0 | |||
| lv_i_max_retry_count | TYPE TREXS_CRUISER-COUNTER, " 3 | |||
| lv_i_use_robotrules | TYPE TREXS_CRUISER-NUMC1, " 0 | |||
| lv_i_is_multilanguage_index | TYPE TREXS_CRUISER-NUMC1, " 0 | |||
| lv_i_user_agent | TYPE TREXS_CRUISER-STRING_FIELD, " 'TREX' | |||
| lv_i_schedule_time | TYPE TREXS_CRUISER-STRING_FIELD, " | |||
| lv_i_python_command_args | TYPE TREXS_CRUISER-STRING_FIELD, " | |||
| lv_i_result_connector_type | TYPE TREXS_CRUISER-NUMC1, " 0 | |||
| lv_error | TYPE TREXS_CRUISER, " | |||
| lv_e_return_text | TYPE TREX_RFC-RETURN_TEXT, " | |||
| lv_i_cruise_name | TYPE TREXS_CRUISER-CRUISE_NAME, " | |||
| lv_i_use_queueserver | TYPE TREXS_CRUISER-NUMC1, " 1 | |||
| lv_i_optimize_every | TYPE TREXS_CRUISER-COUNTER, " 1 | |||
| lv_i_deindex_flag | TYPE TREXS_CRUISER-NUMC1, " 1 | |||
| lv_i_use_freestyle_container | TYPE TREXS_CRUISER-NUMC1, " 0 | |||
| lv_i_get_access_rights | TYPE TREXS_CRUISER-NUMC1, " 0 | |||
| lv_i_use_raptor_attributes | TYPE TREXS_CRUISER-NUMC1, " 1 | |||
| lv_i_file_path | TYPE TREXS_CRUISER-STRING_FIELD, " | |||
| lv_i_cruise_document_info | TYPE TREXS_CRUISE_DOCUMENT_INFO, " | |||
| lv_i_cruise_extension_list | TYPE TREXT_CRUISE_EXTENSION_LIST, " | |||
| lv_i_cruise_pp_extension_list | TYPE TREXT_CRUISE_EXTENSION_LIST, " | |||
| lv_i_index_id | TYPE TREX_RFC-INDEX_ID, " | |||
| lv_i_dockey_conversion_list | TYPE TREXT_CRUISE_LIST, " | |||
| lv_i_host_information | TYPE TREXT_CRUISE_HOST_INFORMATION, " | |||
| lv_i_regular_expression | TYPE TREXT_CRUISER_REG_EXPRESSION, " | |||
| lv_i_positive_file_extensions | TYPE TREXT_POSITIVE_FILE_EXTENSIONS, " | |||
| lv_i_negative_file_extension | TYPE TREXT_NEGATIVE_FILE_EXTENSIONS, " | |||
| lv_i_exclude_directories | TYPE TREXT_EXCLUDE_DIRECTORIES, " | |||
| lv_i_result_connector | TYPE TREXT_CRUISE_RESULT_CONNECTOR, " | |||
| lv_i_language | TYPE LAISO, " | |||
| lv_i_create_suspended | TYPE TREXS_CRUISER-NUMC1, " 0 | |||
| lv_i_max_depth | TYPE TREXS_CRUISER-COUNTER, " 0 | |||
| lv_i_max_docsize | TYPE TREXS_CRUISER-COUNTER, " 20000000 | |||
| lv_i_min_docsize | TYPE TREXS_CRUISER-COUNTER, " 1 | |||
| lv_i_crawling_algorithm | TYPE TREXS_CRUISER-NUMC1. " 0 |
|   CALL FUNCTION 'TREX_EXT_CREATE_CRAWL' "creates a TREX crawl (cruise) object |
| EXPORTING | ||
| I_RFC_DESTINATION | = lv_i_rfc_destination | |
| I_PREPROCESSOR_POOL_SIZE | = lv_i_preprocessor_pool_size | |
| I_DONT_INDEX_DIRS | = lv_i_dont_index_dirs | |
| I_ACCESS_DELAY | = lv_i_access_delay | |
| I_MAX_RETRY_COUNT | = lv_i_max_retry_count | |
| I_USE_ROBOTRULES | = lv_i_use_robotrules | |
| I_IS_MULTILANGUAGE_INDEX | = lv_i_is_multilanguage_index | |
| I_USER_AGENT | = lv_i_user_agent | |
| I_SCHEDULE_TIME | = lv_i_schedule_time | |
| I_PYTHON_COMMAND_ARGS | = lv_i_python_command_args | |
| I_RESULT_CONNECTOR_TYPE | = lv_i_result_connector_type | |
| I_CRUISE_NAME | = lv_i_cruise_name | |
| I_USE_QUEUESERVER | = lv_i_use_queueserver | |
| I_OPTIMIZE_EVERY | = lv_i_optimize_every | |
| I_DEINDEX_FLAG | = lv_i_deindex_flag | |
| I_USE_FREESTYLE_CONTAINER | = lv_i_use_freestyle_container | |
| I_GET_ACCESS_RIGHTS | = lv_i_get_access_rights | |
| I_USE_RAPTOR_ATTRIBUTES | = lv_i_use_raptor_attributes | |
| I_FILE_PATH | = lv_i_file_path | |
| I_CRUISE_DOCUMENT_INFO | = lv_i_cruise_document_info | |
| I_CRUISE_EXTENSION_LIST | = lv_i_cruise_extension_list | |
| I_CRUISE_PP_EXTENSION_LIST | = lv_i_cruise_pp_extension_list | |
| I_INDEX_ID | = lv_i_index_id | |
| I_DOCKEY_CONVERSION_LIST | = lv_i_dockey_conversion_list | |
| I_HOST_INFORMATION | = lv_i_host_information | |
| I_REGULAR_EXPRESSION | = lv_i_regular_expression | |
| I_POSITIVE_FILE_EXTENSIONS | = lv_i_positive_file_extensions | |
| I_NEGATIVE_FILE_EXTENSION | = lv_i_negative_file_extension | |
| I_EXCLUDE_DIRECTORIES | = lv_i_exclude_directories | |
| I_RESULT_CONNECTOR | = lv_i_result_connector | |
| I_LANGUAGE | = lv_i_language | |
| I_CREATE_SUSPENDED | = lv_i_create_suspended | |
| I_MAX_DEPTH | = lv_i_max_depth | |
| I_MAX_DOCSIZE | = lv_i_max_docsize | |
| I_MIN_DOCSIZE | = lv_i_min_docsize | |
| I_CRAWLING_ALGORITHM | = lv_i_crawling_algorithm | |
| IMPORTING | ||
| E_RETURN_CODE | = lv_e_return_code | |
| E_RETURN_TEXT | = lv_e_return_text | |
| EXCEPTIONS | ||
| CONVERSION_ERROR = 1 | ||
| ERROR = 2 | ||
| . " TREX_EXT_CREATE_CRAWL | ||
ABAP code using 7.40 inline data declarations to call FM TREX_EXT_CREATE_CRAWL
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single RETURN_CODE FROM TREX_RFC INTO @DATA(ld_e_return_code). | ||||
| "SELECT single RFC_DESTINATION FROM TREX_RFC INTO @DATA(ld_i_rfc_destination). | ||||
| "SELECT single POOL_SIZE FROM TREXS_CRUISER INTO @DATA(ld_i_preprocessor_pool_size). | ||||
| DATA(ld_i_preprocessor_pool_size) | = 3. | |||
| "SELECT single NUMC1 FROM TREXS_CRUISER INTO @DATA(ld_i_dont_index_dirs). | ||||
| "SELECT single COUNTER FROM TREXS_CRUISER INTO @DATA(ld_i_access_delay). | ||||
| "SELECT single COUNTER FROM TREXS_CRUISER INTO @DATA(ld_i_max_retry_count). | ||||
| DATA(ld_i_max_retry_count) | = 3. | |||
| "SELECT single NUMC1 FROM TREXS_CRUISER INTO @DATA(ld_i_use_robotrules). | ||||
| "SELECT single NUMC1 FROM TREXS_CRUISER INTO @DATA(ld_i_is_multilanguage_index). | ||||
| "SELECT single STRING_FIELD FROM TREXS_CRUISER INTO @DATA(ld_i_user_agent). | ||||
| DATA(ld_i_user_agent) | = 'TREX'. | |||
| "SELECT single STRING_FIELD FROM TREXS_CRUISER INTO @DATA(ld_i_schedule_time). | ||||
| "SELECT single STRING_FIELD FROM TREXS_CRUISER INTO @DATA(ld_i_python_command_args). | ||||
| "SELECT single NUMC1 FROM TREXS_CRUISER INTO @DATA(ld_i_result_connector_type). | ||||
| "SELECT single RETURN_TEXT FROM TREX_RFC INTO @DATA(ld_e_return_text). | ||||
| "SELECT single CRUISE_NAME FROM TREXS_CRUISER INTO @DATA(ld_i_cruise_name). | ||||
| "SELECT single NUMC1 FROM TREXS_CRUISER INTO @DATA(ld_i_use_queueserver). | ||||
| DATA(ld_i_use_queueserver) | = 1. | |||
| "SELECT single COUNTER FROM TREXS_CRUISER INTO @DATA(ld_i_optimize_every). | ||||
| DATA(ld_i_optimize_every) | = 1. | |||
| "SELECT single NUMC1 FROM TREXS_CRUISER INTO @DATA(ld_i_deindex_flag). | ||||
| DATA(ld_i_deindex_flag) | = 1. | |||
| "SELECT single NUMC1 FROM TREXS_CRUISER INTO @DATA(ld_i_use_freestyle_container). | ||||
| "SELECT single NUMC1 FROM TREXS_CRUISER INTO @DATA(ld_i_get_access_rights). | ||||
| "SELECT single NUMC1 FROM TREXS_CRUISER INTO @DATA(ld_i_use_raptor_attributes). | ||||
| DATA(ld_i_use_raptor_attributes) | = 1. | |||
| "SELECT single STRING_FIELD FROM TREXS_CRUISER INTO @DATA(ld_i_file_path). | ||||
| "SELECT single INDEX_ID FROM TREX_RFC INTO @DATA(ld_i_index_id). | ||||
| "SELECT single NUMC1 FROM TREXS_CRUISER INTO @DATA(ld_i_create_suspended). | ||||
| "SELECT single COUNTER FROM TREXS_CRUISER INTO @DATA(ld_i_max_depth). | ||||
| "SELECT single COUNTER FROM TREXS_CRUISER INTO @DATA(ld_i_max_docsize). | ||||
| DATA(ld_i_max_docsize) | = 20000000. | |||
| "SELECT single COUNTER FROM TREXS_CRUISER INTO @DATA(ld_i_min_docsize). | ||||
| DATA(ld_i_min_docsize) | = 1. | |||
| "SELECT single NUMC1 FROM TREXS_CRUISER INTO @DATA(ld_i_crawling_algorithm). | ||||
Search for further information about these or an SAP related objects