SAP Reports / Programs | Financial Accounting | General Ledger Accounting | Information System(FI-GL-IS) SAP FI

RFIDPTFO SAP ABAP Report - documentation and ABAP source code







RFIDPTFO is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). It is used for The report lists vendor, customer and VAT transactions for Portugal to claim VAT refunds (according Despacho Normativo nº 53/2005)...see full standard documentation available for this report. Also check out the submitted Comments related to this SAP report and the details below to see which OBJECTS it interacts with such as TABLES, FUNCTION MODULES, INCLUDES ETC.

If you would like to execute this report or see the full code listing simply enter RFIDPTFO into the relevant SAP transactions such as SE38 or SE80


ABAP code to call this SAP report using the submit statement

This report can be called from another progam/report simply by using the ABAP SUBMIT statement, see below for example ABAP code snipts of how to do this.






SUBMIT RFIDPTFO. "Basic submit
SUBMIT RFIDPTFO AND RETURN. "Return to original report after report execution complete
SUBMIT RFIDPTFO VIA SELECTION-SCREEN. "Display selection screen of submitted report to user
    See more syntax options for the ABAP SUBMIT statement


Text pool values


Selection Text: P_SPLFDC = Field No.Export Declaration.
Selection Text: P_PRD = D .
Selection Text: P_PD = Posting Date
Selection Text: P_OTHV = Other
Selection Text: P_OTHC = Other
Selection Text: P_NO_KTO = All items of these accounts
Selection Text: P_NONEV = None
Selection Text: P_NONEC = None
Selection Text: P_N3 = Appendix for N-3
Selection Text: P_N2 = Appendix for N-2
Selection Text: P_N1 = Appendix for N-1
Selection Text: P_FINTAP = Integrate from App. Server
Selection Text: P_FILOP = File Output?
Selection Text: P_FILINT = File to be integrated?
Selection Text: P_FIAP = Download to Application Server
Selection Text: P_DETLT = Detail List?
Selection Text: P_DD = Document Date
Selection Text: P_CORR = Select correction documents
Selection Text: P_BSP = Select account for bank charg.
Selection Text: P_BKTXTV = Ref. document: Header text
Selection Text: P_BKTXTC = Ref. document: Header text
Selection Text: P_BKTXT = Ref. document: Header text
Selection Text: P_AMOUNT = Min. base Anexo (per partner)
Selection Text: P_AMNT2 = Min. base Nota (per doc.)
Selection Text: S_TAXKON = Account for correct. post.
Selection Text: S_LIFNR = Vendor
Selection Text: S_KUNNR = Customer
Selection Text: S_HKONT = Account for bank charges
Selection Text: S_AMWSKZ = Tax code for Anexo
Selection Text: P_YEAR = D .
Selection Text: P_XLIFNR = Select vendors
Selection Text: P_XKUNNR = Select customers
Selection Text: P_XBLNRV = Ref. document: XBLNR
Selection Text: P_XBLNRC = Ref. document: XBLNR
Selection Text: P_XBLNR = Ref. document: XBLNR
Selection Text: P_VERV5 = Vrsn - Field 24
Selection Text: P_VERV4 = Vrsn - Field 23
Selection Text: P_VERV3 = Vrsn - Field 22





