Вы находитесь на странице: 1из 17

SAP CRM Middleware Monitoring and Error Analysis for Replication

About SAP CRM Middleware


All current day Software applications use messaging architecture instead of a point to point communication between its various logical & physical components. SAP CRM is no different. One of the so called new dimension technologies from SAP CRM version 7 also uses a structure component nown as SAP CRM Middleware to communicate internally between its various logical and physical components. !hese mode of communication happens through business document type now as Bdoc. A business document type "#$oc type% is a set of transaction statements that represent a logical ob&ect. 't is a container of the business data that is necessary to run a business process " For example: for a Business Partner the bdoc is BUPA_MAIN%.

n!ormation "n Bdocs


Classes o! B#oc $%pes

#$oc types used in a mySAP CRM scenario can be classified as follows( S%nc&roni'ation B#oc t%pes (sB#oc t%pes) !hese #$oc types are processed in the CRM Server as well as in the mobile client and contain mappings to tables. !hey were previously called write #$ocs in the client)based #$oc Modeler. Synchroni*ation #$oc types are used to e+change data between the CRM Server and mobile clients. Segments are mapped to table"s% where the mapping defines the relation between abstraction and physical database. Mobile Application B#oc t%pes !hese #$oc types are used by CRM Mobile Applications and are processed outside the CRM Server. !hey contain mappings to tables. !here are two classes of mobile application #$oc types, Read Only and Modifiable Read. Messa*in* B#oc t%pes (mB#oc t%pes) Messaging #$oc types are used by CRM Server applications. !hese #$oc types are mapped to synchroni*ation #$oc types through adapters that are processed in the CRM Server. !heir segment structure is not mapped to database tables. !hese #$oc types do not have any parameters, &oins, and where clauses.

Contents o! B#oc Messa*es

#$oc messages are based on #$oc types. A #$oc message contains header, body, receiver and error information as e+plained below( !he header contains data such as the globally uni-ue #$oc message '$, #$oc sender, send time, and #$oc type, which identifies the data segment structure. !he body contains a hierarchical data structure holding business information. #$oc messages e+changed between the CRM Server and mobile clients are based on synchroni*ation #$oc types. Synchroni*ation #$oc types contain data segments mapped to table fields that ma e up the corresponding business ob&ect type.

#$oc messages e+changed between the CRM Server and SAP and non)SAP applications are based on messaging #$oc types. !hese #$oc types contain a hierarchical segment structure "the classical part% and an e+tension created in the $ata $ictionary that holds business data. !he hierarchical segment structure may contain a selection of the fields of the e+tension for receiver determination, which allows the filter criteria to be specified for these fields in replication modeling. Provides the details of the receivers of a message, such as receiver site name, site '$, and site type. Provides the details of errors, such as date, time, and type of error, message te+t, message class, and message number.

!he following figures outline the structure of the two inds of messages mentioned. Messa*e +xc&an*ed Between t&e CRM Server and Mobile Clients

Messa*e +xc&an*ed Between t&e CRM Server and SAP and non,SAP applications

-eneral problems !aced wit& B#ocs

$ue to the nature of the messaging architecture #$ocs which are none other than structured messages -uite often get stuc in the message flow. !here are certain chec points in the CRM system where the messages which fail to attain their normal flow gets accumulated. !he -R.C architecture of CRM has the advantage of storing messages in different places within the system rather than loosing them in transit. !he inbound & outbound -ueues of the CRM system are often fait for lot of incoming & outgoing messages. !his is one problem the Middleware person often faces. /ormally if the messages end up in the inbound -ueue of CRM there are general problems with the 0M1 pac et i.e. the data inside the pac et is often corrupted. Otherwise they can fail because of the module responsible for pic ing up the data from the inbound -ueue failed at a very early stage because of some ma&or Master data validation issue. Messages stuc in the outbound -ueue often signify a failure in the receiving system2s receiver module which is supposed to e+tract the messages. 3+ample of such module will be 4Contrans5 used by mobile systems to synchroni*e data between the two systems. $ata while going to systems li e R67, #8 and APO can also get stuc in the outbound -ueue because of the non) availability of those systems. #ut these problems happen not so often & generally loo ed after by the basis team of the pro&ect. Once progressed further #$ocs "S#$OC6M#$OC% fail further, generally because of data inconsistency between various systems. 9ere CRM2s uni-ue architecture plays important role. :nli e R67 CRM has two databases. CRM online database & consolidated database. #$ocs often fail at a later stage because of inconsistencies between these two databases. 3.g. 8hen a #$oc is trying to update a record in any of these databases and the record e+ists in one but not the other cases the #$OC to fail. #$ocs failing at a later stage can be found in the system by going to Middleware,.Monitorin*,.Messa*e Flow,.#ispla% B#"C Messa*es from the SAP standard SAP Menu "$ransaction , SM/01%. Another reason for failure can be because of Master data inconsistency between CRM & R67 system. !here can be various other reasons ma ing the analysis of the failure tougher & tougher. !he ob&ective of this document will be to establish a general procedure for analy*ing #$OC related issues in CRM Middleware. 8e will try to focus on a generali*ed approach for solving any #$oc related issues rather than targeting individual #$ocs flowing across the system. .rom past e+perience it has been found that #$ocs meant for a particular purpose "e.g. Sales order related S#$ocs% often results in a failure because of various reasons. And the resolution also varies depending upon situation. 9ence the analysis becomes much crucial & concluding issues cannot be generali*ed for a particular #$OC.

