Show TOC

Procedure documentationAdapting Print Forms in Shipping and Receiving

 

These examples show how to create a custom print form for a CMR road waybill for transportation units and, optionally, how to create a custom ABAP class inheriting from the standard ABAP class to process this form.

Procedure

Example 1: Creating a Custom PDF-Based Form for a CRM Road Waybill
  1. Copy standard form /SCWM/SR_CMR to a customer-specific form in transaction SFP, as follows:

    1. On the SAP Easy Access screen, choose Start of the navigation path Tools Next navigation step Form Printout Next navigation step Interactive Forms. End of the navigation path

    2. Copy the form /SCWM/SR_CMR to a customer-specific form.

    3. Adapt the form to your needs and activate it.

    Note Note

    If you use Smart Forms instead of PDF-based forms, use transaction SMARTFORMS instead. On the SAP Easy Access screen, choose Start of the navigation path Tools Next navigation step Form Printout Next navigation step Smart Forms End of the navigation path.

    End of the note.
  2. If you use only one form in SAP Extended Warehouse Management, assign the new form to the condition configuration of the PPF action definition, as follows:

    1. In Customizing for Extended Warehouse Management, choose Start of the navigation path Cross-Process Settings Next navigation step Shipping and Receiving Next navigation step Define Action Conditions for Transportation Units End of the navigation path.

    2. Choose action profile Shipping & Receiving - Transportation Unit (technical name: /SCWM/TU) and action definition Print Waybill (technical name: /SCWM/SR_PRINT_TU_WAYBILL).

    3. Switch to the change mode. On the tab Processing Details, select External Communication for PDF-based forms or Smart Forms Print for Smart Forms processing. Deselect Default Settings from Action Definition and enter the customer-specific form in the Form Name field.

    4. Save your entries.

  3. If you use different forms depending on application data, maintain the form determination, as follows:

    Note Note

    If the form determination is maintained, it has precedence over the form maintained in the condition configuration of the PPF action definition.

    End of the note.
    1. On the SAP Easy Access screen, choose Start of the navigation path Extended Warehouse Management Next navigation step Settings Next navigation step Shipping and Receiving Next navigation step Set Up Printer and Form Determination End of the navigation path (transaction SCWM/SR_PRINT). In the dialog structure, choose Define Access Sequence.

    2. Select entry Transport Unit, action profile /SCWM/TU, and print/form Form Determination, and in the dialog structure, choose Determine Form Name.

  4. Save your entries.

Example 2: Creating a Custom ABAP Class for a Custom PDF-Based Form

If not all the data you need in the customer-own form is available in the form interface, you can create your own ABAP class to process the form. In this example, you add a field to the form. Note that the form interface filled by the ABAP class must be the same as the form interface assigned to the form.

  1. Replace the standard form with a customer-specific form as described in example 1.

  2. In DDIC, enhance the interface structure /SCWM/S_SR_PRINT_CMR or the items structure /SCWM/S_SR_PRINT_CMR_ITEM. For example, insert a new append structure containing a field you want to print on the form.

    Activate your changes.

  3. Change the customer-specific form.

    Add the new field from the interface structure to the form. Activate your changes.

  4. Create a customer-specific processing class inheriting from standard class /SCWM/CL_SR_PRINT_WAYBILL.

    For this purpose, enter the standard class as superclass in the class properties of the new class. Redefine the methods you want to change, for example, GET_DATA_CMR or ADD_ITEM_CMR. You can either implement your own coding in the methods or first call the corresponding method of the superclass and then change the exporting parameters.

  5. Create a customer-specific Business Add-In (BAdI) implementation with a customer-specific filter value for BAdI DOC_PERSONALIZE_BCS. The BAdI implementation is called upon execution of the PPF action for waybill printing.

    1. Enter transactionSE19 and in the Classic BAdI area, choose Create Implementation, enter BAdI name DOC_PERSONALIZE_BCS and press Create Implementation.

    2. In the Business Add-In Builder: Create Filter Value dialog box, enter an implementation name, such as ZEWM_PRINT_WAYBILL, and a format, such as ZEWM_PRINT_WAYBILL. The format is the filter value for the BAdI implementation.

    3. On the next screen, enter an implementation short text.

      Choose the tab Interface and implement method PERSONALIZE_PDF_DOC_PDFIF.

      Copy the coding from class /SCWM/CL_IM_SR_PRINT_PDF method IF_EX_DOC_PERSONALIZE_BCS~PERSONALIZE_PDF_DOC_PDFIF into the method.

      In the copied coding replace /SCWM/CL_SR_PRINT_WAYBILL in the DATA statement with the processing class you created in step 3 and replace /SCWM/SR_PRINT_WAYBILL with the new filter value ZEWM_PRINT_WAYBILL.

    4. Save and activate the method and the class in a customer-specific package.

    5. On the Business Add-In Builder: Change Implementation screen, activate the BAdI implementation.

  6. Assign the new BAdI implementation to the condition configuration of the PPF action definition, as follows:

    1. In Customizing for Extended Warehouse Management, choose Start of the navigation path Cross-Process Settings Next navigation step Shipping and Receiving Next navigation step Define Action Conditions for Transportation Units End of the navigation path.

    2. Choose action profile Shipping & Receiving - Transportation Unit (technical name: /SCWM/TU) and action definition Print waybill (technical name: /SCWM/SR_PRINT_TU_WAYBILL).

    3. Switch to the change mode. On the tab Processing Details, select External Communication processing for PDF-based forms or Smart Forms Print for Smart Forms.

    4. Deselect Default Settings from Action Definition and enter the customer-specific format you created in step 3 (for example, ZEWM_PRINT_WAYBILL).

  7. Save your entries.

The figure below illustrates example 2. The customer's objects and settings are represented by the yellow elements.

Example 3: Creating a Custom ABAP Class for a Smart Form Form
  1. Follow steps 1-4 as described in example 2.

  2. Create a customer-specific agent class inheriting from standard class /SCWM/CL_SR_PRINT_SF, as follows:

    1. Enter the standard class as superclass in the class properties of the new class.

    2. Redefine method EXEC_SF_WAYBILL and in the implementation of the method, replace /SCWM/CL_SR_PRINT_WAYBILL in the DATA statement with the processing class you created in the previous step.

    Save and activate your changes.

  3. Assign the new agent class to the condition configuration of the PPF action definition, as follows:

    1. In Customizing for Extended Warehouse Management, choose Start of the navigation path Cross-Process Settings Next navigation step Shipping and Receiving Next navigation step Define Action Conditions for Transportation Units End of the navigation path.

    2. Choose action profile Shipping & Receiving - Transportation Unit (technical name: /SCWM/TU) and action definition Print waybill (technical name: /SCWM/SR_PRINT_TU_WAYBILL).

    3. Switch to the change mode. On the tab Processing Details, select Smart Forms Print processing for Smart Forms.

    4. Enter the customer-specific agent class in the Processing Class field.

  4. Save your entries.