SAP Function Modules

TXW_DATA_VIEW_FILE_WRITE_INIT SAP Function module - Initialize data view query file







TXW_DATA_VIEW_FILE_WRITE_INIT is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name TXW_DATA_VIEW_FILE_WRITE_INIT into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: TXW2
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM TXW_DATA_VIEW_FILE_WRITE_INIT - TXW DATA VIEW FILE WRITE INIT





CALL FUNCTION 'TXW_DATA_VIEW_FILE_WRITE_INIT' "Initialize data view query file
  EXPORTING
*   fiscal_year =               " txw_vwlog2-fisc_year  Fiscal year (for data)
*   data_view =                 " txw_vwlog2-tax_view  Data view
    l_file =                    " dart1_lfile   Export file (logical name)
    directory_set =             " dart1_voldir  Directory set
*   append_to_file = SPACE      " c             Flag: Append to file
*   test_only = SPACE           "               Flag: Only test
*   split_file = SPACE          " c             Flag: Split file
*   binary_mode = SPACE         " c             Flag: Open file in binary mode
*   uuid_create = SPACE         " c             Flag: Create new UUID
  IMPORTING
    file_uuid =                 " txw_vwlog2-file_uuid  File ID
    export_file =               " txw_dir2-file_name  Export file (physical filename)
    eol_bytes =                 " i             Number of EOL bytes (1 or 2)
    vol_id =                    " txw_vwlog2-vol_id  Current volume id
  EXCEPTIONS
    FILENAME_INVALID = 1        "               Invalid filename
    FILE_OPEN_FAILED = 2        "               Could not open file
    LOCK_SYSTEM_FAILURE = 3     "               Could not lock file
    .  "  TXW_DATA_VIEW_FILE_WRITE_INIT

ABAP code example for Function Module TXW_DATA_VIEW_FILE_WRITE_INIT





The ABAP code below is a full code listing to execute function module TXW_DATA_VIEW_FILE_WRITE_INIT including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_file_uuid  TYPE TXW_VWLOG2-FILE_UUID ,
ld_export_file  TYPE TXW_DIR2-FILE_NAME ,
ld_eol_bytes  TYPE I ,
ld_vol_id  TYPE TXW_VWLOG2-VOL_ID .


SELECT single FISC_YEAR
FROM TXW_VWLOG2
INTO @DATA(ld_fiscal_year).


SELECT single TAX_VIEW
FROM TXW_VWLOG2
INTO @DATA(ld_data_view).

DATA(ld_l_file) = 'Check type of data required'.
DATA(ld_directory_set) = 'Check type of data required'.
DATA(ld_append_to_file) = 'Check type of data required'.
DATA(ld_test_only) = 'some text here'.
DATA(ld_split_file) = 'Check type of data required'.
DATA(ld_binary_mode) = 'Check type of data required'.
DATA(ld_uuid_create) = 'Check type of data required'. . CALL FUNCTION 'TXW_DATA_VIEW_FILE_WRITE_INIT' EXPORTING * fiscal_year = ld_fiscal_year * data_view = ld_data_view l_file = ld_l_file directory_set = ld_directory_set * append_to_file = ld_append_to_file * test_only = ld_test_only * split_file = ld_split_file * binary_mode = ld_binary_mode * uuid_create = ld_uuid_create IMPORTING file_uuid = ld_file_uuid export_file = ld_export_file eol_bytes = ld_eol_bytes vol_id = ld_vol_id EXCEPTIONS FILENAME_INVALID = 1 FILE_OPEN_FAILED = 2 LOCK_SYSTEM_FAILURE = 3 . " TXW_DATA_VIEW_FILE_WRITE_INIT
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_file_uuid  TYPE TXW_VWLOG2-FILE_UUID ,
ld_fiscal_year  TYPE TXW_VWLOG2-FISC_YEAR ,
ld_export_file  TYPE TXW_DIR2-FILE_NAME ,
ld_data_view  TYPE TXW_VWLOG2-TAX_VIEW ,
ld_eol_bytes  TYPE I ,
ld_l_file  TYPE DART1_LFILE ,
ld_vol_id  TYPE TXW_VWLOG2-VOL_ID ,
ld_directory_set  TYPE DART1_VOLDIR ,
ld_append_to_file  TYPE C ,
ld_test_only  TYPE STRING ,
ld_split_file  TYPE C ,
ld_binary_mode  TYPE C ,
ld_uuid_create  TYPE C .


SELECT single FISC_YEAR
FROM TXW_VWLOG2
INTO ld_fiscal_year.


SELECT single TAX_VIEW
FROM TXW_VWLOG2
INTO ld_data_view.

ld_l_file = 'Check type of data required'.
ld_directory_set = 'Check type of data required'.
ld_append_to_file = 'Check type of data required'.
ld_test_only = 'some text here'.
ld_split_file = 'Check type of data required'.
ld_binary_mode = 'Check type of data required'.
ld_uuid_create = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name TXW_DATA_VIEW_FILE_WRITE_INIT or its description.