Skip to Content

Having the hands on for sending messages through ccBPM is not sufficient in the XI implementation projects. We need to really understand the way the ccBPM works for trouble shooting various problems encountered using it.

Let me share one of my experiences here. In our current XI project we are collecting the messages in the ccBPM based on the correlation FILE_TYPE for Idocs using dead line branch for 2 min. During unit testing phase we have tested the scenario by triggering few messages from WE19 editor and found out that files are created properly.

The problem started when we triggered 500 Idoc’s in the actual testing phase and files are not created properly with all the Idoc data. Messages are shown in the SXMB_MONI transaction but the files are not populated correctly.

We raised a call to SAP and got few confusing notes for implementing them, as it is a known problem. It just solved the problem partially. I found out that there is one more note, which needs to be implemented.

Problem:

Firstly let me explain the reason behind this weird behaviour of ccBPM’s.
500 messages are sent to XI and IE pipeline places them in the ccBPM queue after required adapter conversions are done. ccBPM process instance is created when the BPM receives the first message and then it initiates the workflow events.
After 2 min, the deadline monitoring throws a time out exception and the process instance executes the steps after the dead line branch but the process is still active in the memory and it collects the messages with the same correlation. Messages are received but not processed by the ccBPM as the time-out exception has already happened which results the messages in the parked status. This is the rational behind the missing messages.

Solution:

You can check the missing messages that are sent to the process instance but not processed using the sample report. Find the sample code below.

REPORT  ZRSWF_XI_UNPROCESSED_MSGS.

***********************************************************************

  • types

***********************************************************************

TYPE-POOLS swfco.

TYPES: BEGIN OF ty_msg_wi_id,

        instid TYPE sxmsmguid,

        wi_id  TYPE sww_wiid,

       END OF ty_msg_wi_id.

TYPES: tty_msg_wi_id TYPE TABLE OF ty_msg_wi_id.

***********************************************************************

  • parameters

***********************************************************************

PARAMETERS: p_sdatum TYPE sydatum DEFAULT sy-datum OBLIGATORY.

PARAMETERS: p_edatum TYPE sydatum DEFAULT sy-datum OBLIGATORY.

PARAMETERS: p_by_msg TYPE xflag AS CHECKBOX.

PARAMETERS: p_by_prc TYPE xflag AS CHECKBOX.

PARAMETERS: p_by_mpp TYPE xflag DEFAULT ‘X’ AS CHECKBOX.

PARAMETERS: p_lines  TYPE i DEFAULT 200.

***********************************************************************

  • local data

***********************************************************************

DATA: lt_sww_events TYPE TABLE OF sww_events.

DATA: lt_swwloghist TYPE TABLE OF swwloghist.

DATA: lt_wiids      TYPE swwtwiid.

DATA: lt_messages   TYPE sxmsmguidt.

DATA: l_stimestamp  TYPE timestamp.

DATA: l_etimestamp  TYPE timestamp.

DATA: l_sdatum      TYPE sydatum.

DATA: l_edatum      TYPE sydatum.

DATA: l_zonlo       TYPE systzonlo.

DATA: l_sysuser     TYPE syuname.

DATA: lt_msg_per_process TYPE tty_msg_wi_id.

DATA: l_msg_in_process   TYPE ty_msg_wi_id.

FIELD-SYMBOLS  TYPE swwloghist.

***********************************************************************

***********************************************************************

  • convert user date to timestamp range based on UTC

CONVERT DATE p_sdatum TIME ‘000000’ INTO TIME STAMP l_stimestamp TIME

ZONE sy-zonlo.

CONVERT DATE p_edatum TIME ‘235959’ INTO TIME STAMP l_etimestamp TIME

ZONE sy-zonlo.

  • get parked events

SELECT wi_id typeid instid FROM sww_events

  APPENDING CORRESPONDING FIELDS OF TABLE lt_sww_events

  WHERE

    catid = swfco_objtype_xc AND

    event = ‘RECEIVED’ AND

    crt_time BETWEEN l_stimestamp AND l_etimestamp AND

    status = ’01’.

LOOP AT lt_sww_events ASSIGNING  TO l_msg_in_process.

  APPEND l_msg_in_process-wi_id TO lt_wiids.

  APPEND l_msg_in_process-instid TO lt_messages.

  APPEND l_msg_in_process TO lt_msg_per_process.

ENDLOOP.

  • convert UTC timestamp to RFC users timezone date

l_sysuser = cl_swf_run_workflow_properties=>get_rfc_destination_user( ).

l_zonlo = cl_swf_utl_user_services=>get_zonlo( im_user = l_sysuser ).

CONVERT TIME STAMP l_stimestamp TIME ZONE l_zonlo INTO DATE l_sdatum.

