SAP Program RFKORD11 - Print Program: Customer Statement

Description
This program prints customer statements and open item lists as lettersfor customers and vendors. The customer statement is a special type ofaccount statement.
A customer statement lists all clearing procedures between two keydates, for example, the date of the last statement and the currentstatement date. There then follows the open item list at the currentstatement key date and the balance at the key date.
An open item list contains all open items at a key date and the balanceat that key date.
The customer statement and the open item lists can be supplemented bytotals specifications for due items, open item sorted lists andspecifications for noted items.
When using the corresponding two-part form, you can also issue apayment advice addressed to the sender for paying the account statementrecipient, in addition to the part of the statement which remains withthe statement recipient. A payment advice can, however, also be printedparallel to the statement. A printout of the payment advice at the endof the statement is not supported.
As a rule, the print program is only carried out directly during systemconfiguration for testing purposes. Otherwise, the call is carried outautomatically by means of higher-level correspondence programs.

Precondition
Before you can print customer statements and open item lists within thecorrespondence function, the following requirements must be met.
Configuration
Make the basic settings for correspondence in the "Financial accountingglobal settings" Implementation Guide. You can find more detailedexplanations on the standard settings further on in this programdocumentation.
Defining forms
Forms must be defined and activated in the system so that you can printthe required letters. The standard system provides two forms that youcan copy and adapt to meet your own requirements.
In the standard system, the forms F140_CUS_STAT_01 (vertical format)and F140_CUS_STAT_02 (oblong format with payment advice) are used.
RESET N1
The following restrictions apply to the creation of customer statementsand open item lists:
No statements can be created for one-time customers.
Even in the case of head offices with local processing, customerstatements and open item lists are addressed to the head office and notto the branch.
Correspondence types for customer statements or open item lists withindividual text cannot be used for the periodic account statementscreated by means of the program RFKORK00.

Output
A customer statement or an open item list is output for each customeror vendor. A separate spool request is created for each company code.For test purposes, the data can be displayed on the screen. If you donot specify for the print program on which printer the correspondenceshould be printed, the program may take the printer specified in theuser master of the user who started the program or the printerspecified when the job is scheduled.
If minor errors occur during the program run, i.e. errors that do notlead to a program termination, these are listed after the run in anerror list. If you want these error lists to be printed on a certainprinter, you should specify a printer for the log in the print programor the print program variant. If you do not make this specification,the program reacts as above (as for the printer for thecorrespondence). If the program is run online, the error list isdisplayed on the screen. If, however, the program is scheduled as ajob, the job request name for the error list is composed of theidentifier F140ER, the printer name and maybe the correspondence typeand/or the company code.
If the print program is carried out directly and a printout issued,then a log with the created spool requests is issued for each programrun. If you do not specify for the print program on which printer thelog should be printed, the program may take the printer specified inthe user master of the user who started the program or the printerspecified when the job is scheduled. If the program is carried outonline, the log is displayed on the screen. If the program is plannedas a job, the spool request name of the log is made up of theidentifier F140, the printer destination, the date of creation and theprogram ID KORD. If the print program is started by a higher-levelcorrespondence program, the log entry is made by means of thehigher-level program (for example, trigger for correspondence orperiodic account statements).

Information about the Standard Form and Text Symbols
INCLUDE FI_RFFO_SAPSCRIPT_LAYOUT_SET OBJECT DOKU ID TX
Information on the form layout
Information on the text symbols
INCLUDE FI_RFFO_SAPSCRIPT_MAINTAIN OBJECT DOKU ID TX

Example
Make the settings for correspondence in the "Financial accountingglobal settings" Implementation Guide. There you maintain thesuboptions in accordance with the following guidelines.
Note:
For tables in which a default entry without a company code is allowedthe default entry is accessed if no entries for a special company codeexist. If you do not want this, you should only make table entries withwhich the company code is predefined. For the relevant tables, there isa note below on the default entry company code.
The correspondence types, forms and standard texts which start with a Zare examples of customer-specific objects which are not delivered inthe standard system.