+stablis&in* an approac& to solve B#"C issues

As discussed earlier we can further discuss the resolution process in two categories. #$ocs failing at the ;ueue level "'nbound6Outbound% & #$ocs failing at a 1ater stage "!ransaction )SM8<=%.

B#ocs !ailin* at t&e 2ueue level ( nbound3"utbound)

nbound $ransaction SM24


!he #$oc message in 0M1 format itself is corrupted !he processing module responsible for pic ing up any inbound message fails at an very early stage because of corrupted data 1oc ing mechanism applied by the CRM system itself at its various ob&ect levels.

#$ocs normally fail at the inbound -ueue level in the following circumstances(

/ow let2s see how we can conclude the above said errors after systematic analysis( >o to the CRM inbound -ueue. "SAP $ransaction )SM24%.

Specify the -ueue name in which you are encountering some issues or press .? to see all the -ueues. $ouble clic on the relevant -ueue. !he field status gives you the current status of the -ueue. Most worrying is 4S@S.A'15. !he other most common occurrence is 4CP'C3RR5. !he field source id. will inform you from where this particular message have reached the CRM system. $ouble clic on the -ueue name to loo at the details of the particular -ueue. $ouble clic ing the ;ueue /ame field will show you the message in the 0M1 format. !he most relevant field will be 4Status !e+t5. Most of the times it is descriptive enough to give you the e+act error. Some times it may redirect you to SM8<=. 'f it does so u ca get a more descriptive error messages in SM8<= which we have discussed in detail in the later sections of the document. 'f both of the above said steps do not lead to identification of the actual problem A the last & final option "not recommended% is to clic on the individual message which has an erroneous status te+t associated with it & press the debug button.

Please refer to the following screen shot( 't has been seen that sometimes once we resolve the problematic message all the other messages gets processed automatically, that is lot of genuine messages can get stuc because of a problematic message.

"utbound $ransaction SM21

#$oc messages stuc in outbound -ueues are often because of the failure or non availability of the receiving system. !here is hardly somebody can act on this case. Rather that is the architecture of -R.C or asynchronous communication between two systems. >enerally no action is e+pected from a normal CRM consultant for messages stuc outbound -ueue & rather to be referred to #asis team of the organi*ation. in the

B#ocs !ailin* at a 5ater sta*e ($ransaction ,SM/01) ,

!he ma&ority of the problems are faced in this stage. 'f you have followed carefully the s#$oc & the m#$oc flow specified earlier you may have seen, once the component of the CRM system responsible of pic ing up messages from the inbound -ueue A pic s up a #$oc message & passes through various steps before reaching its final target destination. And in between these steps a #$oc can fail because of various reasons including master & transaction data. !he last but no least concern will be CRM system having more than one database to be updated by any messaging structure li e a #$oc. 1et2s try to establish a common process to solve these issues. ' am sure once some body gathers more & more e+perience solving this ind of issues we can try to start randomly at any of these stages. !ill then we will try to follow a common protocol for the problem. 8e will start with Middleware ,. Monitorin* ,. Messa*e !low ,.#ispla% B#oc messa*es

8e can find in many ways the erroneous #$OC, i.e. can use the short name of the #$oc, search with message id or use the #$oc state and .low conte+t to search for the erroneous #$oc.

After setting the desired filter criteria pressing the .? button will get u the list of erroneous #$ocs.

.irst the errors button should return you the e+act error message. Most of the times this is descriptive enough giving you the reason of the problem. Please try to analy*e it carefully. Most of the master & transactional data inconsistencies are clearly displayed in the error message. 9ere you may want to compare the data of the #$oc with the relevant R67 system or CRM system. Also refer to the long te+t button at the right most side of the screen shown below.

@ou may find some custom error message out here A which ' thin ma es your life simpler. #ecause you may soon find the particular message no in the message editor and by using the 1ongte+t you can find in which program, user e+it or function module you have implemented in the error message. And then you now very well why the #$oc have failed. 'n case it is not a custom error message you can still try to simulate the error by trying to reprocess the #$oc & debug till you get the error message. Also in the 3rrors window as displayed below it gives you in which standard class or implementation the #$oc has failed. #ut ' will only suggest as the last & very last option. !he error description is most of the times more than sufficient.

@ou can loo at the #$OC body at this stage by using the Classic $ata functionality. !his really displays the complete #$oc with its segments. After clic ing on Classic data further clic on the Single 3ntry button to have a better loo of the complete #$oc. .rom there you have to figure out the root & the child segments which are carrying data. !he root segment will always carry = record & the child segments will carry = or more than one record.

Clic on the grid icon after the number of entries, & it will show you the e+act data. Out of the first few fields the tas field is very important. !he possible values are =) :pdate B) 'nsert 7) $elete 'n case of m#$oc s this value sometimes vary between =,B & 7 and the first character of 'nsert, :pdate or $elete. i.e. ' : $.

