Programme SAP RFKORD10 - Print Program: Account Statement

Description
This program prints account statements and open items lists forcustomers and vendors in letter form.
For account statements, all postings between two key dates, as well asthe opening and closing balance, are listed. Alternatively, the openingbalance can be divided up into the causal open items.
For the open items list, all open items at a key date, and the balanceat the key date are listed.
The account statements and open items lists can be supplemented bytotals specifications to due items, sorting of open items, andspecifications on noted items.
As a rule, the print program is carried out directly only during theconfiguration for testing purposes. Otherwise, the call is carried outautomatically by means of higher-level correspondence programs.

Precondition
Before you can print account statements and open items lists withincorrespondence, 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 a form that you cancopy and adapt to your own requirements.
In the standard system, the forms F140_ACC_STAT_01 and F140_ACC_STAT_02are used.
RESET N1
The following restrictions apply to the creation of account statementsand open items lists:
No account statements can be created for one-time customers.
Even with head offices with local processing, payment notices areaddressed to the head office and not to the branch.
Correspondence types for account statements or open items lists withindividual text cannot be used for the periodic account statementscreated using program RFKORK00.

Output
An account statement or an open items 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, that is errors that donot lead 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 spool orders created 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 error list is displayed on the screen. If the program isplanned as a job, the spool request name of the error list is made upof the identifier F140, the printer destination, the date of creationand the program ID KORD. If the print program is started by ahigher-level correspondence program, the log entry is made by means ofthe higher-level program (for example, trigger for correspondence orperiodic account statements).

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

Example
Customizing for account statements or open items lists is explainedbelow using the standard system and examples of customer-specificextensions.

