Ansicht
Dokumentation
TEXT_INTERFACE_ADDON - Correspondence: Create Document (Loans)
Fill RESBD Structure from EBP Component Structure BAL Application Log DocumentationThis documentation is copyright by SAP AG.
The correspondence interface allows you to create correspondence, configured to suit your individual requirements from within a transaction or a report. The data supplied by the application is combined with SAPSCRIPT text modules and composed in a text in accordance with the parameters entered.
To use the interface you need to have completed the following:
- Integrate the function module TEXT_INTERFACE
- Define entries in table TTXBF: Creation of a data record for each form letter
- Define entries in table TTXBS: Creation of a data record for each text module for output
- Edit text modules
- Create a new report or modify an existing report that controls the output of text modules
- Create a new subprogram or modified an existing subprogram for the special output of individual text modules
- Create an output form
You can find prototypes of main reports, subprograms and output forms in the system. You can use these in all cases where there is no deviation from the existing standard system.
is integrated in the calling transaction / report as follows:
- Change field values in field structure ITCPO (print options) if they differ from the standard settings.
,,ITCPO-TDDATASET = 'TEST'.
,,ITCPO-TDNEWID = 'X'.
,,ITCPO-TDPREVIEW = 'X'.
- Export all data structures and tables that are to be combined with the text modules to the global memory.
,,,,EXPORT IBEPP TO MEMORY ID 'BEPP'.
,,,,EXPORT IVDSCRIPT TO MEMORY ID 'SCRI'.
- Call function module TEXT_INTERFACE
,,CALL FUNCTION 'TEXT_INTERFACE'
,,,,EXPORTING
,,,,,,PARTNR = SPAB1-PARTNR
,,,,,,ADRTYP = SPAB1-ADRTYP
,,,,,,RANTYP = '1'
,,,,,,BRFNM = TTXBF-BRFNM
,,,,,,DRUPARM = ITCPO
,,,,,,SUBANWDG = TTXBF-SUBANWDG
,,,,,,DIALOG = 'X'
,,,,IMPORTING
,,,,,,ERGEBNIS = ITCPP
,,,,EXCEPTIONS
,,,,,,ADRESS = 01
,,,,,,CANCELED = 02
,,,,,,FORM = 04
- RANTYP
- Contract type in the calling application. The parameter is used as the first key segment for the selection of form letters from table TTXBF. This parameter is mandatory.
- SUBANWDG
- Sub-application. The parameter is used as the second key segment for the selection of form letters from table TTXBF. The sub-application groups together all of the letters that are to be supplied from the same data pool. For this reason it makes sense to enter the sub-application although this is not absolutely necessary. If you do not enter this paramter, the system displays a selection screen containing all the letters available for the contract type, meaning that it is possible to select a letter from a completely unrelated area to the transaction where you are triggering the correspondence.
- BRFNM
- Name of the form letter to be created. If you do not enter a value for this parameter, a selection screen is displayed containing all letter names from the file TTXBF that correspond to the specified contract type and sub-application. This selection screen is called by function module POPUP_TTXBF. If the letter name or the sub-application and letter name are not known when the TEXT_INTERFACE function module is called, the function module POPUP_TTXBF can be called before the TEXT_INTERFACE function module.
- DRUPARM
- Print parameter. Enter a field string with the structure ITCPO here to control the spool and printer control.
- PARTNR
- Partner number
- ADRTYP
- Address type. The parameters PARTNR and ADRTYP can be taken from the output report for determining the recipient address. This is the case in program RFVDAZB2, for example. There the address data determined is entered in the structure ADRS.
- DIALOG
- Dialog box for user print options. If this parameter is displayed with an X, the user can change the print options in the spool control screen.
- ERGEBNIS
- Print result. You receive information in the structure ITCPP about the print job just executed.
- ADRESS
- Partner address not found
- CANCELED
- Activity cancelled by the user
- ELEMENT
- A text module could not be found
- FORM
- The output form is not activated.
contains a descriptive data record for each form letter. It is structured as follows:
Name Key Cat. Length/Dez Meaning
------------------------------------------------------------------
TTXBF-MANDT
X CLNT C 3 Client
TTXBF-RANTYP X CHAR C 1 Contract type
TTXBF-SUBANWDG X CHAR C 4 Sub-application
TTXBF-REPID CHAR C 8 Abap program name
TTXBF-XBRFBS CHAR C 50 Text for letter description
TTXBF-TDFORM CHAR C 16 Form name
TTXBF-JSPFB CHAR C 1 Spooler control screen ?
TTXBF-JBSTAUSW CHAR C 1 Selection of text modules
TTXBF-KTXELEMENT CHAR C 30 Header text module
TTXBF-TDFIRSTPAG CHAR C 8 Form start page
Description of data records:
- RANTYP
- Contract (1 = loan, 2 = securities, 3 = real estate)
- SUBANWDG
- Sub-application. Letters from the same sub-application are supplied by the same datapool.
- BRFNM
- Letter name. Each form letter is clearly identified by a key comprising the RANTYP, SUBANWDG and BRFNM.
- REPID
- Name of the ABAP report that controls the text output. Report RFVDAZB2 is available as a prototype with a broad application spectrum.
- Short text of 50 characters which describes the content of the letter.
- TDFORM
- Name of the SAPSCRIPT form used for the formatting of the text output. JSPFPB,,Spool control screen yes / no? For letters that are output from the online application, this field can be set to 1 = Yes. For batch letters is must be set to 0 = No. In this case, the print parameters can be transferred to the function module TEXT_INTERFACE by way of the structure ITCPO.
- JBSTAUW
- Element selection yes / no ? This field must be set to YES if a user wants to select the text modules to be output before letter selection. This is only relevant for the online application.
- KTXELEMENT
- Name of the text module from the HEADER window in the form specified. This text module is output in the header section of each page.
- TDFIRSTPAG
- Name of the form page where the form output is to be started.
You can maintain table TTXBF using view VTDTTXBF. Once you have started the view maintenance a dialog box appears, in which you need to enter a contract type. The overview screen appears. Here, you can create, change, copy and delete records. In the first three of these functions you can branch to a details screen. Here, you can define entries for the fields from table TTXBF described above, with one exception. The inclusion of the parameter DIALOG for the function module TEXT_INTERFACE means that the field JSPFB is no longer required and so has been removed from the screen.
contains one record for each text module within a letter. It is subordinate to table TTXBF. It is structured as follows:
Name Key Typ Length/Dez Meaning
-------------------------------------------------------------------
TTXBS-MANDT
X CLNT C 3 Client
TTXBS-RANTYP X CHAR C 1 Contract type
TTXBS-SUBANWDG X CHAR C 4 Sub-application
TTXBS-BRFNM X CHAR C 15 Letter name
TTXBS-BSTLF X NUMC N 3 Sequence number module
TTXBS-XOBJECT CHAR C 10 Text: Application object
TTXBS-XBSTNM CHAR C 70 Text name
TTXBS-XSPRAS LANG C 1 Language key
TTXBS-REPID CHAR C 8 Abap program name
TTXBS-AUSWAHL CHAR C 1 Selection indicator
TTXBS-BST_OBL CHAR C 1 Text module is mandatory
TTXBS-KOPF_BER CHAR C 1 Output of TM in window header
TTXBS-NEUE_SEITE CHAR C 1 Page break yes/no?
Description of data records:
- RANTYP
- see TTXBF
- SUBANWDG
- see TTXBF
- BRFNM
- see TTXBF
- BSTLF
- Sequence number of the text module within the letter. It is recommended that you number the modules sequentially with intervals of five or ten, so that it is possible to insert additional modules if necessary.
- XOBJECT
- Text object. Each text module is uniquely identified fourfold by a key made up of text object, text name, text ID and language key. The text object is used for general classification and the text name forfield differentiation. The ID can be used to form variants, although this is has not been done in this case.
- XBSTNM
- Text module name
- XSPRAS
- Language key
- REPID
- Name of an ABAP program that is always called if the respective text module is waiting to be output. The program replaces the processing logic from the main report. The main application area for this procedure is the output of tables within a letter. In this case a certain text module must be output repeatedly for every row in an internal table. Prototype: RFVDBEPP.
- AUSWAHL
- Is the module output as a rule yes / no? In batch letters this field should be set to YES in every case because there is no selection screen for the text module.
- BST_OBL
- Is the module mandatory for a letter yes / no? If the field is set to YES, the module cannot be selected in the selection screen.
- KOPF_BER
- Output of the module in the header section of the MAIN window. The output is repeated on all subsequent pages until the next page break is forced.
- NEUE_SEITE
- If this indicator is set, a page break is forced before the text module is output.
You can maintain table TTXBS using view VTDTTXBS. After the view maintenance has been started, a dialog box appears in which you need to enter the contract type, the sub application and the letter name. The overview screen appears.
Here you can create, change, copy and delete records. In the first three of these functions you can branch to a details screen.
In this screen you can define values for all of the fields in table TTXBS described above.
Creation and processing of text modules
In the details screen for view maintenance VTDTTXBS you will find the EDITOR button. You choose this button to branch to the SAPSCRIPT editor where you can edit the module listed in the relevant row in table TTXBS.
Note that the text object and the text ID also need to have been created in the tables TTXOB/TTXOT and TTXID/TTXIT.
Provided the composition of a letter corresponds to the system standard, you can keep the code for the output report to a minimum.
,,REPORT RFVDAZB2.
,,TABLES: VDSCRIPT.
,,IMPORT IVDSCRIPT TO VDSCRIPT FROM MEMORY ID 'SCRI'.
,,PERFORM BAUSTEINVERARBEITUNG(RFVDTX01).
In this example, table VDSCRIPT is integrated first. Then the data stored in the global memory before the function module TEXT_INTERFACE was called is re-imported. A form routine is called that triggers the print output of the text modules belonging to the form letter.
This form routine, which can be replaced with other routines for special requirements, runs as follows:
- IMPORT of parameters for letter description, print options and partner address from the global memory
- Read tables TTXBF and TTXBS on the basis of the imported parameters
- Call a function for the generation of a selection screen for text modules
- Determination of partner address
- Open form output, first without specifying a certain form
- Start the print form specified in TTXBF
- LOOP through the table for the text modules belonging to the letter (from TTXBS); the relevant text module for each table row is read and output, unless a subprogram has been specified. In this case the form routine TEXTAUSGABE for the subprogram is called.
- End the print form
- Close the form output
- Export of result data in the global memory.
In order to output some text modules you need to integrate a separate processing logic. As shown in the following example, this is the case if you are using LOOP modules, in other words, modules that needto be output for each data record in an internal table.
This is the case for the text module SBR (Text object FVVD_AUSZ) used in the letter 1/AUSZ/AZB-01. This module is to be output once for every record from the internal table IBEPP. Therefore you need to branch to a form routine, in this case to the routine TEXTAUSGABE for the subprogram RFVDBEPP. The parameters for this routine are set in Table TTXBS (field REPORTNAME).
The form routine runs as flows:
- Data declaration
- IMPORT of internal table IBEPP from the global memory. (Imported to the location from which they were exported by the transaction that called the text interface).
- LOOP through table IBEPP, in each run IBEPP is copied from VDBEPP and the text module next in line in the main report RFVDAZB2 is output.
- In the last data record: Determination of total value from SBWHR and EXPORT in the global memory.
Each print output in SAP Script requires the opening of an output form. The form is used to control the layout.
The following connections need to be noted:
- The form window called in the output report by the function module WRITE_FORM or WRITE_FORM_LINES must be created in the form, in addition to the text modules contained in the windows. The forms created previously contain the text module INCLUDE in the main window. This allows you to include any text modules, controlled by the parameters. In the existing Standard solution the name ADRESS has been assigned to the address window. If this window is created in the form and values are created with variables from the ADRS structure the partner address can be output here.
- The paragraph and line formats for the text modules need to have been created.
The FVVD_STANDARD form is recommended for standard correspondence. The parameters for this routine are set in Table TTXBF (field FORMULAR).
Parameters
ADRTYPBRFNM
BRIEFDATUM
BUKRS
DIALOG
DRUPARM
ERGEBNIS
FPROTOKOLL
PARTNR
P_USER_EXIT
RANTYP
STICHTAG
SUBANWDG
Exceptions
ADRESSCANCELED
ELEMENT
FORM
OPTIONS
Function Group
FVDD_ADDONPERFORM Short Reference Fill RESBD Structure from EBP Component Structure
This documentation is copyright by SAP AG.
Length: 20048 Date: 20240523 Time: 073755 sap01-206 ( 247 ms )