Scroll right to the same screen. !here you may find the field "b6ect # for sB#ocs which are often the S.A ey "7B characters% for the corresponding table. "you can try

to analy*e the #$oc table relationship from the transaction SB#M%. 'n case of m#$ocs you should possibly find a logical name for the guid field. 3.g. #PAR!/3R>:'$ for #:PACMA'/. !his will allow you to chec the relevant data in C$#, Online and also in R67 & MSA if re-uired. 'f there are transactional data inconsistencies this often helps in focusing upon the error. 'f the 3rror Messages does not help the ne+t step will be to try to analy*e the Middleware !race"!ransaction A Middleware !race%. Clic the button Middleware !race & CRM the system will tell you that which steps of the flow conte+t was successful & which steps were not. !a e time to analy*e the same. .low conte+t of any #$oc refers to the flow pattern of a #$oc inside the CRM system & at various levels what the #$oc is supposed to do to the CRM system. ' will e+plain that in the ne+t steps A first let2s have a loo into the Middleware trace.

'f u really want to understand the flow conte+t of the erroneous #$oc we will go to Middleware )DMessage .low)D$isplay and Chec .low $ef.

Provide the #$oc name to be analy*ed & press .?. !he resulting list calls for special understanding where u will find the steps this particular #$oc is

supposed to perform. At each step the activity of the #$oc is captured in the form of a function module. !he relevance of this understanding will be A in the Middleware trace you see at a particular step the system is bac ing up because of some errors. .rom the above mentioned step you now the function module name which has to be debugged if absolutely necessary & there are no other options.

'n E<F of the cases the above said steps should solve the #$oc related problems one face. 't has to be noticed that so far we have not really segregated the #$oc types for describing the approach.. !o e+plain if you have an m#$oc & in transaction SM8<= by pressing the Reprocess button often solves the problem. .or e+ample if the m#$oc is trying to update a certain table & the table is loc ed by other user or interface then once the loc is released pressing the Reprocess button often will solve the problem. #ut for s#$ocs it is not the same every time. Often you may have to copy a s#$oc in to an interim test #$oc & then try to reprocess6debug to get a hold of the issue. .or that we have to go to the transaction SM8=E "Copy message for test purposes%. !his transaction with the #$oc id copies the e+isting #$oc into a #$oc of unprocessed state. !his is often useful when the #$ocs are in status 4Re&ected successfully5 or .<=. 'n this transaction other than providing the #$oc Message '$ u also need to put 4'<=5 in #$oc State & 4S'=5 as flow conte+t.

