Enhance the One-Order Framework for Sales Contracts to Process Incomplete or Incorrect Documents

  • by Manjinder Sohi, Manager, Capgemini America Inc.
  • Akarsh Ravi, Manager, Capgemini US LLC
  • October 9, 2012
Learn how to release error-free line items in contracts that have line items with errors in SAP CRM. See a practical solution to overcome the standard system behavior that limits the flow of contractual data to the billing and revenue processes, and discover an approach that seamlessly integrates the contract, revenue, and billing components of SAP CRM.
Key Concept

You can use the one-order framework to generate all business transactions. It is a structured yet flexible framework in which a variety of business transactions (also known as SAP CRM one-order documents) are built. Examples include sales contracts, sales orders, service orders, activities, leads, and opportunities.

The one-order framework in SAP CRM is designed to allow you to release a transaction for follow-on activities and financial processing only if it is error free. If there is an error in any part of the transaction, then the entire transaction is blocked from follow-on processing. The standard SAP CRM one-order design is acceptable for most industries (e.g., high tech) because contracts are always fully released and sales orders are always successfully saved prior to follow-on processes. However, some industries, such as media, need to release individual line items of the license sales contract for follow-on processing (e.g., billing, revenue recognition, and usage processing).

To overcome standard one-order document behavior, you need to enhance the one-order framework so that the error-free items can flow seamlessly to the follow-on transactions even though other items are in error. Figure 1 represents the license sales business process flow applicable to the media industry. In the next section, we provide background about the one-order framework for readers who are not familiar with it.

Figure 1
Process flow indicating the license sales business processes

One-Order Objects

Every SAP CRM one-order object has a business object type assigned to it. One-order objects are comprised of a set of order segments that hold specific data, including the transaction header, transaction item, partner data, dates, organization data, and subject profile data. All transactions—be they service orders, sales orders, complaints, or opportunities—are handled in a similar way through the one-order framework.

These different order objects are distinguished by their business object type (e.g., business object type BUS2000116 determines the service object). The business object type controls the functions available for an object from the business object repository, and it can have many transaction types that define properties and characteristics (e.g., partner determination procedure, text determination procedure, organizational data profile, and user status profile). Thus, depending on the business transaction, the behavior of the underlying one-order object varies based on attributes that pertain to the specific transaction.

The release process of creating the follow-up documents from any one-order document follows the same behavior in the one-order framework. The release is applied both at the one-order document header and at the item level. The follow up documents, such as revenue and billing due lists, are created only if there are no errors in the one-order document.

Line Items

Some organizations have contracts with long durations and numerous line items with varying validity dates. Although it is ideal that a transaction is error-free before it is released, it is sometimes necessary to release line items representing license sales in the current period or near future. Line items that are works-in-progress often contain errors due to the following:

  • Collision of rights information maintained in the line item with rights-owned data maintained on the SAP CRM-Intellectual Property Management (SAP CRM-IPM) product master as a result of changes to the master data
  • Collision of rights information maintained in the line item with rights sold in other license sales contracts that are created or released in the meantime
  • Incompleteness errors in the line items due to incomplete information such as missing billing installments. This is common because different user groups maintain different sets of information within the license sales contract (e.g., license fee information is maintained by a contract administrator, while billing installment information is maintained by a finance administrator).

Figure 2 illustrates the basic steps to set up a license sales contract in SAP CRM-IPM, while Figure 3 illustrates the behavior of the standard release functionality. From these, and from the process flow indicated in Figure 1, you can see why there is a need to modify the release functionality of the one order-framework to allow contracts to be partially released.

Figure 2
The maintenance of a license sales contract

Figure 3
Process flow indicating the standard release functionality

Modification of the Release Functionality

Due to the system situation we described, you may need to enhance the standard SAP code. These enhancements ensure that error-free line item information in contracts that have other line items with errors will flow to billing, accrual, and usage processing. Figure 4 shows the high-level process flow that indicates the enhanced behavior of the release functionality.

Figure 4
Process flow indicating the modified release functionality

Next, we describe the components that you should alter to achieve the core modification.

The enhancements in this article can be limited to specific transaction types and item categories, and therefore do not need be applied to the entire one-order framework.


In standard SAP CRM, billing due lists (BDL) are not generated for error-free items if errors exist in any other parts of the contract or order. To overcome this, the function modules that you should enhance are CRM_UPLOAD_BEA_SRV and CRM_STATUS_CHANGE_FOR_ACTIVITY.

The standard flow is as follows: When the contract is saved after the items are released, system control goes inside function module CRM_UPLOAD_BEA_SRV and calls function module CRM_STATUS_CHANGE_FOR_ACTIVITY to check if there are any errors in the transaction. This check is at the header level. If there are errors in any of the line items, system control exits the function module without executing subsequent function modules. However, if there are no errors, the control continues to flow in the sequence CRM_UPLOAD_BEA_SRV > CRM_UPLOAD_BEA_FILL > /1BEA/IPMI_DL_UOO_O_UPLOAD > /1BEA/IPMI_DL_O_RFCCREATE > /1BEA/IPMI_DL_O_PROCESS. In addition, BDL items are created inside function module /1BEA/IPMI_DL_O_CREATE, resulting in the update of table /1BEA/IPMI_DLI with the newly created BDL item.

If you change the value of SY-SUBRC to 0 in during the function module call CRM_STATUS_CHANGE_FOR_ACTIVITY in function module CRM_UPLOAD_BEA_SRV, then all BDL items for the transaction are generated, even for erroneous line items. However, only the error-free items need to pass to function module CRM_UPLOAD_BEA_FILL. To do so, you must code one implicit enhancement spot at the beginning of function module CRM_UPLOAD_BEA_SRV and one at the beginning of function module CRM_STATUS_CHANGE_FOR_ACTIVITY.