Selection Text: P_VERV2 = Vrsn - Field 21
Selection Text: P_VERV1 = Vrsn - Field 20
Selection Text: P_VERR3 = Vrsn - Other Corrections
Selection Text: P_VERR2 = Vrsn - Corrections Pro-rata
Selection Text: P_VERR1 = Vrsn - Op with Nat. Bus. Part
Selection Text: P_VERC4 = Vrsn - Oth exempted opr
Selection Text: P_VERC3 = Vrsn - Operations abroad
Selection Text: P_VERC2 = Vrsn - Goods exportation
Selection Text: P_VERC1 = Vrsn - Op with National Cust
Selection Text: P_SPLFDV = Field No.Customs Document
Selection Text: FILE_PAP = Download to Application Server
Selection Text: FILE_P = DPIVA File name to integrate
Selection Text: FILEAP = D .
Selection Text: FILE = Name of File
Text Symbol: 009 = Customer
Text Symbol: 008 = Vendor
Text Symbol: 007 = 1
Text Symbol: 006 = [according to no.1 a)]
Text Symbol: R00 = Base Amount of
Text Symbol: R01 = Correction VAT
Text Symbol: R02 = | Operations with national Business Partners
Text Symbol: R03 = | VAT Corrections below 1000
Text Symbol: R04 = | Corrections due to Pro-Rata
Text Symbol: R05 = | Other Corrections
Text Symbol: R06 = List of tax payers to whom regard the correction VAT.
Text Symbol: 005 = List Of Customers
Text Symbol: 004 = Appendix 1
Text Symbol: 003 = Appendix No. :
Text Symbol: 002 = Tax Period :
Text Symbol: 001 = Fiscal ID :
Text Symbol: V00 = Country
Text Symbol: V01 = Fiscal ID
Text Symbol: V02 = Customs Document
Text Symbol: V03 = Issue Period
Text Symbol: V04 = Year
Text Symbol: V05 = Month
Text Symbol: V06 = Purchase Amount
Text Symbol: V07 = Deducted VAT
Text Symbol: V08 = (VAT Excluded)





Text Symbol: V09 = | Field 20
Text Symbol: V10 = | Field 21
Text Symbol: V11 = | Field 22
Text Symbol: V12 = | Field 23
Text Symbol: V13 = | Field 24
Text Symbol: V14 = | Purchases with amounts below 5.000,00
Text Symbol: V15 = List of vendors with operations that caused tax deduction in the period
Text Symbol: V16 = Additional Selection Crieteria
Text Symbol: V17 = Error list: documents exceeding 5% limit
Text Symbol: V18 = Document number
Text Symbol: M01 = Month:
Text Symbol: L11 = Amount
Text Symbol: L10 = Export Declaration Number
Text Symbol: L09 = Fiscal ID Number
Text Symbol: L08 = Line
Text Symbol: L07 = Total
Text Symbol: L06 = | Other exempted operations which allow taxdeduction
Text Symbol: L05 = | Operations abroad
Text Symbol: L04 = | Goods Exportation
Text Symbol: L03 = | Operations with national customers below 5.000,00
Text Symbol: L02 = | Operations with national customers
Text Symbol: L01 = | Line | Fiscal ID Number | Export Declaration Number | Amount
Text Symbol: L00 = List of customers with operations that originated deductible VAT in the period.
Text Symbol: K01 = ID:
Text Symbol: F13 = Tax correction postings without vendor/customer line item
Text Symbol: F12 = Bank charges
Text Symbol: F10 = Grouping of Documents
Text Symbol: F08 = Selection according to tax codes
Text Symbol: F06 = Further restrictions
Text Symbol: F05 = Selection of business partners
Text Symbol: F04 = Direito à Deducâo
Text Symbol: F03 = Periodicity
Text Symbol: F01 = Control information: Printout Anexo
Text Symbol: E01 = Sum of amounts below minimum
Text Symbol: B01 = Company code:
Text Symbol: 019 = Carryforward periods
Text Symbol: 018 = /
Text Symbol: 017 = Period / Year of Appendix
Text Symbol: 016 = Period / Year of Declaration



Text Symbol: 015 = [according to no.1 c)]
Text Symbol: 014 = List of tax payers to whom regard the correction VAT
Text Symbol: 013 = [according to no.1 b)]
Text Symbol: 012 = List of Vendors
Text Symbol: 011 = Appendix 2
Text Symbol: 010 = Correction VAT


INCLUDES used within this REPORT RFIDPTFO

INCLUDE RFIDPTFO_ALVLIST.


TABLES used within REPORT and the associated SELECT statement:

No SAP DATABASE tables are accessed within this REPORT code!


Function Modules used within report and the associated call statement:

