Ansicht
Dokumentation

BEN_00_AD_FORM_03 - Modify Templates

BEN_00_AD_FORM_03 - Modify Templates

ROGBILLS - Synchronize billing plans   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

In this step, you set up the office templates for benefits enrollment and confirmation forms.

You have copied the sample form templates in the previous step.

An interface between the application server and a word processor running on the front end enables you to generate forms using office applications. The interface consists of a set of macros within the form template and a set of tables used for transferring the data needed for generating forms.

The following macros are triggered by the application server:

Macro Description
InitDisplay() Initialization when form is displayed (print preview)
InitPrint() Initialization when form is printed
InitCustomize() Initialization when form is opened for customizing
InsertData() Generates the form
FinishedDisplay() Called after form is generated
FinishedPrint() Called after form is generated
FinishedCustomize() Called after form is generated
DeleteCurrentData() Removes the data inserted by InsertData() (only used for customizing)
EditMacro() Opens window to edit macros (only used for customizing)

All data required for form generation is collected on the application server and exported to the front end in the form of tables. Each exported table is characterized by a public name and a structure that is defined within the SAP System. These characteristics are listed below: Column A indicates the structure used for confirmation forms and column B indicates the structure used for enrollment forms.

Public Name   A B Description
Texts   TEXTPOOL   Language dep. texts
HeaderData   RPBENFORM_HEADER   Data needed for header
CreditPlan   RPBEN_D1 RPBEN_O1 Credit plans
HealthPlan   RPBEN_DA RPBEN_OA Health plans
InsurePlan   RPBEN_DB RPBEN_OB Insurance plans
SavingPlan   RPBEN_DC RPBEN_OC Savings plans
SpendaPlan   RPBEN_DD RPBEN_OD Flex. spending accounts
MiscelPlan   RPBEN_DE RPBEN_OE Miscellaneous plans
StockpPlan   RPBEN_DF RPBEN_OF Stock purchase plans
Dependents   RPBENDDP RPBENODP Benefit dependents
Beneficiaries   RPBENDBF RPBENOBF Benefit beneficiaries
Investments   RPBENDIV RPBENOIV Benefit investments

The number of forms that can be printed depends on the form generation mode. The following generation modes are possible:

  • Print
  • Display (print preview)
  • Customize (the activities in this IMG step)

While the modes "Display" and "Customize" generate one form only (for a particular personnel number), The "Print" mode can generate forms for a set of personnel numbers.

RPBENOIV
Application Server Front End
Open template Word processor opens template with startup macro InitPrint()
Loop at "set of selected personnel numbers"
-> Read data from database
-> Export tables to front end
-> Call macro InsertData() InsertData() reads tables, generates form and prints it
Endloop
Call macro FinishedPrint()
Close template

-> Call macro InsertData()
Application Server Front End
Read data from database
Export tables to front end
Open template Word processor opens template with startup macro InitDisplay() or Init- Customizing() which calls InsertData() InsertData() reads tables, generates form
Call macro FinishedDisplay() or
FinishedCustomizing()

In all of these modes, the macro InsertData() generates a form. In the "Customize" mode, it also prints them. The macro therefore reads the data from the exported tables and inserts it into the template.

You can access the tables via an object model using the public name of the table, for example:

set table = ThisDocument.Container.Tables("HealthPlan").table

The sample templates use two different techniques to insert data into the two parts of the form:

  • The header part contains the address window and the personnel header data.
This part has a fixed layout and uses fields for inserting the data.
  • The plan part contains the current or offered benefit plans.
This part has to be generated dynamically by macros.

In order to adapt the header part and the page header and footer to your own needs you can easily modify the template by moving the fields, formatting the text, inserting text and pictures, and so on.

All sections and parts of the plan list (for example, plan type, amounts, and so on) are based on styles. These styles start with SAP_A for paragraph styles and SAP_Z for character styles.

You can change the plan part as follows:

  • If you only want to change the visual appearance of the plan list, for example the fonts, font sizes, or indentations, you simply need to change these styles accordingly.
  • If you want to change the structure or the order of the plan list, you need to adjust the macros.
Open template

In order to keep the sample templates language independent, all language-dependent texts are read from the exported table 'Texts', which contains all text elements starting with a 'F' from the function group HRBEN00FORMS. Consequently, the sample templates do not contain any language-dependent strings. Note that if you add any coded text to the template or the macros, the template becomes language-dependent, in which case you need to set up a translated copy of the template for each language required. You can do this by creating language variants in the Business Document Navigator (for more information, see the previous IMG step).

Open template

In order to avoid a virus warning each time a document is opened, you should deactivate the macro virus protection in Microsoft Word® (Tools → Options → General). You need to do this for each frontend (Microsoft Word® installation).

Note that the sample templates are always printed to the default printer installed on the front end, and that each form creates its own print job. Therefore, if you are printing a large set of forms, SAP recommends that you disable visual notification of successfully processed print jobs to prevent repeat messages.

Due to a bug in Microsoft Word®, a template becomes corrupted if you insert a document variable into the header or footer of a page. One possible workaround is to use CustomDocumentProperties as in the sample templates.

Open template
  1. Specify the form template and form type that you want to modify on the selection screen.
  2. Enter a test personnel number and a key date, if desired.
If you make these entries, the system uses the corresponding personnel data and plan data to generate a test form so that you can immediately check your changes.
  1. Choose Execute.
The text processor appears within the SAP screen. If you provided test data in step 2, the form is automatically generated. Otherwise the template is retrieved from the database.
  1. Modify the template.
  2. If you provided test data in step 2, you can check your changes by choosing Refresh to regenerate the form.
  3. Before you save the template, choose Reset form. This removes the test data from the form.
  4. Save the template.
Open template






BAL_S_LOG - Application Log: Log header data   General Material Data  
This documentation is copyright by SAP AG.

Length: 11969 Date: 20240524 Time: 011950     sap01-206 ( 158 ms )