The steps for enhancement inside function module CRM_UPLOAD_BEA_SRV are:

  • Step 1. Read the line items in internal table message_ext-orderadm_i and check if that line item has any errors by calling function module CRM_MESSAGES_CHECK_FOR_ERRORS.
  • Step 2. If value of SY-SUBRC is not equal to 0, delete that line item and all associated billing request items (BRIs). Also, mark a deletion flag indicator.
  • Step 3. If all the line items have errors, there is no need to do anything—let standard functionality follow. Otherwise, export the flag to memory to validate it inside function module CRM_STATUS_CHANGE_FOR_ACTIVITY.

Figure 5 shows the implicit enhancement code that you insert at the beginning of function module CRM_UPLOAD_BEA_SRV.

Figure 5
Enhancement code that you insert in function module CRM_UPLOAD_BEA_SRV

The enhancement inside function module CRM_STATUS_CHANGE_FOR_ACTIVITY is:

  • Step 1. Import the flag into this enhancement spot.
  • Step 2. If this flag indicator is not marked, then you should process all subsequent standard code inside function module CRM_STATUS_CHANGE_FOR_ACTIVITY. Otherwise, exit the function module.

Figure 6 shows the enhancement inside function module CRM_STATUS_CHANGE_FOR_ACTIVITY.

Figure 6


In SAP CRM, line item information does not flow to the SAP ERP Central Component (ECC) Accrual Engine if there are any errors in the transaction. You can overcome this by performing additional modifications. The objects you need to enhance are the Business Add-In (BAdI) CRM_BUS20001_R3A and the function module CRM_IPM_UPLOAD_CAE.

M01 is the flow context that is triggered when information from SAP CRM license sales contracts (when released) and usage transactions (when posted) is replicated to the Accrual Engine (Figure 7).

Figure 7
Middleware adaptor flow context M01

The implementation CRM_IPM_REVREC in BAdI CRM_BUS20001_R3A is called in the second adapter and is responsible for the replication. This implementation contains function module CRM_IPM_UPLOAD_CAE, which has the code that checks the errors at the header level (Figure 8). You need to bypass this piece of code. Copy the standard function module CRM_IPM_UPLOAD_CAE manually to ZFCRM_IPM_UPLOAD_CAE and then you can bypass the code shown in Figure 8 at the header level.

Figure 8
Bypass the code at the contract header level

Because there is no control to reach the section of the code of function module CRM_IPM_UPLOAD_CAE shown in Figure 8, you need to deactivate the standard implementation CRM_IPM_REVREC and instead create custom implementation ZCRM_IPM_REVREC.

Usage Processing

Usage processing is a follow-on process for contracts in which usage values are applied to contract line items. In the media industry, this refers to the process in which usage values (e.g., number of subscribers, customer revenue, or number of buys) are reported and applied to performance-based line items in license sales contracts, and then the licensee (i.e., the customer) is billed accordingly. Standard SAP CRM prevents the processing of the usage transaction if there are any errors in the contract. The modification we describe next is required to create the usage confirmation transaction and to post usage values against the error-free contract line items.

The function modules you need to enhance are CRM_IPM_UCONF_CREATE_ITEMS_EC and CRM_COPY_CHECK_H_OW. You can create and change the usage confirmation document via the event call function module CRM_IPM_UCONF_CREATE_ITEMS_EC and the function module CRM_COPY_CHECK_H_OW.

First, perform a modification by commenting out the function call CRM_STATUS_CHECK in the CRM_COPY_CHECK_H_OW function module (Figure 9).

Figure 9
Comment out the CRM_STATUS_CHECK function call

You must perform the core modification in the function module CRM_IPM_UCONF_CREATE_ITEMS to bypass the check in function module CRM_IPM_UCONF_CREATE_ITEMS, as shown in Figure 10.

Figure 10

Challenges and Risks

A challenge to implementing these modifications is that you must make sure that you identify all the SAP system processes that might be affected by modifications to the one-order release functionality. One suggestion is to ensure that substantial prototyping and testing is performed before rolling out the modifications to the entire SAP landscape.

The modifications are also invariably dependent on business processes. Any changes to business processes could require you to readdress these modifications, so they should always be considered when business process changes are being discussed.

Another risk is the possibility of the modifications being overwritten by future system upgrades. For more details on SAP CRM system upgrades, you can refer to the following videos:

Manjinder Sohi

Manjinder Sohi specializes in deploying SAP ECC and CRM solutions and has a track record of successes in implementing IT solutions in the auto manufacturing, chemical, educational, banking, healthcare, and media and entertainment industry sectors. His expertise includes SAP ECC Sales and Distribution, Material Management, Production Planning and SAP CRM-IPM. He holds certification from SAP and is the order-to-case (OTC) industry solution leader for Capgemini’s SAP digital industrialization group. Manjinder graduated from the University of Texas at Dallas with a master’s degree in computer science. 

See more by this author

You may contact the author at manjinder.sohi@gmail.com.

If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.

Akarsh Ravi

Akarsh Ravi is a manager at Capgemini US LLC with over eight years of experience implementing SAP CRM and SAP ECC solutions in the high-tech, manufacturing, and media and entertainment industries. His areas of expertise include SAP CRM sales, marketing, IPM, and cProjects; and he is a certified PMP and SAP CRM Sales professional.

See more by this author

You may contact the author at akarsh.ravi@capgemini.com.

If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.


No comments have been submitted on this article. 

Please log in to post a comment.

To learn more about subscription access to premium content, click here.