SAP ABAP IMG Activity REFXRECPZH (Implement Enhancements (BAdI))
Hierarchy
EA-FIN (Software Component) EA-FIN
   RE-FX (Application Component) Flexible Real Estate Management
     RE_CA_CU (Package) RE: Customizing (IMG) and Area Menu
IMG Activity
ID REFXRECPZH Implement Enhancements (BAdI)  
Transaction Code S_ALN_01000792   (empty) 
Created on 20020129    
Customizing Attributes REFXRECPZH   Implement Enhancements (BAdI) 
Customizing Activity REFXRECPZH   Implement Enhancements (BAdI) 
Document
Document Class SIMG   Hypertext: Object Class - Class to which a document belongs.
Document Name RECP_SF    

Use

This Business Add-In (BAdI) allows you to enhance the standard behavior of correspondence. You can:

  • Specify default values for the selection screen options
  • Define your own parameters
  • Define differentiating characteristics
  • Influence how the document list is created
  • Change the output of forms

Specify default values for the selection screen options

  • APP_OPTIONS_INIT - The method is called once when the selection screen is initialized. You can change the fields of the CS_OPTIONS parameter so that the standard defaults for output device, correspondence activity, and so on, can be overridden.

Define your own parameters

You can add an additional tab page for print parameters for each correspondence application. This is in addition to the selection screen for mass printing and the print dialog within the RE Navigator. These print parameters can then be applied, for example, when the document list is created, or when the form is output. Carry out the following activities:

  • Add the fields you want to the RECP_SF_OPTIONS_BADI DDIC structure using APPEND.
  • Copy the RECP_GUI_SF_BADI_EXAMPLE function group, including the function module, to the customer name range. Modify subscreen 1000 so that the fields are displayed.
  • Implement the APP_OPTIONS_INIT method and set the following fields for the CS_OPTIONS parameter:
    • SUBSCREENEXTFM - Name of the PBO function module
    • REPIDBADI - Program name of the subscreen
    • DYNNRBADI - Screen number of the subscreen
    • XSUBSCREENEXT - Tab page title (optional)

      Example class CL_EXM_IM_RECP_SF contains a corresponding implementation of APP_OPTIONS_INIT.

Define differentiating characteristics

By using differentiating characteristics, you can have the system determine a specific correspondence activity for each real estate object during mass printing. For example, you can set up the system so that contracts with contract types A and B are printed using correspondence activity 4711, while all other contracts are printed using correspondence activity 4712.
Before you decide to use differentiating characteristics, you should check if your requirements for different documents can be met using conditions within Smart Forms.
In general, you should try to limit the number of forms you have, since they often contain many of the same parts (form structure, information windows, and so on), which increases the time and effort required in maintenance and comparisons.
Using differentiating characteristics makes the most sense when correspondence activities differ in their recipient roles.

  • GET_DIFF_CHARACTERISTIC - The method is called once for each real estate object that is processed. The purpose of the method is to derive the differentiating characteristic from the properties of the real estate object. The differentiating characteristic itself is a text you define with a length of 30. First create the allowed differentiating characteristics in Customizing for each correspondence activity, which can be delivered by the Business Add-In. Then assign the differentiation characteristics to the resulting correspondence activities (in Customizing for correspondence applications under correspondence activities).

Since the differentiation characteristic is any text you choose, there are two options for how you can implement the example explained above:

  • The contract type can represent the differentiation characteristic, so that many Customizing entries are necessary (one entry for each contract type).
  • The resulting correspondence activity can represent the differentiation characteristic, whereby only two Customizing entries are required.

Influence how the document list is created

