SAP TXW_EXT_SEGMENT_WRITE Function Module for RFC - write segment data package
TXW_EXT_SEGMENT_WRITE is a standard txw ext segment write SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for RFC - write segment data package 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 txw ext segment write FM, simply by entering the name TXW_EXT_SEGMENT_WRITE into the relevant SAP transaction such as SE37 or SE38.
Function Group: TXW2_EXT
Program Name: SAPLTXW2_EXT
Main Program: SAPLTXW2_EXT
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function TXW_EXT_SEGMENT_WRITE 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 'TXW_EXT_SEGMENT_WRITE'"RFC - write segment data package.
EXPORTING
ID_HANDLE = "UUID in character form
ID_SEGMENT = "Segment structure
* ID_SEGTXT = "Short Description of Repository Objects
* ID_INIT = ' ' "General Flag
TABLES
IT_DATA = "DART - data structure for external calls
* IT_FCAT_ST = "DD Interface: Table Fields for DDIF_FIELDINFO_GET
* IT_FCAT_DB = "DD Interface: Table Fields for DDIF_FIELDINFO_GET
EXCEPTIONS
INVALID_STRUCTURE = 1 SEGMENT_META_FAILURE = 2 NO_AUTHORITY = 3 MISSING_INIT = 4 PACKAGE_OVERFLOW = 5
IMPORTING Parameters details for TXW_EXT_SEGMENT_WRITE
ID_HANDLE - UUID in character form
Data type: SYSUUID_COptional: No
Call by Reference: No ( called with pass by value option)
ID_SEGMENT - Segment structure
Data type: TXW_C_STRC-EXP_STRUCTOptional: No
Call by Reference: No ( called with pass by value option)
ID_SEGTXT - Short Description of Repository Objects
Data type: AS4TEXTOptional: Yes
Call by Reference: No ( called with pass by value option)
ID_INIT - General Flag
Data type: FLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for TXW_EXT_SEGMENT_WRITE
IT_DATA - DART - data structure for external calls
Data type: TXW_EXT_DATAOptional: No
Call by Reference: Yes
IT_FCAT_ST - DD Interface: Table Fields for DDIF_FIELDINFO_GET
Data type: DFIESOptional: Yes
Call by Reference: Yes
IT_FCAT_DB - DD Interface: Table Fields for DDIF_FIELDINFO_GET
Data type: DFIESOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
INVALID_STRUCTURE - Invalid structure
Data type:Optional: No
Call by Reference: Yes
SEGMENT_META_FAILURE - Segment has different structure
Data type:Optional: No
Call by Reference: Yes
NO_AUTHORITY - No authority to create files
Data type:Optional: No
Call by Reference: Yes
MISSING_INIT - Missing initialization
Data type:Optional: No
Call by Reference: Yes
PACKAGE_OVERFLOW - Overflow of package number
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for TXW_EXT_SEGMENT_WRITE 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: | ||||
| lt_it_data | TYPE STANDARD TABLE OF TXW_EXT_DATA, " | |||
| lv_id_handle | TYPE SYSUUID_C, " | |||
| lv_invalid_structure | TYPE SYSUUID_C, " | |||
| lv_id_segment | TYPE TXW_C_STRC-EXP_STRUCT, " | |||
| lt_it_fcat_st | TYPE STANDARD TABLE OF DFIES, " | |||
| lv_segment_meta_failure | TYPE DFIES, " | |||
| lv_id_segtxt | TYPE AS4TEXT, " | |||
| lt_it_fcat_db | TYPE STANDARD TABLE OF DFIES, " | |||
| lv_no_authority | TYPE DFIES, " | |||
| lv_id_init | TYPE FLAG, " SPACE | |||
| lv_missing_init | TYPE FLAG, " | |||
| lv_package_overflow | TYPE FLAG. " |
|   CALL FUNCTION 'TXW_EXT_SEGMENT_WRITE' "RFC - write segment data package |
| EXPORTING | ||
| ID_HANDLE | = lv_id_handle | |
| ID_SEGMENT | = lv_id_segment | |
| ID_SEGTXT | = lv_id_segtxt | |
| ID_INIT | = lv_id_init | |
| TABLES | ||
| IT_DATA | = lt_it_data | |
| IT_FCAT_ST | = lt_it_fcat_st | |
| IT_FCAT_DB | = lt_it_fcat_db | |
| EXCEPTIONS | ||
| INVALID_STRUCTURE = 1 | ||
| SEGMENT_META_FAILURE = 2 | ||
| NO_AUTHORITY = 3 | ||
| MISSING_INIT = 4 | ||
| PACKAGE_OVERFLOW = 5 | ||
| . " TXW_EXT_SEGMENT_WRITE | ||
ABAP code using 7.40 inline data declarations to call FM TXW_EXT_SEGMENT_WRITE
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 EXP_STRUCT FROM TXW_C_STRC INTO @DATA(ld_id_segment). | ||||
| DATA(ld_id_init) | = ' '. | |||
Search for further information about these or an SAP related objects