Skip to Content

Summary:

This article demonstrates the customized program to trigger the process chain from a failed step, by reducing the input parameters to be passed to SAP given program – ” RSPC_PROCESS_FINISH“.

It is explained with the help of sample code and the relevant snapshots.

This article is intended for the developers / support staff who would monitor process chains on a daily basis and are involved in firefighting..

Table of Contents:


Triggering Further Step in a failed Process Chain – A simple way

At any given time, there will be several process chains running in a production system. During the execution of these process chains, some of the process variants may fail due to various reasons. Sometimes even the “Repeat” Option will not be available. However, we require correcting these process variants and triggering the chain ahead from next step so that the execution of chain is completed.

Most of us would have come across this situation many times in our BW career. While triggering the further process of a failed step it becomes difficult to gather all 6 input parameters prior executing the sap given ABAP report -RSPC_PROCESS_FINISH. It becomes a time consuming task as well.

A similar situation had occurred recently which prompted us to look for an easier and simple solution. The solution of course is available as a part of the existing ABAP Report – RSPC_PROCESSS_FINISH.

Before we see the easier approach, let’s take a look at the conventional approach that is being followed;

Conventional Approach

Traditionally, to trigger the further step in a failed process chain, we will have to execute SAP Given program “RSPC_PROCESS_FINISH” and provide 6 parameters collected from various means: (variant / instance from failed step and remaining 5 from RSPCPROCESSLOG table)

Solution Description


As part of our solution, we have developed a custom ABAP program. This program will collect available inputs from RSPCPROCESSLOG and pass to SAP delivered program – RSPC_PROCESS_FINISH. “Variant” and “Instance” are used as input parameters for this program.

Program name

Description

ZBW_RSPC_PROCESS_FINISH

This program is used to manually trigger the failed steps in a process chain.

Source Code of Custom Program:

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

* Author:    Shah Nawaz

* Function:  Resets the status of a process chain step.

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

REPORT zbw_rspc_process_finish.

DATA: logid       TYPE rspc_logid.

DATA: chain       TYPE rspc_chain.

DATA: type        TYPE rspc_type.

DATA: p_vari      TYPE rspc_variant.

DATA: instan      TYPE rspc_instance.

DATA: jobcount    TYPE btcjobcnt.

DATA: batchdat    TYPE btcreldt.

DATA: batchtim    TYPE btcreltm.

DATA: ls_pclog    LIKE rspcprocesslog.

DATA: v_string_1  TYPE string.

DATA: v_string_2  TYPE string.

DATA: v_string_3  TYPE string.

DATA: v_string_4  TYPE string.

DATA: v_string_5  TYPE string.

DATA: v_string_6  TYPE string.

DATA: v_button    TYPE c LENGTH 4.

SELECTION-SCREEN BEGIN OF BLOCK bl0 WITH FRAME.

SELECTION-SCREEN COMMENT /1(79) text-001.

SELECTION-SCREEN COMMENT /1(79) text-002.

SELECTION-SCREEN COMMENT /1(79) text-003.

SELECTION-SCREEN COMMENT /1(79) text-004.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN COMMENT /1(79) text-005.

SELECTION-SCREEN COMMENT /1(79) text-006.

SELECTION-SCREEN END OF BLOCK bl0.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME.

PARAMETERS: dt        RADIOBUTTON GROUP rb_1  USER-COMMAND check DEFAULT ‘X’.

PARAMETERS: id        RADIOBUTTON GROUP rb_1.

PARAMETERS: date      TYPE sy-datum.

PARAMETERS: log_id    TYPE rspc_logid.

PARAMETERS: variant   TYPE rspc_variant.

PARAMETERS: instance  TYPE rspc_instance.

SELECTION-SCREEN END OF BLOCK bl1.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN BEGIN OF BLOCK bl2 WITH FRAME.

PARAMETERS: state AS LISTBOX TYPE rspc_state OBLIGATORY DEFAULT ‘G’ VISIBLE LENGTH 30.

SELECTION-SCREEN END OF BLOCK bl2.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.

    CASE screen-name.

      WHEN ‘DATE’.

        IF id = ‘X’.

          screen-input = ‘0’.

          MODIFY SCREEN.

        ENDIF.

      WHEN ‘LOG_ID’.

        IF dt = ‘X’.

          screen-input = ‘0’.

          MODIFY SCREEN.

        ENDIF.

    ENDCASE.

  ENDLOOP.