!his will copy the erroneous s#$oc into a s#$oc with the status as 4Received5 "/ote the traffic light & and the #$oc '$ of the copied #$oc.

/ow if you try to reprocess & then debug you can very well find the root cause of the error.

Middleware Monitorin* $able wit& S%mptoms and #ia*nosis $able S%mptom ;ueue errors /OS3/$ -ueues Source 3#estination s%stems PRG6R.C SAP $ransactions SM;= #ia*nosis Activate the -ueues or delete = entry in the -ueue and activate the others Remar;s3 Comments 8e need to activate the -ueues with the help of !AM team

Below Activit% need to be done b% FAM CRM $eam +!!ort: 7 to 8 9ours Approximatel% in a #a% Fre:uenc% #ail% $code SM/P Monitorin* Coc;pit Monitorin* < Anal%sis and trouble s&ootin* o! all t&e middle ware ob6ect !or entire s%stem is done &er . $code SM/01 #ispla% Bdoc Monitorin* < anal%sis and trouble s&ootin* o! all t&e business document is done &ere !or. $code SM/04A +rror Anal%sis Monitorin* < anal%sis and trouble s&ootin* o! all t&e error business document is done &ere $code SM2R 2RFC Monitor Re*istraion and de,re*istration o! t&e :ue and monitorin* o! nbound RFC :ue is done &ere. $code SM2S 2,"ut Sc&eduler Re*istraion and de,re*istration o! t&e :ue and monitorin* o! t&e "utboud RFC :ue is done &ere. $code R7AS, nitial download nitial laod o! all customi'in* < condition and business adaptor ob6ect between SAP Bac;end and CRM sever is done &ere. $code R7AM1 Monitor "b6ect Monitorin* all t&e load !or customi'in* < condition and business adaptor ob6ects based on t&e status e* /aitin* < Runnin* < Abort and done between SAP Bac;end and CRM server. $code R7AC1, Business "b6ect

Monitor and c&ec; all available Business adaptor "b6ect $code R7AC=, Condition "b6ect Monitor and c&ec; all available Condition adaptor "b6ect. $code R7AC7 , Customi'in* "b6ect. Monitor and c&ec; all available customi'in* adaptor "b6ect. $Code R7AR4, Re:uest 9eader Create t&e Re:uest !or activatin* or deactivatin* t&e "b6ect. $Code R7AR7, Monitor Re:uest Monitorin* t&e re:uest ob6ect based on t&e status e* /aitin* < Runnin* < Abort and done $Code SM"+AC Admin Consol $&is is administration consol !or Monitorin* and Mana*in* "b6ect t%pe li;e site< Subscriptions< Publication < Replication ob6ect< "r*ani'ation ob6ect . $code , SM/7F#C>S$, Customer Speci!ic Flow. Monitorin* and maintenance !or customer speci!ic !low is done &ere. $code ,B#?7 doc Monitorin* Monitorin*< +rrorAnal%sis < nvesti*ation < Reprocessin* o! all t&e #oc done &ere. $code SM=@ RFC destination con!i*uration C&ec;. Monitorin*< Maintenance< Creation o! 9$$P connection !or external servers or Abap s%stem is done &ere. $code S$44 Abap run time error Monitorin* and Run time anal%sis o! all t&e s%stem s&ort dump done &ere. $code SM41 5o* Anal%sis Monitorin* and Run time anal%sis o! all t&e s%stem lo* done &ere. $code , CRMA FBC1 Assi*n site and bdoc t%pe to inter!ace t%pe. Monitorin* o! all t&e Assi*ned Site and Bdoc t%pe to nter!ace is done &ere. $able SM"FPARSFA Middle ware parameter Monitorin* and maintenance o! all t&e middle wear parameter. $able SM"F$AB5+S #e!ination o! $able !or download Monitorin* and de!inition o! t&e table !or #ownlaod is done &ere.

$able SM"FRFCPAR $able !or de!inin* t&e RFC #estination. Monitorin* and de!inin* RFC destination based on parameter done &ere. $able CCPARAM+$+RS Parameter $able. Monitorin* and maintenance o! Parameter !or Middle wear searc& ob6ect Report , RS+">$00 #ata trans!er to R$5 Monitorin* o! report w&ic& trans!er t&e idoc o! all t&e middle ware ob6ect to 5e*ac% s%stem is done &ere.

Вам также может понравиться