Customizing:
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 allowed,the 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, a noteexists further down 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 account statements or open item lists, the settings are to be madeas follows.
1.1. Examples of the correspondence types:
SAP06 Account statement without open items
X Account necessary
Number date specif... 2
Meaning date 1....... postings from
Meaning date 2....... postings until
SAP08 Open item list
X Account necessary
Number date specif... 1
Meaning date 1....... OI at key date
SAP15 Open item list (group)
X Account necessary
Number date specif... 1
Meaning date 1....... OI at key date
ZAP04 Account statement with open items and arrears
X Account necessary
Number date specif... 2
Meaning date 1....... postings from
Meaning date 2....... postings until
ZAP05 Open item list with arrears
X Account necessary
Number date specif... 1
Meaning date 1....... OI at key date
ZAP06 Account statement with individual text
X Account necessary
Individual text...... X
Number date specif... 2
Meaning date 1....... postings from
Meaning date 2....... postings until
ZAP07 OI list with arrears and individual text
X Account necessary
X Individual text
Number date specif... 1
Meaning date 1....... OI at key date
1.2. Examples of program assignment:
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 CorID Program Variant Default text
----------------------------------------------------
0001 SAP06 RFKORD10 SAP06
0001 SAP08 RFKORD10 SAP08
0001 SAP15 RFKORD10 SAP15
0001 ZAP04 RFKORD10 ZAP04
0001 ZAP05 RFKORD10 ZAP05
0001 ZAP06 RFKORD10 ZAP06 ZF140_ACC_STAT
0001 ZAP07 RFKORD10 ZAP07 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 assignment. A standard text mustcontain at least one comment line (format line = /*). Default texts canbe maintained in the detail screen of 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 definedfor the relevant form.
If, you enter a language for the correspondence request, into which thedefault text is not translated, you receive a blank text editor toenter the text.
Default text ZF140_ACC_STAT, TEXT-ID FIKO
Format Text area
/* Text for individual account statement
AF Accnt.statement from <(>&RF140-DATU1&<)> to <(>&RF140-DATU2&<)>
AF
AF
Default text ZF140_OPI_LIST, TEXT-ID FIKO
Format Text area
/* Text for individual open items list with arrears
AF Open item list for <(>&RF140-STIDA&<)>
AF
AF
If you want to enter individual text passages at several positions inthe form, you can create the default text analog to the followingexample:
Default text ZBEISPIEL, TEXT-ID FIKO
Format Text area
/* Example of several individual text passages
/: IF<(> &RF140-ELEMENT<)>& = 'XXX'.
/* Text in the text element XXX
AF Text 1
/: ENDIF.
/: IF<(> &RF140-ELEMENT<)>& = 'YYY'.
/* Text in the text element YYY
AF 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 individual text passages in, for example,the INFO window as well as in the MAIN window, you must complete alltext elements in your form for which individual text passages are to beissued according to the following example:
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. The names of these texts are made up of theidentification code F140, the user ID, the date of request and the timeof text creation. These texts can be changed with the maintenancetransaction for 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 RFKORD10 F140_ACC_STAT_01
0001 RFKORD10 IT ZF140_ACC_STAT_1
0001 RFKORD10 IV ZF140_ACC_STAT_2
0001 RFKORD10 VZ F140_ACC_STAT_02
0001 RFKORD10 VB F140_ACC_STAT_03
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".
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 use of individual texts or the direct useof a standard text in the following text elements:
Form Window Text elements
F140_ACC_STAT_01 MAIN 510, 511
F140_ACC_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_ACC_STAT_1
a.) Create the form ZF140_ACC_STAT_1 and copy
the form F140_ACC_STAT_01 into the form ZF140_ACC_STAT_1.
b.) Modify the text elements in the window MAIN as follows:
Format text area
/E 510
/* Accnt.stmnt. from <(>&RF140-DATU1&<)> to <(>&RF140-DATU2&<)>
/: INCLUDE<(> &RF140-TDNAME<)>& OBJECT BKORM ID FIKO LANGUAGE
<(>&RF140-TDSPRAS&<)>
/E 511
/* Open items 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 output in this language.
Example for including document long texts:
If you have entered texts for a document and want them to be printed inthe correspondence, proceed as follows:

  • Copy the standard form into an individual customer form.

  • Determine the window and, if necessary, the text element in which you
  • want to print the document text.
    • Determine which data is available when printing the window or text
    • element by using the program documentation (for example, tables BKPF,BSEG, BSID, BSIK, RF140 fields)
      • Define the text ID of the document long text which you want to print
      • (for example, 001) within the "Financial Accounting Global Settings"Implementation Guide in the "Define text IDs for documents" step.
        • Then insert two lines similar to the following lines at the required
        • position on the form.
          /: DEFINE &TEXTNAME& := '&BKPF-BUKRS(*)&&BKPF-BELNR(*RF0)&&BKPF-GJAHR&'
          /: INCLUDE &TEXTNAME& OBJECT BELEG ID 0001 LANGUAGE &RF140-SPRAS&
          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 RFKORD10 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. Pymt DocNo. Acct
          ------------------------------------------------------------------------
          0001 SAP06 Account statement w/o open items X X X X
          0001 SAP08 Open items list X X X X
          0001 SAP15 Open item list (group) X X X X
          0001 ZAP04 Accnt statement with OI and arrears X X X X
          0001 ZAP05 Open items list with arrears X X X X
          0001 ZAP06 Accnt statement with indiv. text X X X X
          0001 ZAP07 OI list w. arrears under indiv.text X X X X
          1.7. Sort Variants for Correspondence:
          There must be at least one sort variant defined for correspondence foraccount statements and open item lists. You use the correspondence sortvariants to determine the sequence in which the account statements orthe 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 contains a selection of fieldsfrom the master record tables KNA1, KNB1, LFA1 and LFB1. The fieldsKOART, KONTO, KTOGR (KNA1-KTOKD or LFA1-KTOKK), and KTOZE (KNB1-KNRZEor LFA1-LNRZE) are filled in accordance with the account type, which istaken from the master record tables. The fields "Document number" and"Fiscal year" are only filled in the case of document-relatedcorrespondence, such as payment notices.
          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, youmust take care to use the field names and data elements from thestandard tables, as the fields in table RF140VZZ are supplied using thenames from the master records. After you have added these fields, youmust activate 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 andKNB1, or LFA1 and LFB1 may be overwritten.
          1.8 Sort variants for line items:
          There must be at least one sort variant defined for line items. You canuse the sort variants for line items to determine the sequence in whichthe 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
          P6 Group open items
          1 KONTO Account 10
          2 BLDAT Document date 8
          3 XBLNR Reference 16
          4 BUZEI Item 3
          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 contains a range of fields from thedocument tables BKPF and BSEG. The field HBELN contains the referencenumber in case this is needed; otherwise it contains the documentnumber.
          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 validation and for thepossible entries help for the customer master record field "Accountstatement". It is also used for the parameter for indicators in themaster record of the program for periodic account statements.
          AccntStatement Text
          ---------------------------------------
          1 weekly account statement
          2 monthly account statement
          2.2. Examples of account statement program variants:
          Program RFKORD10
          SAP06 Correspondence sorting K1
          Open item sorting P1
          Statement also w/o items X
          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)
          SAP08 Correspondence sorting K1
          Line item sorting P1
          Open item list X
          Statement also w/o items X
          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)
          SAP15 Form set VB
          Correspondence sorting K1
          Open item sorting P6
          Open item list X
          Buying group X
          Statement also w/o items X
          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)
          ZAP04 Form set IT
          Correspondence sorting K1
          Line item sorting P1
          Break down bal.carr.fwd X
          Statement also w/o items X
          Key date for due days _______ Standard 1
          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)
          ZAP05 Form set VZ
          Correspondence sorting K1
          Line item sorting P1
          Open item list X
          Statement also w/o items X
          Key date for due days _______ Standard 1
          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)
          ZAP06 Form set IT
          Correspondence sorting K1
          Line item sorting P1
          Break down bal.carr.fwd X
          Statement also w/o items X
          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)
          ZAP07 Form set IV
          Correspondence sorting K1
          Line item sorting P1
          Open item list X
          Statement also w/o items X
          Key date for due days _______ Standard 1
          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)

957300SAP Best Practices Lean Baseline Package for TR
145200Correspondence: data from central address management
501622RFKORD10/11: Noted items are not displayed
366042Expiring currencies processes FI
362277Expiring currencies: correspondence