SAP FRE_TS_INITIAL Function Module for Initial Transfer of Stock and Consumption Data
FRE_TS_INITIAL is a standard fre ts initial SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Initial Transfer of Stock and Consumption Data 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 fre ts initial FM, simply by entering the name FRE_TS_INITIAL into the relevant SAP transaction such as SE37 or SE38.
Function Group: FRE_TS_DB
Program Name: SAPLFRE_TS_DB
Main Program: SAPLFRE_TS_DB
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:
Function FRE_TS_INITIAL 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 'FRE_TS_INITIAL'"Initial Transfer of Stock and Consumption Data.
EXPORTING
IT_RELART = "Plant Table for National (Centrally Agreed) Contracts
I_SENDER = "Logical System
I_REFID = "Identifier
I_SEND_OPT = "Maintain Basic Settings for Data Transfer
* IT_LOC_TZ_LOCTYPE = "Table type for FRE_WERKS_TZ_LOCTYPE_STY
* IT_STTYP = "Table Type for relevant stock types
I_TR_STOCK = "Checkbox
I_TR_CONSUMPTION = "Checkbox
* I_PARALLEL = ' ' "Checkbox
* I_SVRGRP = "Logon/Server Group Name
* I_TASKS = "Maximum number of parallel tasks
* I_BLOCK = "Number of Records per Package
EXCEPTIONS
NO_DATA = 1 NO_RELEVANT_SITES = 2 NO_RELEVANT_STOCK_TYPES = 3 NO_RESOURCES_FOR_PARALLEL_PROC = 4 COMMUNICATION_FAILURE = 5 LOCK_ERROR = 6
IMPORTING Parameters details for FRE_TS_INITIAL
IT_RELART - Plant Table for National (Centrally Agreed) Contracts
Data type: FRE_DB_ART_SITE_TTYOptional: No
Call by Reference: Yes
I_SENDER - Logical System
Data type: LOGSYSTEMOptional: No
Call by Reference: Yes
I_REFID - Identifier
Data type: FRE_BIF_IDOptional: No
Call by Reference: Yes
I_SEND_OPT - Maintain Basic Settings for Data Transfer
Data type: FRE_SEND_OPTIONOptional: No
Call by Reference: Yes
IT_LOC_TZ_LOCTYPE - Table type for FRE_WERKS_TZ_LOCTYPE_STY
Data type: FRE_WERKS_TZ_LOCTYPE_TTYOptional: Yes
Call by Reference: Yes
IT_STTYP - Table Type for relevant stock types
Data type: FRE_TS_REL_ST_TTYOptional: Yes
Call by Reference: Yes
I_TR_STOCK - Checkbox
Data type: FRE_TS_TRSTOOptional: No
Call by Reference: Yes
I_TR_CONSUMPTION - Checkbox
Data type: FRE_TS_TRCONOptional: No
Call by Reference: Yes
I_PARALLEL - Checkbox
Data type: FRE_PARALLELDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_SVRGRP - Logon/Server Group Name
Data type: RZLLI_APCLOptional: Yes
Call by Reference: Yes
I_TASKS - Maximum number of parallel tasks
Data type: DDMAXTASKSOptional: Yes
Call by Reference: Yes
I_BLOCK - Number of Records per Package
Data type: FRE_PACKAGE_SIZEOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
NO_DATA - no data to be tranferred or no flag for stock or consumption set
Data type:Optional: No
Call by Reference: Yes
NO_RELEVANT_SITES - no relevant sites in table FRE_DB_SITE
Data type:Optional: No
Call by Reference: Yes
NO_RELEVANT_STOCK_TYPES - no relevant stock types in table FRE_TS_REL_TS
Data type:Optional: No
Call by Reference: Yes
NO_RESOURCES_FOR_PARALLEL_PROC - no resources for parallel processing
Data type:Optional: No
Call by Reference: Yes
COMMUNICATION_FAILURE - error during communication
Data type:Optional: No
Call by Reference: Yes
LOCK_ERROR - initial or delta transfer is already running
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for FRE_TS_INITIAL 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_no_data | TYPE STRING, " | |||
lv_it_relart | TYPE FRE_DB_ART_SITE_TTY, " | |||
lv_i_sender | TYPE LOGSYSTEM, " | |||
lv_i_refid | TYPE FRE_BIF_ID, " | |||
lv_i_send_opt | TYPE FRE_SEND_OPTION, " | |||
lv_it_loc_tz_loctype | TYPE FRE_WERKS_TZ_LOCTYPE_TTY, " | |||
lv_no_relevant_sites | TYPE FRE_WERKS_TZ_LOCTYPE_TTY, " | |||
lv_it_sttyp | TYPE FRE_TS_REL_ST_TTY, " | |||
lv_no_relevant_stock_types | TYPE FRE_TS_REL_ST_TTY, " | |||
lv_i_tr_stock | TYPE FRE_TS_TRSTO, " | |||
lv_no_resources_for_parallel_proc | TYPE FRE_TS_TRSTO, " | |||
lv_i_tr_consumption | TYPE FRE_TS_TRCON, " | |||
lv_communication_failure | TYPE FRE_TS_TRCON, " | |||
lv_i_parallel | TYPE FRE_PARALLEL, " SPACE | |||
lv_lock_error | TYPE FRE_PARALLEL, " | |||
lv_i_svrgrp | TYPE RZLLI_APCL, " | |||
lv_i_tasks | TYPE DDMAXTASKS, " | |||
lv_i_block | TYPE FRE_PACKAGE_SIZE. " |
  CALL FUNCTION 'FRE_TS_INITIAL' "Initial Transfer of Stock and Consumption Data |
EXPORTING | ||
IT_RELART | = lv_it_relart | |
I_SENDER | = lv_i_sender | |
I_REFID | = lv_i_refid | |
I_SEND_OPT | = lv_i_send_opt | |
IT_LOC_TZ_LOCTYPE | = lv_it_loc_tz_loctype | |
IT_STTYP | = lv_it_sttyp | |
I_TR_STOCK | = lv_i_tr_stock | |
I_TR_CONSUMPTION | = lv_i_tr_consumption | |
I_PARALLEL | = lv_i_parallel | |
I_SVRGRP | = lv_i_svrgrp | |
I_TASKS | = lv_i_tasks | |
I_BLOCK | = lv_i_block | |
EXCEPTIONS | ||
NO_DATA = 1 | ||
NO_RELEVANT_SITES = 2 | ||
NO_RELEVANT_STOCK_TYPES = 3 | ||
NO_RESOURCES_FOR_PARALLEL_PROC = 4 | ||
COMMUNICATION_FAILURE = 5 | ||
LOCK_ERROR = 6 | ||
. " FRE_TS_INITIAL |
ABAP code using 7.40 inline data declarations to call FM FRE_TS_INITIAL
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.DATA(ld_i_parallel) | = ' '. | |||
Search for further information about these or an SAP related objects