1. "Financial Accounting global settings": Correspondence settings:
For customer statements or open item lists, the settings are to be madeas follows.
1.1. Examples of the correspondence types:
A single statement means a statement which is issued for individualaccounts as opposed to consolidated statements over several accounts.Currently only single statements are available.
SAP13 Customer statement (single statement)
X Account necessary
Number date specif... 2
Meaning date 1....... last statement
Meaning date 2....... current statement
SAP14 Open item list (single)
X Account necessary
Number date specif... 1
Meaning date 1....... OI at key date
SAP16 Open item list with payment advice (group)
X Account necessary
Number date specif... 1
Meaning date 1....... OI at key date
ZAP12 Individual customer statement (single)
X Account necessary
X Individual text
Number date specif... 2
Meaning date 1....... last statement
Meaning date 2....... current statement
ZAP13 Individual open item list (single)
X Account necessary
X Individual text
Number date specif... 1
Meaning date 1....... OI at key date
1.2. Examples of program allocation:
The entries for both single or all company codes, whether made manuallyand/or as default values, must be blank.
CCode CorID Program Variant Default text
----------------------------------------------------
0001 SAP13 RFKORD11 SAP13
0001 SAP14 RFKORD11 SAP14
0001 SAP16 RFKORD11 SAP16
0001 ZAP12 RFKORD11 ZAP12 ZF140_CUS_STAT
0001 ZAP13 RFKORD11 ZAP13 ZF140_OPI_LIST
1.3. Examples of default texts:
The default texts must be stored as a standard text with the text IDFIKO. For the use of individual texts, there must always be a standardtext, which is entered during program allocation. A standard text mustcontain at least one comment line (format line = /*). Default texts canbe maintained in the detail screen for program allocation via Goto ->Text editor or, in the initial menu, via Tools -> Word processing ->Standard text.
With the transaction SO10, you can check whether standard texts existin the client in which you need them. The text ID is FIKO. You can copystandard texts from other clients with the transaction SO10 (Menu ->Utilities -> Copy from client).
Everyone wanting to use the text ID FIKO requires the necessaryauthorization. The authorization object for which the authorizationmust be defined is called "standard text". In the standard system, itis contained in the profile S_SACHBEARB and authorizes for every textID. However, everyone needs the authorization for at least the text IDST and FIKO.
In the standard text, you may only use the paragraph formats that aredefined for the relevant form.
If, you enter a language for the correspondence request, into which thedefault text is not translated, you receive an empty editor to enterthe text.
Default text ZF140_CUS_STAT, TEXT-ID FIKO
Format Text area
/* Text for individual account statement
T5 Acct statement from <(>&RF140-DATU1&<)> to <(>&RF140-DATU2&<)>
T5
T5
Default text ZF140_OPI_LIST, TEXT-ID FIKO
Format Text area
/* Text for individual open items list
T5 Open item list for <(>&RF140-STIDA&<)>
T5
T5
If you want to enter individual text passages at several positions inthe form, you can create the default text as in the following example:
Default text ZEXAMPLE, TEXT-ID FIKO
Format Text area
/* Example of several individual text passages
/: IF<(> &RF140-ELEMENT<)>& = 'XXX'.
/* Text in the text element XXX
T5 Text 1
/: ENDIF.
/: IF<(> &RF140-ELEMENT<)>& = 'YYY'.
/* Text in the text element YYY
T5 Text 2
/: ENDIF.
XXX and YYY represent numbers of text elements.
This option, however, cannot be applied in windows that do not containevents (text elements indicated by numbers).
If, however, you want to use certain individual text passages not onlyin the MAIN window but also simultaneously in, for example, the INFOwindow, you must add the following to all the text elements in yourform that contain individual text passages:
Text element in INFO window
Format Text area
/E XXX
/: DEFINE <(>&RF140-ELEMENT&<)> ="XXX"
/: INCLUDE <(>&RF140-TDNAME&<)> OBJECT BKORM ID FIKO LANGUAGE
<(>&RF140-TDSPRAS&<)>
Text element in MAIN window
Format Text area
/E YYY
/: DEFINE <(>&RF140-ELEMENT&<)> ="YYY"
/: INCLUDE <(>&RF140-TDNAME&<)> OBJECT BKORM ID FIKO LANGUAGE
<(>&RF140-TDSPRAS&<)>
Individual texts are then created from default texts for eachcorrespondence request, whose names are made up of the identificationcode F140, the user ID, the date of request and the time of textcreation. These texts can be changed with the maintenance transactionfor correspondence requests.
1.4. Examples of the forms:
The entries are to be left blank either for individual or explicitlyfor all company codes or are to be left blank as default for companycode.
CCode Program Fo Form
--------------------------------------
0001 RFKORD11 F140_CUS_STAT_02
0001 RFKORD11 IT ZF140_CUS_STAT_2
0001 RFKORD11 VB F140_CUS_STAT_04
With the transaction SE71, you should check whether the standard formsexist in the client in which you need them. If standard forms do notexist, you can copy the missing forms from client 000 with thetransaction SE71 (Menu -> Utilities -> Copy from client).
You can create your own forms by copying the standard form and changingthe layout set text (generally in the MAIN window). Your forms muststart with a "Y" or a "Z". The form name should contain theidentification code "F140".
If you want to use a correspondence type for an open item list withpayment advice on the basis of the form F140_CUS_STAT_02, you mustchange the text and the variable RF140-DATU2 to RF140-STIDA in thePAGE2 window.
Your own forms or standard forms in clients not equal to 000 might haveto be adapted during release changeovers according to the standard formin client 000.
If you need the standard form or a form created by you in languages forwhich no translation exists, you can translate the forms using thetransaction SE63.
In the standard form for account statements and open items lists,preparations are made for the usage of individual texts or the directusage of a standard text in the following text elements:
Form Window Text elements
F140_CUS_STAT_01 MAIN 510, 511
F140_CUS_STAT_02 MAIN 510, 511
In principle, however, you can use the individual texts at any positionof a form.
Examples of form modifications:
Form ZF140_CUS_STAT_2
a.) Create the form ZF140_CUS_STAT_2 and copy
the form F140_CUS_STAT_02 into the form ZF140_CUS_STAT_2.
b.) Modify the text elements in the window MAIN as follows:
Format text area
/E 510
/* Acct stmnt from <(>&RF140-DATU1&<)> to <(>&RF140-DATU2&<)>
/: INCLUDE<(>&RF140-TDNAME&<)> OBJECT BKORM ID FIKO LANGUAGE
<(>&RF140-TDSPRAS&<)>
/E 511
/* Open item list for <(>&RF140-STIDA&<)>
/: INCLUDE<(>&RF140-TDNAME&<)> OBJECT BKORM ID FIKO LANGUAGE
<(>&RF140-TDSPRAS&<)>
During output, the variable RF140-TDNAME receives in each case the nameof the individual text belonging to a correspondence request. Thevariable RF140-TDSPRAS contains the entry language or output languageof the text. The entire letter is issued in this language.
1.5. Sender details:
The entries are to be left blank either for individual or explicitlyfor all company codes or are to be left blank as default for companycode.
CCode Program TXTID Header text Footer text Signature
Sender
-----------------------------------------------------------------------
0001 RFKORD11 ADRS_HEADER ADRS_FOOTER ADRS_SIGNATURE
ADRS_SENDER
With the transaction SO10, you should check whether standard textsexist in the client in which you need them. The text ID is ADRS. Ifstandard texts do not exist, you can copy the missing texts from client000 with the transaction SO10 (Menu -> Utilities -> Copy from client).
If, on account of company stationery, you do not require individualspecifications - such as the header text and the footer text - you canleave the respective fields in the table blank. Normally, however, atleast the standard text for the signature is needed. You should,however, make a default entry (company code = blank and name of theprint program) in the table to avoid error messages if you do not wantto use texts.
1.6. Call options:
The entries are to be left blank either for individual or explicitlyfor all company codes or are to be left blank as default for companycode.
CCode Type of correspondence DocEnt. Paymt DocNo. Act
------------------------------------------------------------------------
0001 SAP13 Customer statement (single) X X X X
0001 SAP14 Open item list (single) X X X X
0001 SAP16 Open item list (group) X X X X
0001 ZAP12 Indiv. cust. statement (single) X X X X
0001 ZAP13 Indiv. open item list (single) X X X X
1.7. Sort Variants for Correspondence:
There must be at least one sort variant defined for correspondence forcustomer statements and open item lists. You use the correspondencesort variants to determine the sequence in which the customerstatements or the open item lists are printed.
Sort variant Name
Sequence Field name Name Offset length
K1 Sort by postal code
1 LAND1 Country 3
2 HPSTL Postal code of P.O.box or PSTLZ 10
3 KOART Account type 1
4 KONTO Account 10
K2 Sort by account number
1 KOART Account type 1
2 KONTO Account 10
K3 Sort by document number
1 BELNR Document number 10
2 GJAHR Fiscal year 4
All objects are sorted first by company code and then in the sequenceof fields specified in the sort variant being used.
To display a list of the fields by which an object can be sorted by,select 'Possible entries' (F4). This list of the fields you can selectcontains a selection of fields from the master record tables KNA1,KNB1, LFA1 and LFB1. The fields KOART, KONTO, KTOGR (KNA1-KTOKD orLFA1-KTOKK)and KTOZE (KNB1-KNRZE or LFA1-LNRZE) are filled inaccordance with the account type, which is taken from the master recordtables. The fields "Document number" and "Fiscal year" are only filledin the case of document-related correspondence, such as paymentnotices.
You can extend this list of selectable fields in order to meet yourrequirements. To do so, you can use a repair correction to importfields from the following tables, that are not yet in table RF140V,into table RF140VZZ: KNA1, KNB1, LFA1 and LFB1. When doing so, you musttake care to use the field names and data elements from the standardtables, as the fields in table RF140VZZ are supplied using the namesfrom the master records. After you have added these fields, you mustactivate table RF140VZZ. The sort fields are then supplied inaccordance with their names and in a pre-defined sequence as follows:
The sort fields are drawn first from the KNA1 or LFA1 data and thenfrom KNB1 or LFB1.
For this reason, fields that have the same name in tables KNA1 and KNB1or LFA1 and LFB1 may be overwritten.
1.8 Sort variants for line items:
There must be at least one sort variant for the OI list and forcustomer statements as well as one sort variant for clearingprocedures. You can use the sort variants for line items to determinethe sequence in which the line items are displayed.
Sort variant Name
Sequence Field name Name Offset length
P1 Document date, ref.or doc.no.
1 BLDAT Document date 8
2 HBELN Ref.no.otherwise doc.no. 16
3 BUZEI Item 3
P2 Sp.G/L ind.,doc.date, doc.no.
1 UMSKZ Special G/L indicator 1
2 BLDAT Document date 8
3 HBELN Ref.no. otherwise doc.no. 16
4 BUZEI Item 3
P3 Document date, document number
1 BLDAT Document date 8
2 BELNR Document number 10
3 BUZEI Item 3
P4 Document date, reference
1 BLDAT Document date 8
2 XBLNR Reference 16
3 BUZEI Item 3
P5 Clearing date, clearing document
1 AUGDT Clearing date 8
2 AUGBL Clearing document 10
3 BLDAT Document date 8
4 HBELN Reference without document number 16
5 BUZEI Item 3
P6 Group open items
1 KONTO Account 10
2 BLDAT Document date 8
3 XBLNR Reference 16
4 BUZEI Item 3
P7 Group clearing procedures
1 KONTO Account 10
2 AUGDT Clearing date 8
3 AUGBL Clearing document 10
4 BLDAT Document date 8
5 HBELN Reference otherwise document number 16
Objects are always sorted initially by company code and thereafter inthe sequence of the fields in the sort variant being used. If the sortvariant for line items contains the field UMSKZ in one of its five sortfields, the standard system issues a sub-heading with the name of thespecial G/L indicator in cases where the special G/L indicator haschanged for lists of open items or open noted items. If you do notrequire this, you can deactivate the appropriate heading lines from theform for account statements or open item lists by using the formatcolumn (enter "/*").
To obtain a list of the fields by which the objects are sorted, select"Possible entries" (F4). This list of fields that the user can selectfrom contains a range of fields from the document tables BKPF and BSEG.The field HBELN contains the reference number in case this is needed;otherwise it contains the document number.
You can extend this list of selectable fields in order to meet yourrequirements. To do so, you can use a repair correction to importfields from tables BKPF and BSEG, that are not yet in table RF140W,into table RF140WZZ. When doing so, you must take care to use the fieldnames and data elements from the standard tables, as the fields intable RF140WZZ are supplied using the names from the documents. Afteryou have added these fields, you must activate table RF140WZZ. The sortfields are then supplied in accordance with their names and in apre-defined sequence as follows:
The sort fields are drawn first from the BKPF data and then from theBSEG data.
For this reason, fields that have the same name in tables BKPF and BSEGmay be overwritten.

2. Account statements:
You make the following settings under "Correspondence" in the "AccountsReceivable and Accounts Payable" Implementation Guide.
2.1. Period types:
The definition of the period types is used for the validation and thePF4 help for the customer master record field "Account statement" andwith the parameter for indicators in the master record of the program,for periodic account statements.
Acct Statement Text
---------------------------------------
1 weekly account statement
2 monthly account statement
Program RFKORD11
SAP13 Correspondence sorting K1
OI list sorting P1
Clearing procedure sorting P5
Statement also w/o items X
Key date for due days _______ Standard 1
Net due date sorted list X
Overdue sorted list X
Due date sorted list ___ 30 60 ___ ___
Output to printer Define printer (for
each company code
if necessary)
Log to printer Define printer for error
list (for each company
code if necessary)
SAP14 Correspondence sorting K1
OI list sorting P1
Open item list X
Statement also w/o items X
Key date for due days _______ Standard 1
Net due date sorted list X
Overdue sorted list X
Due date sorted list ___ 30 60 ___ ___
Output to printer Define printer (for
each company code
if necessary)
Log to printer Define printer for error
list (for each company
code if necessary)
SAP16 Form set VB
Correspondence sorting K1
OI list sorting P6
Open item list X
Buying group X
Statement also w/o items X
Key date for due days _______ Standard 1
Net due date sorted list X
Overdue sorted list X
Due date sorted list ___ 30 60 ___ ___
Output to printer Define printer (for
each company code
if necessary)
Log to printer Define printer for error
list (for each company
code if necessary)
ZAP12 Form set IT
Correspondence sorting K1
OI list sorting P1
Clearing procedure sorting P5
Statement also w/o items X
Key date for due days _______ Standard 1
Net due date sorted list X
Overdue sorted list X
Due date sorted list ___ 30 60 ___ ___
Output to printer Define printer (for
each company code
if necessary)
Log to printer Define printer for error
list (for each company
code if necessary)
ZAP13 Form set IT
Correspondence sorting K1
OI list sorting P1
Open item list X
Statement also w/o items X
Key date for due days _______ Standard 1
Net due date sorted list X
Overdue sorted list X
Due date sorted list ___ 30 60 ___ ___
Output to printer Define printer (for
each company code
if necessary)
Log to printer Define printer for error
list (for each company
code if necessary)

145200Correspondence: data from central address management
501622RFKORD10/11: Noted items are not displayed
455877Manual implementation of the 'expiring currencies' functions
397096RFKORD11: expiring currencies incorrect perform
366042Expiring currencies processes FI
362277Expiring currencies: correspondence