READ_BANK_ADDRESS CALL FUNCTION 'READ_BANK_ADDRESS' EXPORTING bank_country = t012-banks bank_number = t012-bankl IMPORTING bnka_wa = wa_bnka EXCEPTIONS not_found = 1.

OPEN_FORM * CALL FUNCTION 'OPEN_FORM' * EXPORTING * device = 'PRINTER' * form = l_tdform * language = t001-spras * options = itcpo * dialog = 'X' * EXCEPTIONS * form = 1.

START_FORM ** CALL FUNCTION 'START_FORM'.

WRITE_FORM ** CALL FUNCTION 'WRITE_FORM' ** EXPORTING ** element = 'TITLE' ** window = 'MAIN' ** type = 'TOP'.

WRITE_FORM ** CALL FUNCTION 'WRITE_FORM' ** EXPORTING ** window = 'FOOTER'.

WRITE_FORM *** CALL FUNCTION 'WRITE_FORM' *** EXPORTING *** element = 'CARRY' *** type = 'TOP'.

WRITE_FORM ** CALL FUNCTION 'WRITE_FORM' ** EXPORTING ** element = 'VEN_ITEM' ** window = 'MAIN'.

WRITE_FORM ** CALL FUNCTION 'WRITE_FORM' ** EXPORTING ** element = 'VEN_ITEM' ** window = 'MAIN'.

END_FORM * CALL FUNCTION 'END_FORM'.

CLOSE_FORM * CALL FUNCTION 'CLOSE_FORM'.

CUSTOMER_READ CALL FUNCTION 'CUSTOMER_READ' EXPORTING i_bukrs = space i_kunnr = l_kunnr IMPORTING e_kna1 = lwa_kna1.

CUSTOMER_READ CALL FUNCTION 'CUSTOMER_READ' EXPORTING i_bukrs = space i_kunnr = l_kunnr IMPORTING e_kna1 = lwa_kna1.

VENDOR_READ CALL FUNCTION 'VENDOR_READ' EXPORTING i_bukrs = space i_lifnr = l_lifnr IMPORTING e_lfa1 = lwa_lfa1.

VENDOR_READ CALL FUNCTION 'VENDOR_READ' EXPORTING i_bukrs = space i_lifnr = l_lifnr IMPORTING e_lfa1 = lwa_lfa1.

GUI_DOWNLOAD CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING * BIN_FILESIZE = FILENAME = gui_file FILETYPE = 'ASC' * APPEND = ' ' * WRITE_FIELD_SEPARATOR = ' ' * HEADER = '00' * TRUNC_TRAILING_BLANKS = ' ' * WRITE_LF = 'X' * COL_SELECT = ' ' * COL_SELECT_MASK = ' ' * DAT_MODE = ' ' * CONFIRM_OVERWRITE = ' ' * NO_AUTH_CHECK = ' ' * CODEPAGE = ' ' * IGNORE_CERR = ABAP_TRUE * REPLACEMENT = '#' * WRITE_BOM = ' ' TRUNC_TRAILING_BLANKS_EOL = ' ' * WK1_N_FORMAT = ' ' * WK1_N_SIZE = ' ' * WK1_T_FORMAT = ' ' * WK1_T_SIZE = ' ' * IMPORTING * FILELENGTH = TABLES DATA_TAB = downtab_new * FIELDNAMES = EXCEPTIONS FILE_WRITE_ERROR = 1 NO_BATCH = 2 GUI_REFUSE_FILETRANSFER = 3 INVALID_TYPE = 4 NO_AUTHORITY = 5 UNKNOWN_ERROR = 6 HEADER_NOT_ALLOWED = 7 SEPARATOR_NOT_ALLOWED = 8 FILESIZE_NOT_ALLOWED = 9 HEADER_TOO_LONG = 10 DP_ERROR_CREATE = 11 DP_ERROR_SEND = 12 DP_ERROR_WRITE = 13 UNKNOWN_DP_ERROR = 14 ACCESS_DENIED = 15 DP_OUT_OF_MEMORY = 16 DISK_FULL = 17 DP_TIMEOUT = 18 FILE_NOT_FOUND = 19 DATAPROVIDER_EXCEPTION = 20 CONTROL_FLUSH_ERROR = 21 OTHERS = 22 .

