DO Shipping > Creating Custom Shippers
  
Creating Custom Shippers
This section describes the steps necessary to create a customized shipper document for outgoing shipments. This procedure can be used for the following programs:
DO Pre-Shipper/Shipper Maint (12.19.3)
DO Pre-Shipper/Shipper Print (12.19.11)
This procedure is intended for users with a working knowledge of the QAD environment, record structures, and functionality, as well as programming using Progress Version 8 or later.
Overview of Print Procedure Forms
Shipping provides the ability to create shippers with customized layouts and/or customized data to comply with statutory requirements or common business practice. The customization can be performed by anyone with the current software and access to a Progress development environment, including third-party developers and end users.
Shipping is designed so that the customization requirements are minimal and localized. To create a new shipper, you need to create or modify only one Progress procedure, even though the results of the customization can be visible in a multiple functional area. This prevents customizations from adversely affecting other functionality and minimizes their maintenance costs when later updates are installed.
QAD provides a procedure, dodspr01.p, to print a shipping document in a standard format for any outgoing shipment. The procedure dodspr01.p is fully functional, but is designed to serve also as a model for end-user customization. Customized shipper formats can be added by copying and modifying this standard procedure. Each shipper, whether custom or standard, is supported by a single procedure.
A shipment is associated with a specific print format, through the use of the shipper’s Document Format field, visible when maintaining the shipment. Each document format is associated with a specific printing procedure, such as dodspr01.p, through the use of the document format’s Form Code field, visible when maintaining the document format. The two-character form code corresponds to the last two characters of the name of the procedure. The remaining characters of the procedure name are fixed.
Example: Any shipment with a document format that uses form code 01 is printed by procedure dodspr01.p, any with a format using form code 02 is printed by dodspr02.p, any with a format using form code nn is printed by procedures dodsprnn.p.
Shipping allows a form code to be permanently associated with each shipping transaction, enabling you to print shippers of various formats in a single print run.
Creating a Custom Shipper
Use the following steps as a guideline to create a custom shipper, using dodspr01.p as a model:
1 Identify an unused form code.
Every procedure that encapsulates shipper print and other form services must be named dodsprnn.p, where nn is a two-character code. Your procedure name must be unique; therefore, choose a form code that is not in use. Use the source code directory to determine which form codes are already in use.
2 Copy the sample form code procedure.
Copy the standard dodspr01.p procedure from the source code directory to a working directory. Make sure the working directory is not in the PROPATH. This copy serves as the basis for your customization.
3 Rename the sample procedure.
In the working directory, rename the copied procedure, replacing the 01 in the procedure name with the two-character form code you identified in step 1. For example, if form code 15 is not in use and you want to use it for your new procedure, name your new procedure dodspr15.p.
4 Open your procedure for editing.
Open your procedure in the Progress procedure editor or in any other suitable text editor, such as vi. You might first have to change file permissions to edit the procedure.
Before proceeding, it is recommended that you read through the comments within the procedure thoroughly to familiarize yourself with its structure and the programming conventions used.
5 Modify your custom print procedure form.
Modifications to the appearance of printed shipping documents are implemented by directly modifying the newly created print procedure form. While it is impossible to address specific modifications, the following describes some common ones:
6 Change the location of displayed fields:
Change the appearance, such as label or display format, of displayed fields.
Change the content of the shipping document by displaying data from the shipper.
Change the overall form dimensions.
7 Document your modifications.
To document your customizations, remove any unnecessary comments copied to your new procedure from the sample procedure and add new comments describing your modifications. Although this is not required, it is highly recommended. Documenting changes facilitates future changes to the procedure and enables the procedure to be used effectively as the basis of a new customized shipper.
8 Move your procedure to the QAD system environment.
The final step is to copy your new procedure to the source code directory or directories in the propath. Also, you need to compile your procedure against the QAD databases and save the compiled version to the appropriate object code directory or directories within your environment.
Remember that for multiple-language installations, separate sets of code are maintained within language-specific subdirectories. Be sure to copy your custom procedure into the appropriate subdirectory for every language used in your installation.