START-OF-SELECTION.

  IF dt = ‘X’ AND date IS INITIAL.

    MESSAGE text-019 TYPE ‘I’ DISPLAY LIKE ‘E’.

    RETURN.

  ENDIF.

  IF id = ‘X’ AND log_id IS INITIAL.

    MESSAGE text-020 TYPE ‘I’ DISPLAY LIKE ‘E’.

    RETURN.

  ENDIF.

  IF variant IS INITIAL.

    MESSAGE text-021 TYPE ‘I’ DISPLAY LIKE ‘E’.

    RETURN.

  ENDIF.

  IF dt = ‘X’.

    SELECT SINGLE *

    FROM rspcprocesslog

    INTO ls_pclog

    WHERE variante  = variant

    AND   instance  = instance

    AND   batchdate = date.

  ENDIF.

  IF id = ‘X’.

    SELECT SINGLE *

    FROM rspcprocesslog

    INTO ls_pclog

    WHERE log_id    = log_id

    AND   variante  = variant

    AND   instance  = instance.

  ENDIF.

  IF sy-subrc = 0.

    CONCATENATE text-007 ls_pclog-log_id     INTO v_string_1 SEPARATED BY space.

    CONCATENATE text-008 ls_pclog-type       INTO v_string_2 SEPARATED BY space.

    CONCATENATE text-009 ls_pclog-variante   INTO v_string_3 SEPARATED BY space.

    CONCATENATE text-010 ls_pclog-instance   INTO v_string_4 SEPARATED BY space.

    CONCATENATE text-011 ls_pclog-state      INTO v_string_5 SEPARATED BY space.

    CONCATENATE text-012 ls_pclog-batchdate  INTO v_string_6 SEPARATED BY space.

    CALL FUNCTION ‘POPUP_FOR_INTERACTION’

      EXPORTING

        headline       = text-013

        text1          = v_string_1

        text2          = v_string_2

        text3          = v_string_3

        text4          = v_string_4

        text5          = v_string_5

        text6          = v_string_6

        ticon          = ‘Q’

        button_1       = text-014

        button_2       = text-015

      IMPORTING

        button_pressed = v_button.

    IF v_button CA ‘1’.

      CALL FUNCTION ‘RSPC_PROCESS_FINISH’

        EXPORTING

          i_logid       = ls_pclog-log_id

          i_type        = ls_pclog-type

          i_variant     = ls_pclog-variante

          i_instance    = ls_pclog-instance

          i_state       = state

          i_batchdate   = ls_pclog-batchdate

        EXCEPTIONS

          error_message = 1.

      IF sy-subrc <> 0.

        MESSAGE ID sy-msgid TYPE ‘I’ NUMBER sy-msgno

        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

      ELSE.

        MESSAGE text-016 TYPE ‘S’.

      ENDIF.

    ELSE.

      MESSAGE text-017 TYPE ‘S’.

    ENDIF.

  ELSE.

    MESSAGE text-018 TYPE ‘E’.

  ENDIF.

Steps followed to correct the failure(s):

The steps to be followed in the custom way are described below:

Step 1 : The failed process chain in a scenario looked like below. Capture the log id markedZBWRSPC_s1.png

Step 2 : Right click on the failed step and capture variant and instance (as shown below)

     ZBWRSPC_s2.png

Step 3 : Go to SE38 transaction and enter “ZBW_RSPC_PROCESS_FINISH”. Click on “Execute(F8)”

     ZBWRSPC_s3.2.png

Step 4 : Select “ID” radio button and Enter parameters captured from Step 1 and 2.  Now click on  “Execute(F8)”    

          ZBWRSPC_s4.png    

Step 5 : Now click on continue.

          ZBWRSPC_s5.png

Step 6 : Once the above step is performed, a tick mark appears in the status bar as a confirmation for the successful execution.

          ZBWRSPC_s6.2.png


To report this post you need to login first.

1 Comment

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

  1. Jay Roble

    I know this is from 2011, but still looks useful for BW 7.4

    In you code you have text symbols 001 to 006, but you didn’t list the text to assign to the symbols.

    Thanks

    (0) 

Leave a Reply