WS_DOWNLOAD * CALL FUNCTION 'WS_DOWNLOAD' * EXPORTING ** BIN_FILESIZE = ' ' ** CODEPAGE = ' ' * FILENAME = gui_file * FILETYPE = 'ASC' ** MODE = ' ' ** WK1_N_FORMAT = ' ' ** WK1_N_SIZE = ' ' ** WK1_T_FORMAT = ' ' ** WK1_T_SIZE = ' ' ** COL_SELECT = ' ' ** COL_SELECTMASK = ' ' ** NO_AUTH_CHECK = ' ' ** IMPORTING ** FILELENGTH = * TABLES * DATA_TAB = downtab_new ** FIELDNAMES = * EXCEPTIONS * FILE_OPEN_ERROR = 1 * FILE_WRITE_ERROR = 2 * INVALID_FILESIZE = 3 * INVALID_TYPE = 4 * NO_BATCH = 5 * UNKNOWN_ERROR = 6 * INVALID_TABLE_WIDTH = 7 * GUI_REFUSE_FILETRANSFER = 8 * CUSTOMER_ERROR = 9 * OTHERS = 10.

GUI_DOWNLOAD CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING * BIN_FILESIZE = FILENAME = gui_file FILETYPE = 'ASC' * APPEND = ' ' * WRITE_FIELD_SEPARATOR = ' ' * HEADER = '00' * TRUNC_TRAILING_BLANKS = ' ' * WRITE_LF = 'X' * COL_SELECT = ' ' * COL_SELECT_MASK = ' ' * DAT_MODE = ' ' * CONFIRM_OVERWRITE = ' ' * NO_AUTH_CHECK = ' ' * CODEPAGE = ' ' * IGNORE_CERR = ABAP_TRUE * REPLACEMENT = '#' * WRITE_BOM = ' ' TRUNC_TRAILING_BLANKS_EOL = ' ' * WK1_N_FORMAT = ' ' * WK1_N_SIZE = ' ' * WK1_T_FORMAT = ' ' * WK1_T_SIZE = ' ' * IMPORTING * FILELENGTH = TABLES DATA_TAB = downtab * FIELDNAMES = EXCEPTIONS FILE_WRITE_ERROR = 1 NO_BATCH = 2 GUI_REFUSE_FILETRANSFER = 3 INVALID_TYPE = 4 NO_AUTHORITY = 5 UNKNOWN_ERROR = 6 HEADER_NOT_ALLOWED = 7 SEPARATOR_NOT_ALLOWED = 8 FILESIZE_NOT_ALLOWED = 9 HEADER_TOO_LONG = 10 DP_ERROR_CREATE = 11 DP_ERROR_SEND = 12 DP_ERROR_WRITE = 13 UNKNOWN_DP_ERROR = 14 ACCESS_DENIED = 15 DP_OUT_OF_MEMORY = 16 DISK_FULL = 17 DP_TIMEOUT = 18 FILE_NOT_FOUND = 19 DATAPROVIDER_EXCEPTION = 20 CONTROL_FLUSH_ERROR = 21 OTHERS = 22 .

WS_DOWNLOAD * CALL FUNCTION 'WS_DOWNLOAD' * EXPORTING ** BIN_FILESIZE = ' ' ** CODEPAGE = ' ' * FILENAME = gui_file * FILETYPE = 'ASC' ** MODE = ' ' ** WK1_N_FORMAT = ' ' ** WK1_N_SIZE = ' ' ** WK1_T_FORMAT = ' ' ** WK1_T_SIZE = ' ' ** COL_SELECT = ' ' ** COL_SELECTMASK = ' ' ** NO_AUTH_CHECK = ' ' ** IMPORTING ** FILELENGTH = * TABLES * DATA_TAB = downtab ** FIELDNAMES = * EXCEPTIONS * FILE_OPEN_ERROR = 1 * FILE_WRITE_ERROR = 2 * INVALID_FILESIZE = 3 * INVALID_TYPE = 4 * NO_BATCH = 5 * UNKNOWN_ERROR = 6 * INVALID_TABLE_WIDTH = 7 * GUI_REFUSE_FILETRANSFER = 8 * CUSTOMER_ERROR = 9 * OTHERS = 10.