In the standard system, real estate objects are selected first. Then the system determines the documents to be created for each real estate object based on the correspondence activity. You can change this behavior using the following methods:

  • CHECK_BUSOBJ_RELEVANCE - Checks if the real estate object is taken into account when documents are created for this correspondence application. Trigger the NOT_RELEVANT exception to have the system ignore the real estate object. The correspondence log then does not contain any reference to the ignored real estate object.
    The method is called exactly once for each selected real estate object.
  • CHANGE_DOC_DATA - Using this method, you can change the properties of a document that was determined in the standard way. For example, you can change the document language or the form name (if you are not able to control them enough using the basic settings or the correspondence activities). To keep the document from appearing in the document list, add appropriate warning or error messages to table CT_MESSAGE. These are displayed in the correspondence log.
    The method is called exactly once for each document.
  • CHANGE_DOC_LIST - Using this method, you can modify the entire document list and change how documents are sorted.
    The method is called exactly once for each run, after the standard document list was created.

Change the output of forms

In the standard system, the output of forms is handled by function module calls:

  1. SSF_OPEN - Opens the print request
  2. Call of the generated function module for each document to be output
  3. SSF_CLOSE - Closes the print request

SSF_OPEN and SSF_CLOSE are not absolutely required for output with Smart Forms, but they do improve performance when the system generates spool requests in OTF format (for later output to printers).

There are BAdI methods available for each of the three steps listed above and for displaying the print preview:

  • SF_OPEN - Smart Form: Opens new print request
  • SF_PRINT - Smart Form: Prints the document
  • SF_CLOSE - Smart Form: Closes the current print request
  • SF_PREVIEW - Smart Form: Displays the print preview

These methods are called before the standard function module. The following are available in the methods as inbound parameters:

  • IS_OPTIONS - Options of the correspondence application, that is, of the whole current output operation, such as all settings on the selection screen
  • IS_DOC - Document properties, such as real estate object, recipient, name of Smart Form

In these methods, you can change exactly those parameters that also support the corresponding function modules.

If you set another output parameter that is also supported, CF_SUPPRESS_DEFAULT_OUTPUT = 'X', then the next standard function module is not called, so that you can completely replace the standard behavior. In that case, you have to supply the correct values to the return parameters. For SF_PRINT these are CS_DOCUMENT_OUTPUT_INFO and CS_JOB_OUTPUT_INFO. This is necessary because the messages for the correspondence log are always derived from them.

If you only want to change form parameters for SF_PRINT, such as CS_OUTPUT_OPTIONS, but still want to use the standard output, then CS_DOCUMENT_OUTPUT_INFO and CS_JOB_OUTPUT_INFO are irrelevant.

Changing the standard form output might be advantageous in the following scenarios:

  • You want to use output of Smart Forms to the usual output media, but you want to override certain parameters during the call of forms (for example, entries for the spool request, such as name, cover sheet, and so on). To do so, for example, implement, SF_PRINT and change the fields in the appropriate return parameters, such as CS_OUTPUT_OPTIONS.
  • You want to output using Smart Forms, but you want a different output format, such as XSF (XML for Smart Forms). Since output with XSF is technically incompatible with the SSF_OPEN and SSF_CLOSE function modules, implement the SF_OPEN and SF_CLOSE BAdI methods by setting CF_SUPPRESS_DEFAULT_OUTPUT = 'X' for each one. The standard call of these function modules is thereby suppressed. Implement SF_PRINT and set the corresponding parameters in CS_CONTROL_PARAMETERS and CS_OUTPUT_OPTIONS. In this way, you can have the system return the form output, for example, in XSF format as an internal table, in order to write this data to a file.
  • You want to use an external tool for form output. Set the CF_SUPPRESS_DEFAULT_OUTPUT = 'X' return parameter in all four BAdI methods. Implement the call of the external tool in SF_PRINT. You can use standard data retrieval again by calling the standard methods SF_PRINT , which are called within the corresponding Smart Form in the initialization. Transfer the standard methods of parameter ID_DOCGUID in order to identify the current document.

Notes for Developers

Requirements

Standard settings

Activities

Business Attributes
ASAP Roadmap ID 153   Design enhancements 
Mandatory / Optional 1   Mandatory activity 
Critical / Non-Critical 1   Critical 
Country-Dependency A   Valid for all countries 
Maintenance Objects
Maintenance object type E   Business Add-In - Definition 
History
Last changed by/on SAP  20050519 
SAP Release Created in 110