CONVERT TIME STAMP l_etimestamp TIME ZONE l_zonlo INTO DATE l_edatum.

  • get loghist entries

SELECT wi_id variable3 FROM swwloghist

  APPENDING CORRESPONDING FIELDS OF TABLE lt_swwloghist

  WHERE

    method    = ‘CL_SWF_RUN_HANDLER_EVT_RECEIVE’ AND

    workarea  = ‘SWF_RUN’ AND

    message   = ‘551’ AND

    variable1 = ‘RECEIVED’ AND

    meth_edate BETWEEN l_sdatum AND l_edatum.

LOOP AT lt_swwloghist ASSIGNING -variable3.

  APPEND l_msg_in_process-wi_id TO lt_wiids.

  APPEND l_msg_in_process-instid TO lt_messages.

  APPEND l_msg_in_process TO lt_msg_per_process.

ENDLOOP.

SORT lt_wiids.

SORT lt_messages.

SORT lt_msg_per_process BY wi_id instid.

DELETE ADJACENT DUPLICATES FROM lt_wiids.

DELETE ADJACENT DUPLICATES FROM lt_messages.

DELETE ADJACENT DUPLICATES FROM lt_msg_per_process.

IF p_by_msg IS NOT INITIAL.

  PERFORM show_messages USING lt_messages.

ENDIF.

IF p_by_prc IS NOT INITIAL.

  PERFORM show_processes USING lt_wiids.

ENDIF.

IF p_by_mpp IS NOT INITIAL.

  PERFORM show_message_per_process USING lt_msg_per_process.

ENDIF.

&—-


*&      Form  show_message_per_process

&—-


  •       text

—-


  •      –>MSGS_PER_PROCESS  text

—-


FORM show_message_per_process USING msgs_per_process TYPE tty_msg_wi_id.

  FIELD-SYMBOLS -instid.

    NEW-LINE.

  ENDLOOP.

ENDFORM.                    “show_message_per_process

&—-


*&      Form  show_processes

&—-


  •       text

—-


  •      –>PROCESSES  text

—-


FORM show_processes USING processes TYPE swwtwiid.

  DATA: lt_swi_params TYPE TABLE OF rsparams,

        l_swi_param   TYPE rsparams.

  FIELD-SYMBOLS .

    l_swi_param-sign = ‘I’.

    l_swi_param-option = ‘EQ’.

    APPEND l_swi_param TO lt_swi_params.

  ENDLOOP.

  SUBMIT rswiwils

       WITH SELECTION-TABLE lt_swi_params

       AND RETURN.

ENDFORM.                    “show_processes

&—-


*&      Form  show_messages

&—-


  •       text

—-


  •      –>MESSAGES   text

—-


FORM show_messages USING messages TYPE sxmsmguidt.

  DATA: lt_xmb_params TYPE TABLE OF rsparams,

        l_xmb_param   TYPE rsparams.

  FIELD-SYMBOLS .

    l_xmb_param-sign = ‘I’.

    l_xmb_param-option = ‘EQ’.

    APPEND l_xmb_param TO lt_xmb_params.

  ENDLOOP.

  l_xmb_param-selname = ‘LINES’.

  l_xmb_param-low = p_lines.

  l_xmb_param-sign = ‘I’.

  l_xmb_param-option = ‘EQ’.

  APPEND l_xmb_param TO lt_xmb_params.

  •        l_xmb_param-selname = ‘PID’.

  •        l_xmb_param-low = ‘PE_ADAPTER’.

  •        l_xmb_param-sign = ‘I’.

  •        l_xmb_param-option = ‘EQ’.

  •        APPEND l_xmb_param TO lt_xmb_params.

  SUBMIT rsxmb_select_messages

       WITH SELECTION-TABLE lt_xmb_params

       AND RETURN.

ENDFORM.                 “show_messages

Snapshot given below shows the parameters for executing the report to find the missing messages since 1 month.

Parked Messages-Report

This report will display the missing messages that are not processed but just received by the receive step of ccBPM in the ALV list.

To solute the problem,firstly we need to apply note 898131. Before applying the note make sure all the process instances displayed in the output of the above report are deleted using SWWL transaction.
It ensures that the process instance will no longer park the messages instead it throws an exception using FM SWF_XI_MSG_RAISE_EVENT that process instance has no active wait step whenever dead lock arises.

We can test this by triggering 500 Idocs from WE19 editor and see the status SYSFAIL in the SMQ2 as shown below.

Snapshot

After this we can apply notes 898301, 874080 that will ensure the exception is handled and all the 500 Idocs are properly created in the file. I tested the system by sending 500 Idoc’s and the messages are no more lost.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply