Hello experts ,
I am a ABAPer , this struck me when i was receiving loads of XML message from PI ( in ECC ) which had QOS as EO and they were placed in dynamic queues for processing .
Due to dynamic queues 2 Message which had to process same document ( Say a Purchase Req. ) were processed simultaneously . Consequently locking it due to simultaneous operation on same PR i.e. while one was being processed the other xml message got error ‘Document is already being processed by user….’
To avoid this we changed the QOS to EOIO so that the message will be processed one by one in order …after ..which new issue popped up which was that the Message started getting piled up in the dedicated queue which was set up for EOIO Resulting into long waiting queues …so the messages were in scheduled state most of the time / this was case with the message which were potentially good which had to wait without any reason ………..to over come all such problem here is a proposal …..
I have done similar to what The Guarneri has written in his blog
for but for some other handler class hope this helps
Hypothetical Situation :
- You want to have Payload Content Based Serialization for XML message form PI to ECC
(Assume their is nothing much you can do at PI Side )
- When you want to Over ride the Queue name sent by PI in ECC for customized Process Management eg. if you are using QOS as EOIO and have a static Queue name and you want to change it as per your clients business process so as to achieve better system performance by setting dynamic queues for functionally dependent or independent XML pay loads as per desired
- When you want to explicitly SET a Queue at ECC side name with respect to Quality of service / Interface name space / Payload size Or content so on and so forth .
- Business Advantages and necessity of Serialization Of XML message is well known.
- More over for avoiding Problems Like Object/document locking due to parallel processing , Queue Stuck up , Time for processing due to static queue definition for all ‘good’ message waiting in Queue which are likely to get posted without any error such and may be more
- Load balancing of the incoming messages
Your Service is : engine ( Can be checked in SICF Tcode -> Services – >default_host – > sap- > xi-> engine )
Check for handler class for the service ‘engine’ it will be engine CL_XMS_HTTP_HANDLER
Your path will be : /default_host/sap/xi/
Real Time scenario :
Landscape : NON SAP System → PI → ECC System
Interface is simple Purchase Requisition Create and Change Using i.e ( PR present in ECC Change it or else create )
You have set QOS to EOIO with a Static queue name ‘PRCREATECHANGE’ .
Case 1 :
Now say at certain moment of time your queue contains 100 XML message and the queue is processing and suddenly during execution of certain XML message there is a exception , This will block the queue and subsequently all the potentially good message will be in scheduled state Unless one one frees the queue by fishing out the faulty message from the queue and restart the queue again .
Take ideal condition that your queue free flowing but contains 1000 Message in the case the execution is from 1 message to 1000th message the Last message has to wait in the queue un-neccesserly for 999 messages to pass from the queue thus increasing the Scheduled state time of the message which may be was functionally independent of other messages .
Proposed Solution goes like this :
1. Make a ZEE copy of CL_XMS_HTTP_HANDLER say ZZCL_XMS_HTTP_HANDLER
2. In the method IF_HTTP_EXTENSION~HANDLE_REQUEST of class ZZCL_XMS_HTTP_HANDLER line no 577 ( just after call of CALL METHOD lv_xms_main_ref->get_message_properties ) write the code desired using the below hints
- For reference rm ( it stands for Reliable Messaging ) you can use below method
- GET_CDATA Delivers the HTTP body of this entity as character data
i.e. Server->request-> GET_CDATA will give the payload in Character format.
- You can Validate / authenticate / SET / Dissolve on basis of data by writing simple code using above hints . It has many possiblity
Finally What you have to is to set the Newly created zee handler class instead of a standard on the service as mentioned above
So after you have written the code and all is set…
For Cases we have taken : The queue name will be set dynamically by our code say a Reference or say Purchase req. number or say document type so on and so as per your wish forth thus routing the documents/payload to Dynamically set queus avoiding the long waiting queues and locking and scheduled message solving our purpose as explained above .