WWI Report Template Guide
Basics of WWI Report Template
WWI reports enables to output data from the specification database and other SAP components, and graphic symbols on reports. You can use phrase management to store multilingual text, graphics on the report as language-independent. SAP EH&S use a modified version of Microsoft Word (Windows Word processor Integration (WWI)) to create the layout of the reports.
Transaction: CG42 – Edit Report Template
One can search the required template by name or wild card (*) search to get the required template.
Status of the Reports
Template can be in different statuses based on the if the template has been correctly edited or not. The possible status are:
ER – Errors When report template has error in WWI console – one would first need to check the errors in the console and correct them to move to In-Work Status.
IW – In work When the template is checked and ready to be released.
RE – Released When the Report template changes are complete and checked and ready to be used in a generation.
IP – In process on WS When a user is editing the template at the front-end.
Unknown When Error occurs in the system, MS word crashes or any server error occurs while saving the file, the status of the report template is in Error.
Some of the Possible Messages:
- Report should not be in released status if you want to make changes to the same- in order to make any changes in the report template, the user should first Cancel release of the report. : Document CHAPTER_XXXXX with version has a status that prevents changes
Use Cancel Release button
- One might also get the message – the Report Template is being used in a generation variant – proceed with the Cancel Release.
- If you get the message- ‘report template is being edited at the front end’ then you would have to Utilities – Reset front End before proceeding with making the changes to the template.
Main Screen of the report editor
WWI allows to create language-independent document templates using symbols. Various tools make it easier for the user to create templates with the correct syntax:
Symbol tree can been seen on the left hand corner of the screen. The parallel display of the symbol tree, the document template in Microsoft Word, and the tab pages for editing the various symbol and control object types on one screen with different windows gives the user a better overview when working.
The symbol tree lists all available specification, parameter, and descriptor symbols. The specification symbols are based on the property tree, which the user can change during editing.
- With (Find in Symbol Tree), you navigate to the required symbol in the symbol tree.
- With (Find Object in Template), the system searches for the object selected in the symbol tree from the cursor position in the document template. When you select a symbol in the symbol tree, it is entered in the appropriate tab page.
- With (Edit Object from Template), you transfer a WWI object from the document template to the tab page. With (Edit WWI Object in Template), you replace the object selected in the template with the object in the active tab page. The object type must match for this.
- The (WWI Wizard) helps you create headings, tables, and lists.
- Repeating groups are used to assign a characteristic to the value assignment type and for precise data output with multiple value assignments.
- (Character Sizing) ensures that text is adjusted optimally to the size of the text box.
- Using blank compression and conditional output, you can define the output of data depending on whether other data exists.
- With (Extract), you can increase the size of the display of small areas on labels or in text boxes to edit them zoomed.
- With (Include Template), you can include another document template in your document template.
- (Check Template) lists all errors and warnings. You can automatically select the symbol that needs correcting by double-clicking the message.
- (Preview) allows you to preview the finished report.
- (WWI Settings) allow you to make default settings for the preview, the Wizard, and the colours for the symbol types.
Sections of the WWI report template editor:
A placeholder in a document template by means of which data can be printed on reports.
The data originates from the following SAP components:
- Specification management (specification symbols) – Placeholder for Graphic, phrase, or code of a phrase-enabled characteristic (symbol group Phrase ) Non-phrase-enabled characteristic or table field (symbol group Symbol ). Table field of the Recipe Management component (symbol group Formula or Scope of Application )
- Descriptor symbols – Placeholder for phrase texts and phrase-related fields (phrase codes, graphics, and so on).
- Other SAP components (Parameter symbols) – Placeholder for values from table fields of other SAP components like Materials Management and Sales & Distribution. Components related to Global Label Management (GLM)
You can specify which Symbols (properties/Characteristics ) must exist on a report for it to be considered complete from a business point of view. You have the following options for setting up such mandatory report symbols:
- In Customizing for Basic Data and Tools: You can define a symbol as a general mandatory symbol by assigning the symbol a message type in the Message field in the IMG activity Check and Specify Report Symbols . If no value exists for the symbol during generation, an appropriate message appears on the report and in the report log.
- When editing a symbol with the Windows Word processor Integration program, you can enter a message type. Sym. field on the Symbol tab page. When the report is generated, the system then checks whether the value exists for the symbol at the relevant position. If the value does not exist, a message informing of this appears on the report.
Symbols contain key information that the SAP system uses to access the specification database or other SAP tables automatically and to output the corresponding values on the report.
The various aspects of the WWI Editor as follows:
1.Report Template Symbol Tree – Shows the property tree structure with different properties that can be added in the report template and the Symbols corresponding to the property.
The below screenshot shows the different Symbols which are part of the Property ‘OECD and company information Syngenta’ and can be used to be added in the report template:
The Symbol Tab shows the details of how the symbol would be added in the report template.
- Mult. Value Asst – shows if the report should display all the value assignments of the report
- Separator for Mult. Val. – shows the separator between multiple value
- Message for Mandat. Sym. – if the Symbol is mandatory and if the system should issue an warning.
- GPC – indicates how the symbol would be expanded
- IT – Indicates which ID LISTING you want to use or which identifier the user wants to be displayed on the report
- NM – Lets the user select a Function Module (FM or Method) for certain symbols
2. Descriptor Symbols are used to add phrases to the report template such as any disclaimers, header/footer phrases.
One would have to select the appropriate Descriptor Symbol to display the phrase text, code, key, Graphic, etc. The editor would also need to select the appropriate- Phrase Library, Phrase group and the phrase text that he wants to display in the report.
Repeating groups show the value assignment type of a property under which all the related symbols can be entered. The repeating group can be a of different categories as in the screenshot below.
All the Symbols for the particular property tree need to be looped in the same repeating Group. Similarly, components, User defined Text, Sources and Assessments are used as slave repeating group in the master repeating group.
Data Output Restriction
One can use the following identification codes to define a data output restriction if not all of the symbol’s data records:
Identification Code in Symbol
The system selects the data record with the number n.
This wildcard selects all data records it finds.
The system selects the data records from number n to number m.
The system selects all data records starting from number n.
Blank Compression –
Used for suppressing a particular symbol or section based on its availability or no. User can change all symbols displayed as a condition in the Blank Compression dialog box in the control symbols area by positioning the cursor on the symbol required and choosing Modify or Delete.
In the blank compression dialog box in the operator area, specify whether the conditions entered are to be linked with
AND ( * ) or OR ( + ).
Word enters blank compression in your template according to the conditions defined. All entries between the beginning and end of the control section are not output. WWI reacts as follows:
“+” = OR: If no value is found for at least one control symbol, blank compression is activated. No text is output.
“-” = AND: If no value is found for all control symbols, blank compression is activated. No text is output.
“With Alternative” Blank Compression – In the dialog box for blank compression, you can specify that an alternative statement is output in your report template. The alternative statement is inserted as an additional control symbol (for example, <13CNG000> ) by the Windows Wordprocessor Integration (WWI) program.
Conditional Output – Is used in order to display or not display certain sections, symbols based on certain condition checks.
The conditional output around the section that is to be output if the condition is fulfilled. The section can contain any type of object, such as Microsoft Word texts, graphics, symbols, and phrases. User can define a number of conditions that must be fulfilled before a section is output.
User can define an alternative for the output, that is an alternative section that is output if the condition is not fulfilled. The condition consists of the following parts:
- Symbol whose content must fulfil the condition
- Comparison operator, such as Equal To (EQ), Greater Than (GT), or Text Comparison (LK)
- Comparison value, that is a value or string against which the system checks
User can also enter a symbol as a comparison value. The system then compares the content of this symbol with the content of the symbol that must fulfil the condition.
To define a conditional output in a document template, proceed as follows:
- In the template, select the data around which you want to define the conditional output, that is the texts, graphics, symbols, and phrases that should be output only if the condition is fulfilled. If the template does not yet contain this data, insert it and then select it.
- Choose the Condit. Output tab page.
- In the symbol tree, select the symbol that must fulfil the condition and on the Condit. Output tab page, choose with the quick info text Insert Symbol from Tree below the table. The system inserts a table row for the condition and enters the symbol for the chosen condition in this row.
- If you still want to edit the symbol, for example, if you want to change the specified identification type or identification category in a condition for identifiers, choose with the quick info text Edit Symbol from Table , enter the required data for the symbol, and confirm your entries.
- Define the required conditions in the table, and if you have more than one condition, specify whether these are to be logically linked with AND or OR. Note the following when entering the comparison value:
- If the comparison value is a number, enter it without any other characters.
- If the comparison value is a text for a text comparison (operator LK), enter the text in double quotation marks.
- If the comparison value is a symbol, enter the string S: in front of the symbol.
- If you want to define an alternative, set the With Alternative indicator.
- Choose with the quick info text Insert WWI Object in Template above the tab pages. The system inserts the symbols for the conditional output around the selected section. If you set the With Alternative indicator, an additional line is inserted in the template for the alternative, introduced by the hidden characters <15CIF .
- If you set the With Alternative indicator, place the cursor at the end of the line for the alternative and define the data that the system should output if the condition is not fulfilled.
- Check and save the template.
Message – display all the error or warning messages generated by the WWI report generator.
There can be warning and Error Messages which would be displayed in this tab. Warnings are mostly syntax based and could be ignored.
To check the document template created, the system creates a structure file in ASCII format that contains all control objects in the template:
The syntax checks on the structure file are as follows:
- Analysis of the structure file (finds symbols and control data)
- Check for all symbols and their parameters
- Check for all repeating groups and their parameters
- Check for all symbol nesting
- Creation of error message log
- Saving the structure information
On the Messages tab page, choose the function with the quick info text Go To to localize the error in the document template and correct the syntax.Use the check boxes as indicators for already corrected warnings or errors. Read the detailed error description using the Long Text function. Choose to delete the message.
WWI Editor main screen – This is a report template screen where one can call includes or add the report symbols. It has a MS Word interface with certain functionalities disabled.
Use of Includes
Includes allow the WWI report editor to call another template in the main template. One can specify the Include the template name, version and the report template type in the include statement:
This allows the user to subdivide complex templates into individual templates and thus make them easier to handle. In addition, for parts that are identical in several templates , one can create them in a separate template and include this in all relevant templates. This makes editing and managing document templates easier.
Do NOT use included templates within repeating groups because this has a negative impact on performance. During report generation, the system expands the included template and fills its symbols with data.
The following prerequisites must be fulfilled before you can include a document template:
- The template has one of the following statuses:
- a. In Work (IW)
- b. Released (RE)
- The syntax is free of errors.
- The template can also be used alone.
The control symbol for including a template has report symbol type 20. The string <20INCLUDE introduces the syntax. Following this, parentheses enclose the template, version, and document type, each separated by commas. The template is enclosed in double quotation marks. The “greater than” (>) sign closes the syntax.
Example – <20INCLUDE(“Test”,01,SBV)> means that the template Test with version 01 is included. The template has the document type report template ( SBV ).
- Specifying a version and document type is optional. If you do not specify a version, the system uses the following version of the template:
- When testing the layout of a report, the system uses the newest version that has the status In Work(IW) or Released (RE).
- When creating a report as the result of a report request, the system uses the newest released version.
- If you do not specify a document type, the system uses the document type of the template into which the template is to be included.
To include a document template in another document template, proceed as follows:
- Position the cursor in the template at the place at which the template is to be included and choose with the quick info text Include Template .
- Select the template you want to include and confirm your entry.
- Check and save the template.
Example of Compositions used in Section 3
Used in a table format in the WWI Template to display the hazardous ingredients, etc. The table header is created in a separate table in the layout. In the generated document, the two tables merge because only hidden paragraph marks appear in the layout between the header table and the data table. Handling the header separately has the following advantages:
- The header can be suppressed if no value assignments or components exist.
- The header is displayed only once (not for each value assignment), which means the use of conditioned text is not required.
- When the table header is output, the first value assignment and the first item of the component are queried (repeating groups limited to “1” in each case). The specification key of the component is checked again for safety (the specification key is a required entry field when entering component data)
The actual table then contains the output of the data from all value assignments and items.
The generated report can then be printed incorrectly only if the first value assignment of the value assignment type (in this example SAP_EHS_1012_004) is a value assignment without components.
Xylene, mixed isomers
R10; R20/21; R38
>= 50 – <= 100 (Ø 52.5)
R10; R66; R67
>= 12,5 – < 20 (Ø 12.5)
R10; R37/38, R41; R67
>= 10 – < 12.5 (Ø 10)
Creation of Custom Symbol for Table fields (For Technical Team Only)
If some new custom Parameter Symbols (related to tables in the database structure or function module) need to be created, the steps are as follows:
- Go to transaction SPRO. Select the path as follows.
EHS-> Basic Data and Tools->Report Definition->Report Symbols->Specify Report Symbol Group.
- The fetching of data fields are available in function modules. A Report Symbol Group will have many Report Symbols. The required Report Symbol Group in which new Report Symbols are required need to be identified and its corresponding ‘Foreign key – function module’ can be copied to a new Z function module and the newly required code to get new fields can be written in the Z function module.
- Also, the ‘Foreign key – function module need to be assigned with the new Z function module, and save the changes in a Customization Request.
- After assigning the new Z function module and saving the same, click on ‘BACK’ button and choose : ‘Check and Specify Report Symbol Groups’
- Then click on ‘New Entries’ to create new Report Symbols.
- To create a new Report Symbol, the following details need to be entered respectively
- Once the details are entered, SAVE the changes. Now, the newly created Report Symbol will be available under the respective group in transaction CG42 where WWI template can be created or edited. The new Parameter Symbols can be mapped in the same manner as mentioned in the steps above.
How to import the Report templates from SERC content
The SERC content would always have two files associated with each report template (.dat and .doc file) – both should be uploaded in SAP EHS for every template to work
- First upload the dat-files (for example SDS_2014_1_EU_MAIN.dat) and doc-files (for example SDS_2014_1_EU_MAIN.doc) on the application server using transfer format BIN (=>transaction CG3Z).
- Then import the dat-file using transaction CG34 “Import Report Templates” or go to Logistics -> Environment, Health and Safety -> Basic Data and Tools -> Tools -> Data Transfer -> Import Report Template
- The following settings need to be used:
- File with path: <path on application server and file with ending .dat> (Note that each dat-file contains the information to automatically pull the corresponding .doc file.The doc-file itself should NOT be specified for the import.)
- Character standard: UFT-8
- Choose function “Check file”. The SAP System checks if the data can be transferred correctly from the transfer file and matches up the symbols.
- Check Symbol Match-up to make sure all symbols are available on system in the correct way.
- All entries in the system column must have symbol names. If they do not, check if symbol generation was carried out on your system.
- “Transfer/Start Time” will transfer (import) your file.
- WWI will automatically open the new template document. Check the template by clicking on the check-button and save it. If you encounter error messages at this stage, you can directly take the relevant actions(i.e. set up missing ID-listings, etc.), or you may save the template anyway and resolve the messages later.
Creation of Generation Variant
The generation variant makes it possible for only permitted specification data to be output on a report because it links the report template with a leading validity area and one or more value assignment ratings.
Using transaction CG2B you can maintain generation variants for every template. Or you go to Logistics -> Environment, Health and Safety -> Basic Data and Tools -> Report Definition -> Edit Generation Variants
- If there needs to be status check performed before extracting data from a specification. Validity Area specifies the Region for which the data should be picked by the template.
- The option “Usage check” is utilized to control the way in which the usages are compared. There are four options to select: 0, 1, 2 and 3.If you do not specify a value, the SAP System uses the value 0 as default.
- Value 0: The usage is appropriate if – with the same rating used – the generation variant validity area that is expanded to its countries and regions is the same as or is a subset of the expanded validity area of the usage with which it is to be compared.
- Example: Generation variant: DE Value assignment usage: REG_EU If a safety data sheet is created for Germany, value assignment instances are also taken into account that are valid for the validity area REG_EU.
- These validity areas or languages must be addressed directly by the WWI coding in the template (G-Repeating-Group) to be effective. By the use of these Rating/Validity options, it is for example possible to give out special phrases in English on a template in Chinese or Spanish.
- In the generation variant the main validity area is defined under “Validity Area”; the area from which the template will draw its data.
How to create WWI report symbols
Run transaction CGCZ “Match up master data” with flag “Generate Symbols” only. This will generate the necessary new WWI symbols for the new characteristics.
In a standard R/3 System automatically created symbols using the transaction CGCZ are generated with descriptions which are copies of the characteristics descriptions in the logon language.
The flag “Regenerate Symbol Descriptions” within transaction CGCZ can be used to generate the symbol descriptions in another language different from the logon language. English or German are possible symbol descriptions languages when property tree packages are installed where the characteristics descriptions are delivered in English and German.
very well explained. Thanks for sharing this. 🙂 😎
Kudos For you Patience & documentation Boss 🙂
Good work Gaurish,!
Thank you for the detailed document.. 🙂
This is most useful, beautifully designed and most helpful document that I have seen in my 8 years of SAP EHS experience. Kudos Gaurish for your dedicated effort.