SAP Program RFKORD50 - Print Program: Document Extract

Description
The program prints letters in which selected customer items and/orvendor items of a document are listed. The selection is carried out viathe selection options for posting keys and special G/L indicators. Inthe standard system, the print program is used for the output of creditmemo displays to customers.
The print program is generally only carried out directly during theconfiguration for testing purposes. Otherwise, the call is carried outautomatically by higher-level correspondence programs.

Precondition
Before being able to print document extracts within the correspondence,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_DOCU_EXC_01 is used in the standard system.
RESET N1
The following restrictions apply to the creation of document extracts:
Intercompany transactions are not supported.
Even with head offices with local processing, document extracts arealso addressed to the head office and not to the branch.
With document extracts to one-time customers, only businesstransactions for one customer may be posted in a document.
For clearings between customers and vendors, a document extract iscreated for each pair of customers/vendors in case of a correspondingindicator in the master records and is addressed to the customer.

Output
For each customer, vendor or pair of customers/vendors of a document, adocument extract is created. A separate spool request is created foreach company code. For test purposes, an output can be carried out onthe screen. If you do not specify for the print program on whichprinter the correspondence should be printed, the program may take theprinter specified in the user master of the user who started theprogram or the printer specified 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 a job,the job request name for the error list is composed of the identifierF140ER, the printer name and maybe the correspondence type and/or thecompany code.
If the print program is carried out directly, a log with the createdspool requests 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 the form layout
Information on text symbols
INCLUDE FI_RFFO_SAPSCRIPT_MAINTAIN OBJECT DOKU ID TX

Example
Customizing for document extracts is explained in the following bymeans of the standard system and an example of customer-specificextensions.

Customizing:
Make the settings for correspondence in the "Financial accountingglobal settings" Implementation Guide. Make the settings for thedocument extract under the "Outgoing credit memo 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 entrieswith 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 starting with Zare examples of customer-specific objects which are not delivered withthe standard system.

1. "Financial Accounting global settings": Correspondence settings:
For document extracts, the settings are to be maintained as follows.
1.1. Examples of the correspondence types:
SAP11 Customer credit memo
X Document necessary
ZAP10 Customer credit memo with individual text
X Document necessary
X Individual text
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 SAP11 RFKORD50 SAP11
0001 ZAP10 RFKORD50 ZAP10 ZF140_DOCU_EXC
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. You can copystandard texts from other clients using the transaction SO10 (Menu ->Utilities -> Copy from client).
Everybody 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 needs at least the authorization for the text ID STand FIKO.
In the standard text, you may only use the paragraph formats definedfor 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 ZF140_DOCU_EXC, TEXT-ID FIKO
Format Text area
/* Text for individual customer credit memo
AF
If you want to enter individual text passages at several positions inthe form, you can create the default text analogous 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
However, this option 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&<)>
From the 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.
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 RFKORD50 F140_DOCU_EXC_01
0001 RFKORD50 IT ZF140_DOCU_EXC_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 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 "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 document extracts, preparations have been madein the following text elements for the usage of individual texts or thedirect usage of a standard text:
Form Window Text elements
F140_DOCU_EXC_01 MAIN 510, 511, 512, 513, 514
However, you can principally use the individual texts at every positionof a form.
Examples of form modifications:
Form ZF140_DOCU_EXC_1
a.) Create the form ZF140_DOCU_EXC_1 and copy
the form F140_DOCU_EXC_01 into the form ZF140_DOCU_EXC_1.
b.) Modify text elements 510, 511, 512, 512,
and 514 in the window MAIN analogous to the following example:
Format Text area
/E 510
/* Credit memo
/*
/*
/* <(>&<)>SGDH<(>&<)>,
/*
/* we have credited the amount listed below to your account.
Please clear this amount with your next payment.
/: INCLUDE<(> &RF140-TDNAME<)>& OBJECT BKORM ID FIKO LANGUAGE
<(>&RF140-TDSPRAS&<)>
During output, the variable RF140-TDNAME contains the name of theindividual text belonging to a correspondence request respectively. Thevariable RF140-TDSPRAS contains the entry language or the outputlanguage of the text. The entire letter is output in this language.
Additional date specifications are supplied in the variablesRF140-DATU1 and RF140-DATU2 for printing out the form for eachcorrespondence request. You can integrate these variables into a formwhich you want to create at the place required.
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 specifications:
          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 RFKORD50 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 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 correspondence DocEnt. Pymt DocNo. Acct
          ------------------------------------------------------------------------
          0001 SAP11 Customer credit memo X X X
          0001 ZAP10 Cust. credit memo w. indiv. text X X X
          1.7. Sort Variants for Correspondence:
          You must define at least one sort variant for the correspondence fordocument extracts. You determine the order in which the documentextracts are issued using the sort variants for correspondence.
          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.
          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:
          You can define sort variants for the line items. You can use the sortvariants for line items to determine the sequence in which the lineitems 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
          Objects are always sorted initially by company code and thereafter inthe sequence of the fields in the sort variant being used.
          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. Document extracts:
          You define the variants under the "Outgoing credit memo correspondence"option in the "Accounts Receivable and Accounts Payable" ImplementationGuide. Examples of program variants:
          Program RFKORD50
          SAP11 Posting key 11
          Sorting of correspondence 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)
          ZAP10 Posting key 11
          Form set IT
          Sorting of correspondence 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
480275RFKORD50: Input tax deduction net display
521157RFKORD50: Tax number for article 14
366042Expiring currencies processes FI
362277Expiring currencies: correspondence