Académique Documents
Professionnel Documents
Culture Documents
com
On a recent job, the client had SAP ERP Central Component (ECC) 5.0 and SAP CRM 2005. With the large volume of data loads that move between ECC and SAP CRM, a significant number of Business Documents (BDocs) flow through queues. Usually the BDocs flow smoothly through the queues, but sometimes they become stuck in the queues due to errors. My task was to devise a way to monitor BDocs in SAP CRM to troubleshoot these errors. For example, you could encounter an error when a business object is changed in the CRM Server, but ECC doesnt receive this change. The same goes for the reverse process SAP CRM may not reflect changes on the ECC side. SAP CRM doesnt offer a systematic approach to troubleshooting and BDoc monitoring, so I devised the following procedure to streamline the BDoc monitoring process. Ill show you a way to identify the BDoc error, find out where it occurred, locate the BDoc in the queue, and reprocess the BDoc.
For the BDoc Type (Generation Name), enter the BDoc type to use as a filter, such as BUPA_MAIN for a business partner message, BUS_TRANS_MSG for a transaction (order) message, or PRODUCT_MAT for a product message. For example, if you want to display all the error BDocs related to business transactions, enter BUS_ TRANS_MSG in the BDoc Type field to filter BDoc errors by transaction. If you want to display a particular BDoc and you know the 32-digit, unique BDoc ID, such as 464C8CA65C9E00AD00000 000C0A870B2, enter it in the BDoc
ID after it generates the BDoc. You can ignore this parameter if you dont know the BDoc ID. In this case, the system displays all the BDocs based on the BDoc type. You
Figure 1 Selection screen for transaction SMW01 (display BDoc error messages)
11
www.WISpubs.com
can use the User (Creator) field to filter BDocs based on a given user. The BDoc State describes the current processing of a BDoc. Table 1 shows the possible statuses for this field. Usually you encounter BDocs with a status that starts with an E or F. Statuses with an F are final and mean that the system processed the BDoc after initially encountering an error. Statuses with an E are error statuses that you must correct manually. Finally, if you want to display inbound BDocs, select the Inbound check box in the Flow Context area. To display outbound BDocs, select the Outbound check box. After entering the filter criteria in Figure 1, press F8 to execute the transaction with your selection parameters. The screen in Figure 2 appears. In the State field you see three circles. Successfully processed messages have the right circle shaded in green, those still in process have the middle circle shaded in yellow, and those with a terminal error condition have the left circle shaded in red. If a message is in process and the system does not process it within a reasonable amount of time, you can restart, view, or
discard the message. The next sections describe when and how you can carry out these functions.
the BDoc errors. In the screen that pops up, click on the Errors button to see the list of errors and their descriptions (Figure 3). Then click on the Longtext button to view the information about the cause of the error. For example, if the system has triggered a business partner transfer, you may see the
Meaning
Received (intermediate state) Written to queued Remote Function Call (qRFC) queue (intermediate state) After qRFC step (intermediate state) BDoc stored before update task (intermediate state) Temporary lack of resources in application layer Rejected (fully processed) Confirmed (fully processed) Set to processed (fully processed) Confirmed (fully processed by all receivers) Information (no processing) Technical error (incomplete) Partially send, receivers have errors BDoc cannot be read from database BDoc validation error Inbound processing failed Outbound processing failed Conversion error Send to receivers (not all have confirmed) To be processed (debug) Retry after temporary error
Table 1
Neighbors
Delete BDoc
Troubleshooting
Reprocess BDoc
Figure 2 List of BDocs that appear after you execute transaction SMW01
12
error text Pin code missing. This helps you see that this BDoc is stuck because the system encountered a missing pin code when it created the business partner in the source system. To find the business partner number and to check the pin code field value, you need to display the classic and extension data as explained in the following sections. When you're finished, close the BDoc error segments window to go back to the screen in Figure 2.
see if the same object is available. If the object is not available in the sender system then you can delete this BDoc. If you find the object in the sender system and not in the receiver system, then you confirm that an error occurred during transfer. In this case you need to check the BDoc errors as explained in the previous section. If the object is available in both the sender and receiver systems, then you need to find the detail data the BDoc is carrying. For example, say someone triggers a business partner transfer from ECC to SAP CRM. You found the business partner number by clicking on the classic data icon. In this case you need to check ECC and SAP CRM to ensure that the same business partner is available in both the systems. The extension data shows this information. Display the extension data by clicking on the show extension data icon . Com-
pare this data with the object in receiver system. If you find that the data is the same, then you can delete the BDoc. If the data is not same, then find the BDoc error as explained in the previous section.
Middleware Trace
Sometimes you may face a situation in which the BDoc has errored out and you are unable to find the cause of the error even after clicking on the display BDoc errors icon. In this case the CRM Middleware trace monitor helps you find the error by displaying the trace level and trace program name with the line number. Youll need the assistance of your ABAP developer for this step. Click on the show BDoc message trace icon , use transaction SMWT, or follow menu path BDoc Message>Display>BDoc Message Trace to display the BDoc message trace. All methods lead you to the Middleware Trace screen (Figure 4). The developer uses this information to debug the trace program and find the error. Click on the troubleshooting icon to see the information about troubleshooting this BDoc (Figure 5 on the next page). Here you can find the steps you need to take to resolve the BDoc error.
13
www.WISpubs.com
After you correct the error, click on the . In the screen reprocess BDoc icon that appears, click on the Yes button to reprocess the BDoc. The system reprocesses the BDoc and BDoc status turns green if it successfully processed or it may still remain in same state with a new error. Then you need to follow all the above steps again to find the error until the BDoc is error free.
on the CRM Server for ECC. If an object is not processed correctly within ECC, and the system doesnt return an error condition via BAPI parameters, you must check ECC using transaction SMQ1 (outbound) or SMQ2 (inbound). For example, when you download a product from ECC to SAP CRM, you can find the qRFC entry in ECC transaction SMQ1, which then flows to SAP CRM with the qRFC entry in CRM transaction SMQ2. You display qRFC queues in three steps. For outbound queues, first go to transaction SMQ1 and click on the execute icon to access the qRFC Monitor screen for outbound queues (Figure 6). Select the Queue Name and then click on the display icon to view the entries under that queue with the status and time stamp (Figure 7). You can access additional detailed items by selecting the queue and clicking on the display icon (Figure 8). In this screen you can delete ( ), execute ( ), or debug an entry ( ). For example, when a user triggers a product download from ECC to SAP CRM, you can delete the entry in
Figure 8 (if the product is already available in CRM), execute the download (to send the entries to SAP CRM), or debug the download if it is stuck.
14
want to keep the most recent data. The SAP default is variant SAP&_MW_ REORG with seven days. Then schedule the reorganization job by using transaction SM36 or by going to transaction SPRO and following menu path CRM>CRM Middleware and related components> Reorganization>Reorganize Log and Trace Data.
Figure 6 qRFC outbound queue display after executing transaction SMQ1 Pavan Kumar Sunkara is an SAP-certified solution consultant with six years of SAP experience, including five years with SAP CRM and one year with SAP ABAP. He has participated in three Figure 7 qRFC queue entries full lifecycle implementation projects and has expertise in CRM Middleware, Internet Pricing and Configurator (IPC), telesales, and teleservice. He currently works with SITA Corp. as a senior SAP architect. Pavan has worked with major clients from various industries, including hi-tech, manufacturing, and consumer goods. You may contact him via email at pavan.sunkara@sitacorp.com. Figure 8 Details of each queue entry displayed
15