GUI_UPLOAD CALL FUNCTION 'GUI_UPLOAD' EXPORTING filename = l_gui_file FILETYPE = 'ASC' * HAS_FIELD_SEPARATOR = ' ' * HEADER_LENGTH = 0 * READ_BY_LINE = 'X' * DAT_MODE = ' ' * CODEPAGE = ' ' * IGNORE_CERR = ABAP_TRUE * REPLACEMENT = '#' * CHECK_BOM = ' ' * NO_AUTH_CHECK = ' ' * IMPORTING * FILELENGTH = * HEADER = tables data_tab = downtab_t * EXCEPTIONS * FILE_OPEN_ERROR = 1 * FILE_READ_ERROR = 2 * NO_BATCH = 3 * GUI_REFUSE_FILETRANSFER = 4 * INVALID_TYPE = 5 * NO_AUTHORITY = 6 * UNKNOWN_ERROR = 7 * BAD_DATA_FORMAT = 8 * HEADER_NOT_ALLOWED = 9 * SEPARATOR_NOT_ALLOWED = 10 * HEADER_TOO_LONG = 11 * UNKNOWN_DP_ERROR = 12 * ACCESS_DENIED = 13 * DP_OUT_OF_MEMORY = 14 * DISK_FULL = 15 * DP_TIMEOUT = 16 * OTHERS = 17 .

RE_LAST_DAY_OF_MONTH CALL FUNCTION 'RE_LAST_DAY_OF_MONTH' EXPORTING I_DATUM = todate IMPORTING * E_KZ_ULT = E_TT = lastday.

FILE_VALIDATE_NAME CALL FUNCTION 'FILE_VALIDATE_NAME' EXPORTING logical_filename = gc_filename parameter_1 = sy-repid parameter_2 = sy-msgv1 parameter_3 = 'WRITE' CHANGING physical_filename = p_sefile_name2 EXCEPTIONS OTHERS = 1.

FILE_VALIDATE_NAME CALL FUNCTION 'FILE_VALIDATE_NAME' EXPORTING logical_filename = gc_filename parameter_1 = sy-repid parameter_2 = sy-msgv1 parameter_3 = 'WRITE' CHANGING physical_filename = p_sefile_name EXCEPTIONS OTHERS = 1.

FILE_VALIDATE_NAME CALL FUNCTION 'FILE_VALIDATE_NAME' EXPORTING logical_filename = gc_filename parameter_1 = sy-repid parameter_2 = sy-msgv1 parameter_3 = 'READ' CHANGING physical_filename = p_sefile_name EXCEPTIONS OTHERS = 1.

FILE_VALIDATE_NAME CALL FUNCTION 'FILE_VALIDATE_NAME' EXPORTING logical_filename = gc_filename parameter_1 = sy-repid parameter_2 = sy-msgv1 parameter_3 = 'WRITE' CHANGING physical_filename = fileap EXCEPTIONS OTHERS = 1.

FILE_VALIDATE_NAME CALL FUNCTION 'FILE_VALIDATE_NAME' EXPORTING logical_filename = gc_filename parameter_1 = sy-repid parameter_2 = sy-msgv1 parameter_3 = 'READ' CHANGING physical_filename = file_pap EXCEPTIONS OTHERS = 1.



Contribute (Add Comments)

Although this basic information may have limited use it does provide an easy to find location to store any knowledge about this program/report.

The contribute/comments section below therefore offer's an opportunity for anyone to add additional information. This can be anything from useful hints, tips and screen shots to relevant SAP notes or anything else you feel is relevant to this report.

This will then be available for everyone to easily find by simply searching on the report name RFIDPTFO or its description.