
Program Guidelines
Introduction
During SAP development, it often happens that developments are completed, but the develpment documentation is not updated in parallel. However, maintaining the program documentation is also part of the developer's work, and as a result, the developed program and the program documentation differ from each other. If this happens, it will be very difficult to fix afterwards.
The development now being presented helps to automatically generate the program's technical documentation based on your Transport Requests. Transport Request of SAP contains all the information about your development. You just set your transports to the program and the documentation is ready.
Advantages of using the program:
-
Save your time
-
Can be applied to existing developments
-
Uniform document format
-
Simple and quick creation
-
Well commented program results an easy-to-build TS
-
•Searchable and structured documentation
As a developer, I'm working for our business process would be faster, simpler and more accurate. It's should be true for our developer work.
Let's get started and run the following transaction: /TSDOC/CREATE_TS
Navigation Bar
Documents can be selected and browsed by navigation bar.

Fieldnames
Description
Tech. Specification
TS document ID
PAGING lock by
consultant
An UserID can be written into this field, which will be affected the paging. The paging buttons will apply to records where the specified consultant contains. This field will be filled automatically by the /TSDOC/PAGING_CON parameter, which can be set in SU3 transaction.
by developer
An UserID can be written into this field, which will affect the paging. The paging buttons will apply to records where the specified developer contains. This field will be filled automatically by the /TSDOC/PAGING_DEV parameter, which can be set in SU3 transaction.
by creator
An UserID can be written into this field, which will affect the paging. The paging buttons will apply to records where the specified creator contains. This field will be filled automatically by the /TSDOC/PAGING_CREAT parameter, which can be set in SU3 transaction.
Buttons
Description
Paging buttons in order:
-
First document
-
Previous document
-
Next document
-
Last document
You can find more details about the Parameters at the link below:
General Fields

Fieldnames
Description
Document ID
Technical Document identifier
Title
Title of Technical Document
Non Clean Core
Use this checkbox in that case if the modification involves SAP standard code changes
Document Template
DOCX format WORD document which can be uploaded with SMW0 transaction. It can be possible that you need to choose one of several document templates.
Module
SAP module
The names of the modules can be found in the following table: /TSDOC/MODULE
Maintained by SM30: /TSDOC/V_MODULE
Group
Individual grouping
The name of the grouping can be found in the following table: /TSDOC/GROUP
Maintained by SM30: /TSDOC/V_GROUP
Consultant
Consultant of development
Developer
Developer of development
Language Key
Document language
Work Folder
The document will be automatically generated into this folder
Filename
Filename of document
Change ID
Technical identifier, where you can write the identifier of an external ticketing system (if you use such a tool)
Solman ID
Technical identifier, where you can write your SOLMAN ID (if you use such a tool)
Document has been generated
This a read-only flag indicates that the Technical Document has been generated
Create by
Created at
Changed by
Change at
Read-only fields are filled in automatically with creation and modification data
Some fields are automatically filled depending on the settings
* fields marked in red are mandatory
Buttons
Description
"Filename Formatting" button beside the "Filename" field
Illegal characters (for example: ! % ( ) [ ] etc.) can be removed and converted spaces to underscore (_) characters in the file name by this function
"Open Work Folder" button beside the "Work Folder" field
Open the path of the folder
"Open Document" button to open the generated TS document
Transport Request Table
This table includes that Transport Requests which you want to create the Technical Documentation.

Buttons
Description
Add a new Transport Request to the table
Delete Transport Request from the table
Information about the Transport Request
Sort and compress the given modifiable Transport Request
You can add a new Transport Request to the table by the "Add Transport" button. If you check the "Get more TRs by Name" option, the program will automatically add those Transport Requests whose names match the selected one.

Info icon - If the given Transport Request is already included in another Technical Documentation, you will receive the following message:

Info icon - If the given Transport Request is still opened (not released), you will receive the following message:

Object Table [Object/Code/Structure/Content Type] [Skip] Columns

The Object of TRs tab contains a table where the objects of the given Transport Requests are listed. The table contains four check-box type columns, which show how the object is handled from the point of view of documentation.
The system distinguishes the following object types:
-
Object type (for example: parameter, message, data type, domain...etc.)
-
Code type (for example: program, class method, function...etc.)
-
Structure type (for example: table, view, structure...etc.)
-
Content type (for example: table content...etc.)
-
Skip (object that does not appear on the documentation)
This is a technical classification that helps create documentation.
Object Table [Obj./Ver. Skip] [Redundancy] Columns

