Programme SAP RFKORD40 - Print Program: Individual Letters and Standard Letters

Description
The program prints individual letters and standard letters forcustomers and vendors.
For individual letters, you can enter a user-defined text during thedialog. For standard letters, a text is stored in the form or in astandard text, that can only be extended by certain variables butcannot be changed interactively.
The print program is generally only carried out directly during theconfiguration for testing purposes. Otherwise, the call isautomatically carried out by higher-level correspondence programs.

Precondition
Before you can print individual letters and standard letters 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 you can copyand correspondingly adapt to your requirements.
The form F140_IND_TEXT_01 is used in the standard system.
The creation of individual letters and standard letters is not possiblefor one-time customers.

Output
An individual letter or standard letter is output for each customer orvendor. A separate spool request is created for each company code. Anoutput can be made on the screen for test purposes. If you do notspecify 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, a log with the createdspool request is output for each program run if a print request wascarried out. If you do not specify for the print program on whichprinter the log should be printed, the program may take the printerspecified in the user master of the user who started the program or theprinter specified when the job is scheduled. If the program is carriedout online, the log is output 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 carried out by thehigher-level program (trigger for correspondence).

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

Example
Customizing for individual letters and standard letters is explained inthe following by means of the standard system and an example ofcustomer-specific extensions.

Customizing:
Make the settings for correspondence in the "Financial accountingglobal settings" Implementation Guide. Make the settings for theindividual letter and standard letter under the "Correspondence" optionin the "Accounts Receivable and Accounts Payable" Implementation Guide.There you maintain the suboptions in accordance with the followingguidelines.
Note:
With tables, in which a default entry without company code is allowed,the default entry is accessed if no entries for the special companycode exist. If you do not want this, you should only make table entriesfor which the company code is predefined. With the relevant tables,there is a note on the default entry company code blank below.
The correspondence types, the forms and standard texts which start withZ are examples of customer-specific objects which are not delivered inthe standard system.

1. "Financial Accounting global settings": Correspondence settings:
For individual letters and standard letters, the settings are to bemaintained as follows.
1.1. Examples of the types:
SAP10 Individual correspondence
X Account necessary
X Individual text
ZAP09 Standard letter
X Account necessary
1.2. Examples of program allocation:
The entries are to be left blank either explicitly for individual orall company codes or as a default for company code.
CCode CorID Program Variant Default text
----------------------------------------------------
0001 SAP10 RFKORD40 SAP10 F140_IND_TEXT
0001 ZAP09 RFKORD40 ZAP09
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, a standard text must alwaysexist and be entered during program allocation. 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. If thestandard text F140_IND_TEXT does not exist, you can copy it from client000 using the transaction SO10 (Menu -> Utilities -> Copy from client).
Everbody who wants to use the text ID FIKO needs the authorization todo so. The authorization object, for which the authorization must bedefined, is called "standard text". In the standard system, it isincluded in the profile S_SACHBEARB and authorizes for every text ID.However, everybody at least needs the authorization for the text ID STand FIKO.
In the standard text, you may only use the paragraph formats which aredefined for the corresponding 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 F140_IND_TEXT, TEXT-ID FIKO
Format Text area
/* Text for individual correspondence
AF <(>&SGDH&,<)>
AF
AF
AF
AF <(>&MFG&<)>
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 ZEXAMPLE, 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 cannot be applied, however, 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&<)>
From default texts, individual texts whose names are made up of theidentification code F140, the user ID, the request date and the time ofday of word processing are then created for each correspondencerequest. You can change these texts with the maintenance transactionfor correspondence requests.
For a standard letter (correspondence type ZAP09), whose text containsno variables except the address data of the customer or the vendor andwhich should not be changed individually, you can store the textdirectly in the form or in a standard text (text ID FIKO or ST) whichis directly included into the form.
1.4. Examples of forms:
The entries are to be left blank either explicitly for individual orall company codes or as a default for company code.
CCode Program Fo Form
--------------------------------------
0001 RFKORD40 F140_IND_TEXT_01
0001 RFKORD40 ST ZF140_IND_TEXT_1
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 using 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 "Y" or "Z". The form name should contain the identificationcode "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 you created in languages forwhich no translation exists, you can translate the forms using thetransaction SE63.
In the standard form for individual letters and standard letters, theusage of individual texts or the direct usage of a standard text isprovided in the following text element:
Form Window Text elements
F140_IND_TEXT_01 MAIN 510
Examples of form modifications:
Form ZF140_IND_TEXT_1
a.) Create a standard text ZF140_STAN_LET, TEXT-ID FIKO.
In this standard text, you enter the text of the standardletter.
b.) Create the form ZF140_IND_TEXT_1 and copy the form
F140_IND_TEXT_01 into the form ZF140_IND_TEXT_1.
c.) Modify the text element 510 as follows in the window MAIN:
Format Text area
/E 510
/* INCLUDE <(>&RF140-TDNAME&<)> OBJECT BKORM ID FIKO LANGUAGE
<(>&RF140-TDSPRAS&<)>
/: INCLUDE ZF140_STAN_LET OBJECT TEXT ID FIKO LANGUAGE
<(>&RF140-SPRAS&<)>
The variable RF140-SPRAS contains the output language of the letter,for example, the language of the customer to whom the letter isaddressed.
The standard texts you use must be translated into the required outputlanguages.
1.5. Sender details:
The entries are to be left blank either explicitly for individual orall company codes or as a default for company code.
CCode Program TXTID Header text Footer Text signature
Sender
-----------------------------------------------------------------------
0001 RFKORD40 ADRS_HEADER ADRS_FOOTER ADRS_SIGNATURE
ADRS_SENDER
Using 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 using the transaction SO10 (Menu -> Utilities -> Copy from client).
If you do not need individual specifications, such as header text andfooter text due to printed company paper, you can leave the respectivefields in the table blank. However, at least the standard text for thesignature is generally needed. However, you should enter a defaultentry (company code = blank and name of the print program) in the tableto avoid error messages if you do not want to use texts.
1.6. Call options:
The entries are to be left blank either explicitly for individual orall company codes or as a default for company code.
CCode Type of the correspondence DocEnt Pmt DocNo. Acct
------------------------------------------------------------------------
0001 SAP10 Individual correspondence X X X X
0001 ZAP09 Standard letter X X X X
1.7. Examples of sort variants:
You must store at least one sort variant for the correspondence forindividual letters and standard letters. You determine the order inwhich the letters are issued using the sort variants forcorrespondence.
Sort variant Name
Order Field name Name Offset length
K1 Sorting by postal code
1 LAND1 Country 3
2 HPSTL P.O.box post.code otherwise post.code 10
3 KOART Account type 1
4 KONTO Account 10
K2 Sorting by account number
1 KOART Account type 1
2 KONTO Account 10
K3 Sorting 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 data.
For this reason, fields that have the same name in tables KNA1 and KNB1or LFA1 and LFB1 may be overwritten.
2. Individual letters:
You define the variants in the "Accounts Receivable and AccountsPayable" Implementation Guide under the "Correspondence" option.Examples of program variants:
Program RFKORD40
SAP10 Correspondence sorting K1
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)
ZAP09 Form set ST
Correspondence sorting K1
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
362277Expiring currencies: correspondence