In that case when several transports are selected for the preparation of the documentation, it may happen that the given transports contain same objects. "Obj. Skip" icon can be controled how the program handles these duplicate objects.
The program indicates the same objects with an exclamation mark in the "Redundancy" column.
The toggle switch in the "Obj. Skip" column you can control the behavior of the selected object.
X means to skip the transport object from document and from version comparison.
Let's look at some examples:
We have three released transports (TR#1, TR#2, TR#3), which generated three versions (VER#1, VER#2, VER#3) on the same object (OBJ#1). In the "Code changes" column, you can see the changes from version to version. We want to create a TS document about the TR#2 and TR#3. In this case the TR#2 and TR#3 will be set on the TS record and objects of these TRs can control by toggle switch.
Object table settings and examples:

Object Table Controls

Buttons/Icons
Description
Objects of transports can be reloaded by this button.
If not released TR is included on the TS record and meantime new objects are added into the TR, the new objects can be reloaded into the given object table of TS record.
Allow and skip all objects
Keep the first/last version and skip others

Information about the meaning of the icons

Information about the meaning of the colors
Additional Documents
Additional documents can be uploaded from any place on this TAB. If the technical documentation has already been generated, the program also places the link here. To upload a new document or link, at first the document type should be selected and set the file path or an HTTP link. After that, a new document can be added to this table by the "Add as Link" button.
Document types can be maintained by SM30: /TSDOC/V_DOC_TYPE

Fieldnames/Buttons
Description
Work folder of the documents
Work Folder
Document Type
Type of the document to be uploaded
File/HTTP Path
File or HTTP path
Open work folder
Add the given file or HTTP link to Technical Specification
Icons
Description
Automatically generated document (example: Technical Specification, SAP Note)
Open the selected document or link
Documents with highlighted status will appear at the beginning of certain reports
Convert to PDF
Technical Specification Document Generation

The general data and the TR table have been entered and the TR objects have been set, the technical specification can be generated. For to do this, at first the TS record should be saved and the following buttons will be appeared on the header of the transaction:
-
Document Generation
-
Draft Document Generation
So-called a draft document can be created by the "Draft Document Generation" button, which has no effect on the TS record. The "semi-finished" TS document can be viewed by this button. The program will ask for a path where we want to save the draft document.
The final TS document can be created by the "Document Generation" button to the given work folder and filename. This will affect the TS record as well. This means that the "Document has been generated" flag will be ticked after the document is generated, and the generated document is added to the "Additional Documents" tab.
Related buttons
Description
"Filename Formatting" button beside the "Filename" field
Illegal characters (for example: ! % ( ) [ ] etc.) can be removed and converted spaces to underscore (_) characters in the file name by this function
"Open Work Folder" button beside the "Work Folder" field
Open the path of the folder
"Open Document" button to open the generated document
Draft document can be created by "Draft Document Generation" button, which has no effect on the TS record
The final TS document can be created by the "Document Generation" button to the given work folder and filename. This will affect the TS record as well.
Related fieldnames
Description
Work Folder
The document will be automatically generated into this folder
Filename
Filename of document
Document has been generated
This a read-only flag indicates that the Technical Document has been generated
After the final document generation, the program gives the following message and pop-up question:



Generated Technical Specification Document
Generated document can be formatted by a pre-written Visual Basic script. This script is available on our website. The script should be implemented by manually in the company environment. After implementation, the script can be added to any button and the document can be formatted by it.
You can find further information about the Word Settings and how it works at the link below.
After pressing the formatting button, the following messages are displayed on the status bar of the MS Word:
1 - Tables formatting preparation...
2 - [Number of processed tables: 2/4] [Number of processed cells: 50/72] [Processing status: 79%]
3 - Text formatting...
4 - Document formatting has been completed!

The generated TS document has 9 sections:
-
General Information
-
Metadata Intergration
-
Projects / Transports
-
Developers / Consultants
-
Used Objects in Transport
-
New Codes
-
Code Changes
-
Structure Changes
-
Table Contents
-
Object Changes
The first four sections (General Information, Projects / Transports, Developers / Consultants, Used Objects in Transport) contain general information, which was derived from the TS record. Furthermore, transports, projects, transport and task owners and objects of transport are listed here.
These sections are shown below:

To integrate metadata, you must activate the following Busniess Add-Ins:
Enhancement Spot: /TSDOC/ENH_TECH_TS
BADIs: /TSDOC/BADI_TECH_TS
Method: INTEGRATION_METADATA
For more information about the Metadata Integration, please use the following link:




/TSDOC/REGEX table contains the regular expressions based on which a newly created program's TS document is generated. This table can be maintained by transaction SM30 (/TSDOC/V_REGEX). The program looks for the string in program code based on the regular expression and takes over all comments of statement from environment into the TS document.
For example, the following comments will take over the TS document based on the "^[ ]*REPORT[ ]+[^ ]+[ ]*\." regular expression:
*&--------------------------------------------------------*
*& Report ZFLIGHT_CUST_VIEW_REP
*&--------------------------------------------------------*
*& Program Description: Flight bookings from customer view
*&
*& ALV Structure: ZFLIGHT_ALV_CUSTOMER_VIEW
*&--------------------------------------------------------*
REPORT zflight_cust_view_rep.
The following table summarizes the pre-set text elements. This table (/TSDOC/V_REGEX) can be expanded and it also be customized by customer.
Regex ID
CLASS
DEFINE
FORM
FUNCTION
METHOD
MODULE
PROGRAM
REPORT
Regex String
^[ ]*CLASS[ ]+[^ ]+[ ]*\.
^[ ]*DEFINE[ ]+[^ ]+[ ]*\.
^[ ]*FORM[ ]+[^ ]+[ ]*\.
^[ ]*FUNCTION[ ]+[^ ]+[ ]*\.
^[ ]*METHOD[ ]+[^ ]+[ ]*\.
^[ ]*MODULE[ ]+[^ ]+[ ]*\.
^[ ]*PROGRAM[ ]+[^ ]+[ ]*\.
^[ ]*REPORT[ ]+[^ ]+[ ]*\.
Some settings reach from /TSDOC/PARAM table, which can be maintained by transaction SM30 (/TSDOC/V_PARAM). This table contains the following relevant two setting options:

-
BLOCK_BEG - Begin of the Code Section / BLOCK_END - End of the Code Section
These parameters is a regular expression. It's a comment format, which can be used for transfer a complete section of code into the TS document.
For example:
Begin of the code - Regular expression: ^[*"][ ]*[>]{2}|^[ ]*["][ ]*[>]{2}
It means these comment format of code:
* >>
" >>
End of the code - Regular expression: ^[*"][ ]*[<]{2}|^[ ]*["][ ]*[<]{2}
It means these comment format of code:
* <<
" <<
In this case, if you want to transfer a complete code section to the TS document, you must use the following comments in the program code:
* >> Begin - Comment of Statement
code line 1
code line 2
code line 3
* << End - Comment of Statement
OR
" >> Begin - Comment of Statement
code line 1
code line 2
code line 3
" << End - Comment of Statement
If you do not use a closing comment (* <<), the code lines are transferred to the TS document from the block opening comment to the first empty line.
For example the "code line 1" and "code line 2" will be transferred to the TS document, but the "code line 3" won't be transferred.
* >> Begin - Comment of Statement
code line 1
code line 2
code line 3
You can find more details about the Technical Parameters at the link below:


As far as possible, use the documentation tool provided by SAP, which can be accessed using transaction code SE61. If you use this function the TS generator will transfer these descriptions into the TS document. Let's look at an example.
Start transaction SE61 Here you can write documentation for several objects. To do this, simply select the relevant object and language, specify the object name and click the "Create" button. In this example, we add documentation to a report.

An information button automatically appears in the program header. Clicking on it opens the previously created documentation.


Currently, the TS generator program can handle the following document objects:
Document Class
RE
CL
CO
DO
DE
TB
NA
FU
CA
CE
Description
Program
Class
Class Method
Domain
Date Element
Table
Message
Function Module
Class Attribute
Class Event
The first three lines of codes contain technical information about the current and previous versions. After that, the inserted (I) and modified (U) code lines are visible. The code lines are highlighted with colors by the Visual Basic program.


The first seven lines of structure contain technical information about the current and previous versions. After that, the inserted (I) and modified (U) fields are visible. The code lines are highlighted with colors by the Visual Basic program.

The document section below shows the content of the table.

Further object modifications appear in the document as follows:

Currently the following objects are managed by the program:
