of 63 /63
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com © 2009 SAP AG 1 Enhanced Decision Process Type for BW Process Chains Applies to: SAP BI 7.0 and above . For more information, visit the Business Intelligence homepage . Summary BW process chains can be made more flexible and intelligent using DECISION process type to evaluate between different alternatives. Since formula is used in this process the decision making capability is very limited. Enhanced decision uses forms instead of formulas and hence more flexible. Author: Hemant Kumar Vyas Company: Infosys Technologies Limited Created on: 01 December 2009 Author Bio Hemant Kumar Vyas has been working for Infosys technologies limited for past 2.5 years and has experience in SAP BI 7.0 implementations.

Enhanced Decision Process Type for BW Process Chains · Enhanced Decision Process Type for BW Process Chains ... Infosys Technologies Limited ... Enhanced Decision process type

  • Author
    doque

  • View
    227

  • Download
    5

Embed Size (px)

Text of Enhanced Decision Process Type for BW Process Chains · Enhanced Decision Process Type for BW...

  • SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG 1

    Enhanced Decision Process Type

    for BW Process Chains

    Applies to:

    SAP BI 7.0 and above . For more information, visit the Business Intelligence homepage.

    Summary

    BW process chains can be made more flexible and intelligent using DECISION process type to evaluate between different alternatives. Since formula is used in this process the decision making capability is very limited. Enhanced decision uses forms instead of formulas and hence more flexible.

    Author: Hemant Kumar Vyas

    Company: Infosys Technologies Limited

    Created on: 01 December 2009

    Author Bio

    Hemant Kumar Vyas has been working for Infosys technologies limited for past 2.5 years and has experience in SAP BI 7.0 implementations.

    https://www.sdn.sap.com/irj/sdn/nw-bi

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 2

    Table of Contents

    Decision process type in BW process chains ..................................................................................................... 3

    Enhanced Decision process type .................................................................................................................... 3 Creation of structures ................................................................................................................................................... 4

    Program ZRSPC_DECISION ....................................................................................................................................... 7

    Class ZCL_RSPC_DECISION ................................................................................................................................... 39

    Adding new process type to process type view .......................................................................................................... 56

    Start using the new process type ............................................................................................................................... 57

    Start using the new process type ............................................................................................................................... 61

    Related Contetns .............................................................................................................................................. 62

    xbiCopyright ...................................................................................................................................................... 62

    Copyright............................................................................................................ Error! Bookmark not defined.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 3

    Decision process type in BW process chains

    A process which is available in general services category in process types can be used to decide intelligently among multiple alternatives. This process type uses formula for the logic and evaluates it at runtime to decide the course of action. Since formula is used the decision making capability is very limited. In this process type following limitations are experienced

    Available fields do not fulfill most common requirements.

    Decision based on certain status of table, on availability of particular file or a complex logic of dates can not be made on basis of formula, or it can become too complex.

    Use of formula imposes restrictions on the information which can be passed across the process chains (by setting global variables or table fields) and to decide whether to take particular action or not.

    Enhanced Decision process type

    Decision process can be enhanced if we are able to remove restrictions imposed by use of formula. These forms are embedded in ABAP programs and as a result of evaluation should return Boolean true or false based on logic.

    Creating a process type requires a class which extends standard interfaces to be used by overall process chain framework. Additionally a maintenance screen is also to be provided by the process type since we can not use the SAP delivered screen. This article will give step by step method to implement class and maintenance program for the process type.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 4

    Creation of structure of decision grid (It specifies the format in which any line of the process will appear)

    Creation of class ZCL_RSPC_DECISION.

    Creation of maintenance program ZRSPC_DECISION.

    Adding this new process type to process views, after which it can be usable in process chain.

    Creation of structures

    o Start transaction SE11

    o Select data type and give the name as ZRSPC_S_DECISION

    Press create and when asked the type, select structure

    Give the field names and component type as shown

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 5

    Save and activate.

    Start transaction SE11

    Select data type and give name as ZRSPC_T_DECISION

    Press create and when asked the type, select table type

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 6

    Give line type as ZRSPC_S_DECISION

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 7

    Program ZRSPC_DECISION

    To save time we will copy the existing function group RSPC_PROCESSES and modify it to suit our needs.

    Start transaction SE38

    Give the program name as SAPLRSPC_PROCESSES.

    Click on copy program button on toolbar or hit CTRL+F5.

    Give the new program name as ZRSPC_DECISION

    When prompted to copy function modules, deselect all.

    After copying the program RSPC_PROCESSES follow the instructions given below. 1. Create include program ZINCLUDE_FORM_DEC. (SE38 program type select Include program). Add

    the following code

    *&---------------------------------------------------------------------*

    *& Include ZINCLUDE_FORM_DEC

    *&---------------------------------------------------------------------*

    *---------------------------------------------------------------------*

    * CLASS lcl_decision_dd DEFINITION

    *---------------------------------------------------------------------*

    *

    *---------------------------------------------------------------------*

    CLASS lcl_decision_dd DEFINITION.

    PUBLIC SECTION.

    DATA: p_s_decision TYPE zrspc_s_decision,

    p_row TYPE lvc_index.

    ENDCLASS. "lcl_decision_dd DEFINITION

    *---------------------------------------------------------------------*

    * CLASS lcl_decision DEFINITION

    *---------------------------------------------------------------------*

    *

    *---------------------------------------------------------------------*

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 8

    CLASS lcl_decision DEFINITION.

    PUBLIC SECTION.

    METHODS:

    handle_double_click

    FOR EVENT double_click

    OF cl_gui_alv_grid

    IMPORTING e_row.

    METHODS:

    on_f4

    FOR EVENT onf4

    OF cl_gui_alv_grid

    IMPORTING e_fieldname

    es_row_no

    er_event_data

    et_bad_cells

    e_display.

    METHODS:

    handle_data_changed

    FOR EVENT data_changed

    OF cl_gui_alv_grid

    IMPORTING er_data_changed

    e_onf4 e_onf4_before e_onf4_after.

    METHODS:

    on_hotspot

    FOR EVENT hotspot_click

    OF cl_gui_alv_grid

    IMPORTING e_row_id.

    METHODS:

    handle_toolbar

    FOR EVENT toolbar

    OF cl_gui_alv_grid

    IMPORTING e_object e_interactive.

    METHODS:

    handle_user_command

    FOR EVENT user_command

    OF cl_gui_alv_grid

    IMPORTING e_ucomm.

    METHODS:

    handle_alv_drag

    FOR EVENT ondrag

    OF cl_gui_alv_grid

    IMPORTING e_row e_column e_dragdropobj,

    handle_alv_drop

    FOR EVENT ondrop

    OF cl_gui_alv_grid

    IMPORTING e_row e_column e_dragdropobj.

    METHODS:

    displaymode_toggle,

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 9

    displaymode_set

    IMPORTING i_display_only TYPE rs_bool.

    PRIVATE SECTION.

    DATA: p_display_only TYPE rs_bool.

    ENDCLASS. "lcl_decision DEFINITION

    *---------------------------------------------------------------------*

    * CLASS lcl_decision IMPLEMENTATION

    *---------------------------------------------------------------------*

    *

    *---------------------------------------------------------------------*

    CLASS lcl_decision IMPLEMENTATION.

    * ======================

    * ==== Display mode ====

    * ======================

    METHOD displaymode_toggle.

    IF p_display_only = 'X'.

    CLEAR p_display_only.

    ELSE.

    p_display_only = 'X'.

    ENDIF.

    ENDMETHOD. "displaymode_toggle

    METHOD displaymode_set.

    p_display_only = i_display_only.

    ENDMETHOD. "displaymode_set

    * ======================

    * ==== Double Click ====

    * ======================

    METHOD handle_double_click.

    ENDMETHOD. "lcl_decision

    * ============

    * ==== F4 ====

    * ============

    METHOD on_f4.

    DATA: l_t_exclude TYPE slis_t_extab,

    l_s_exclude TYPE slis_extab,

    l_t_f4 TYPE TABLE OF rspc_s_eventtext_f4,

    l_s_f4 TYPE rspc_s_eventtext_f4,

    l_s_selected TYPE slis_selfield,

    l_exit TYPE rs_bool,

    l_t_decision TYPE zrspc_t_decision,

    l_s_decision TYPE zrspc_s_decision,

    l_count TYPE i,

    l_max TYPE i.

    DATA: ls_modi TYPE lvc_s_modi.

    CHECK p_display_only IS INITIAL.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 10

    l_t_decision = g_t_decision.

    SORT l_t_decision BY eventno DESCENDING.

    READ TABLE l_t_decision INTO l_s_decision INDEX 1.

    l_max = l_s_decision-eventno + 1.

    l_count = 1.

    WHILE l_count LE l_max.

    l_s_f4-eventcolor = 'G'.

    l_s_f4-eventno = l_count.

    CONCATENATE text-017 l_s_f4-eventno

    INTO l_s_f4-eventtext

    SEPARATED BY space.

    CALL FUNCTION 'RSPC_GET_EVENT_ICON'

    EXPORTING

    i_eventno = l_s_f4-eventno

    IMPORTING

    e_icon = l_s_f4-eventicon.

    APPEND l_s_f4 TO l_t_f4.

    ADD 1 TO l_count.

    ENDWHILE.

    l_s_f4-eventcolor = 'R'.

    CLEAR l_s_f4-eventno.

    l_s_f4-eventtext = text-016.

    l_s_f4-eventicon = '@[email protected]'.

    APPEND l_s_f4 TO l_t_f4.

    l_s_exclude-fcode = '&OL0'.

    APPEND l_s_exclude TO l_t_exclude.

    CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'

    EXPORTING

    i_title = text-027

    i_tabname = 'L_T_F4'

    i_structure_name = 'RSPC_S_EVENTTEXT_F4'

    i_screen_start_column = 60

    i_screen_start_line = 10

    i_screen_end_column = 80

    i_screen_end_line = 18

    it_excluding = l_t_exclude

    IMPORTING

    es_selfield = l_s_selected

    e_exit = l_exit

    TABLES

    t_outtab = l_t_f4

    EXCEPTIONS

    program_error = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    ENDIF.

    IF l_exit = rs_c_true.

    MESSAGE ID 'RSM' TYPE 'S' NUMBER '213'.

    ENDIF.

    IF NOT l_s_selected IS INITIAL.

    READ TABLE l_t_f4 INTO l_s_f4

    INDEX l_s_selected-tabindex.

    READ TABLE g_t_decision INTO l_s_decision INDEX es_row_no-row_id.

    MOVE-CORRESPONDING l_s_f4 TO l_s_decision.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 11

    MODIFY g_t_decision FROM l_s_decision INDEX es_row_no-row_id.

    ENDIF.

    CALL METHOD g_decision_grid->refresh_table_display

    EXCEPTIONS

    finished = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    ENDIF.

    er_event_data->m_event_handled = 'X'.

    ENDMETHOD. "lcl_decision

    * ======================

    * ==== Data Changed ====

    * ======================

    METHOD handle_data_changed.

    ENDMETHOD. "lcl_decision

    * =================

    * ==== Hotspot ====

    * =================

    METHOD on_hotspot.

    DATA: l_s_decision TYPE zrspc_s_decision,

    l_t_fields TYPE rsfob_t_fields,

    l_s_fields TYPE rsfob_s_fields,

    l_mode TYPE rsfob_mode,

    l_txtlg TYPE rstxtlg,

    l_t_formex TYPE rsfob_t_formex,

    l_answer TYPE c,

    operation(4) TYPE C.

    clear: l_uniqueid, onhp_l_t_repid, onhp_e_repid ,onhp_code, onhp_lt_code.

    READ TABLE g_t_decision INTO l_s_decision INDEX e_row_id.

    IF l_s_decision-button IS INITIAL.

    EXIT.

    ENDIF.

    * IF NOT g_r_formulas IS BOUND.

    * CREATE OBJECT g_r_formulas.

    * ENDIF.

    IF l_s_decision-button = '@[email protected]'.

    CHECK p_display_only IS INITIAL.

    * ==== Delete Formula ====

    APPEND l_s_decision-form TO onhp_l_t_repid.

    IF NOT onhp_l_t_repid IS INITIAL.

    CALL FUNCTION 'POPUP_TO_CONFIRM'

    EXPORTING

    titlebar = text-032

    text_question = text-031

    default_button = '2'

    display_cancel_button = ' '

    popup_type = 'ICON_MESSAGE_WARNING'

    IMPORTING

    answer = l_answer

    EXCEPTIONS

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 12

    text_not_found = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    ENDIF.

    IF l_answer = '1'.

    loop at onhp_l_t_repid into onhp_e_repid.

    delete report onhp_e_repid.

    endloop.

    CLEAR l_s_decision-form.

    ENDIF.

    ENDIF.

    ELSE.

    * ==== Form ====

    zcl_rspc_decision=>p_variant = g_variant.

    IF l_s_decision-form IS INITIAL.

    l_mode = 1.

    operation = 'ADD '.

    ELSE.

    IF p_display_only = 'X'.

    l_mode = 3.

    operation = 'SHOW'.

    ELSE.

    l_mode = 2.

    operation = 'ADD '.

    ENDIF.

    ENDIF.

    l_txtlg = l_s_decision-description.

    if l_mode = 1. "form does not exist create a new form

    CALL FUNCTION 'RSS_SYSTEM_GET_UNIQUE_ID' "get unique id

    IMPORTING

    e_uni_idc25 = l_uniqueid

    EXCEPTIONS

    OTHERS = 1.

    IF sy-subrc 0.

    EXIT.

    ENDIF.

    l_uniqueid+0(1) = 'Z'.

    concatenate 'report' l_uniqueid '.' into onhp_code separated by space.

    append onhp_code to onhp_lt_code.

    clear onhp_code.

    onhp_code = 'form evaluate changing p_return type bool. "should return

    boolean value'.

    append onhp_code to onhp_lt_code.

    clear onhp_code.

    onhp_code = 'endform.'.

    append onhp_code to onhp_lt_code.

    insert report l_uniqueid from onhp_lt_code.

    else.

    l_uniqueid = l_s_decision-form.

    endif.

    CALL FUNCTION 'RS_TOOL_ACCESS'

    EXPORTING

    OPERATION = 'SHOW'

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 13

    OBJECT_NAME = 'evaluate'

    OBJECT_TYPE = 'PROG_FORM'

    ENCLOSING_OBJECT = l_uniqueid

    * TABLES

    * OBJLIST = fu_objlist

    EXCEPTIONS

    NOT_EXECUTED = 1

    INVALID_OBJECT_TYPE = 2

    OTHERS = 3.

    IF SY-SUBRC 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    if l_mode = 1. "new form is created

    l_s_decision-form = l_uniqueid.

    endif.

    ENDIF.

    * ==== Refresh table and display ====

    MODIFY g_t_decision FROM l_s_decision INDEX e_row_id.

    PERFORM decision_fill_lines

    CHANGING

    g_t_decision.

    CALL METHOD g_decision_grid->refresh_table_display

    EXCEPTIONS

    finished = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    ENDIF.

    ENDMETHOD. "lcl_decision

    * =======================

    * ==== Build Toolbar ====

    * =======================

    METHOD handle_toolbar.

    DATA: ls_toolbar TYPE stb_button.

    CLEAR ls_toolbar.

    MOVE 'APPEND' TO ls_toolbar-function.

    MOVE icon_create TO ls_toolbar-icon.

    MOVE text-023 TO ls_toolbar-quickinfo.

    * MOVE text-023 TO ls_toolbar-text.

    MOVE ' ' TO ls_toolbar-disabled.

    APPEND ls_toolbar TO e_object->mt_toolbar.

    CLEAR ls_toolbar.

    MOVE 'INSERT' TO ls_toolbar-function.

    MOVE icon_insert_row TO ls_toolbar-icon.

    MOVE text-024 TO ls_toolbar-quickinfo.

    * MOVE text-024 TO ls_toolbar-text.

    MOVE ' ' TO ls_toolbar-disabled.

    APPEND ls_toolbar TO e_object->mt_toolbar.

    CLEAR ls_toolbar.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 14

    MOVE 'DELETE' TO ls_toolbar-function.

    MOVE icon_delete_row TO ls_toolbar-icon.

    MOVE text-025 TO ls_toolbar-quickinfo.

    * MOVE text-025 TO ls_toolbar-text.

    MOVE ' ' TO ls_toolbar-disabled.

    APPEND ls_toolbar TO e_object->mt_toolbar.

    CLEAR ls_toolbar.

    MOVE 3 TO ls_toolbar-butn_type.

    APPEND ls_toolbar TO e_object->mt_toolbar.

    CLEAR ls_toolbar.

    MOVE 'UP' TO ls_toolbar-function.

    MOVE icon_next_value TO ls_toolbar-icon.

    MOVE text-028 TO ls_toolbar-quickinfo.

    * MOVE text-025 TO ls_toolbar-text.

    MOVE ' ' TO ls_toolbar-disabled.

    APPEND ls_toolbar TO e_object->mt_toolbar.

    CLEAR ls_toolbar.

    MOVE 'DOWN' TO ls_toolbar-function.

    MOVE icon_previous_value TO ls_toolbar-icon.

    MOVE text-029 TO ls_toolbar-quickinfo.

    * MOVE text-025 TO ls_toolbar-text.

    MOVE ' ' TO ls_toolbar-disabled.

    APPEND ls_toolbar TO e_object->mt_toolbar.

    CLEAR ls_toolbar.

    MOVE 3 TO ls_toolbar-butn_type.

    APPEND ls_toolbar TO e_object->mt_toolbar.

    CLEAR ls_toolbar.

    MOVE 'CHECK' TO ls_toolbar-function.

    MOVE icon_check TO ls_toolbar-icon.

    MOVE text-026 TO ls_toolbar-quickinfo.

    * MOVE text-026 TO ls_toolbar-text.

    MOVE ' ' TO ls_toolbar-disabled.

    APPEND ls_toolbar TO e_object->mt_toolbar.

    ENDMETHOD. "lcl_decision

    * ==========================

    * ==== Toolbar selected ====

    * ==========================

    METHOD handle_user_command.

    DATA: l_t_rows TYPE lvc_t_row,

    l_s_rows TYPE lvc_s_row,

    l_t_dec TYPE zrspc_t_decision,

    l_s_dec TYPE zrspc_s_decision,

    l_indx TYPE i,

    l_subrc TYPE sy-subrc.

    CASE e_ucomm.

    WHEN 'APPEND'.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 15

    CHECK p_display_only IS INITIAL.

    * ==== Append line ====

    CALL METHOD cl_gui_cfw=>flush.

    PERFORM decision_standardlines

    USING '' 0 'X'

    CHANGING g_t_decision.

    PERFORM decision_fill_lines

    CHANGING

    g_t_decision.

    CALL METHOD g_decision_grid->refresh_table_display

    EXCEPTIONS

    finished = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    ENDIF.

    WHEN 'INSERT'.

    CHECK p_display_only IS INITIAL.

    * ==== Insert line ====

    CALL METHOD g_decision_grid->get_selected_rows

    IMPORTING

    et_index_rows = l_t_rows.

    CALL METHOD cl_gui_cfw=>flush.

    IF l_t_rows[] IS INITIAL.

    PERFORM decision_standardlines

    USING '' 0 'X'

    CHANGING g_t_decision.

    ELSE.

    SORT l_t_rows BY index ASCENDING.

    READ TABLE l_t_rows INTO l_s_rows INDEX 1.

    PERFORM decision_standardlines

    USING '' l_s_rows-index ''

    CHANGING g_t_decision.

    ENDIF.

    PERFORM decision_fill_lines

    CHANGING

    g_t_decision.

    CALL METHOD g_decision_grid->refresh_table_display

    EXCEPTIONS

    finished = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    ENDIF.

    WHEN 'DELETE'.

    CHECK p_display_only IS INITIAL.

    * ==== Delete line ====

    CALL METHOD g_decision_grid->get_selected_rows

    IMPORTING

    et_index_rows = l_t_rows.

    CALL METHOD cl_gui_cfw=>flush.

    SORT l_t_rows BY index DESCENDING.

    LOOP AT l_t_rows INTO l_s_rows.

    DELETE g_t_decision INDEX l_s_rows-index.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 16

    ENDLOOP.

    PERFORM decision_fill_lines

    CHANGING

    g_t_decision.

    CALL METHOD g_decision_grid->refresh_table_display

    EXCEPTIONS

    finished = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    ENDIF.

    WHEN 'CHECK'.

    * ==== Prfen ====

    PERFORM decision_check CHANGING l_subrc.

    IF l_subrc 0.

    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    ELSE.

    MESSAGE s132(rspc).

    ENDIF.

    WHEN 'UP' OR 'DOWN'.

    CHECK p_display_only IS INITIAL.

    * ==== Verschieben ====

    CALL METHOD g_decision_grid->get_selected_rows

    IMPORTING

    et_index_rows = l_t_rows.

    CALL METHOD cl_gui_cfw=>flush.

    IF e_ucomm = 'UP'.

    * ---- Eins hoch ----

    SORT l_t_rows BY index ASCENDING.

    ELSEIF e_ucomm = 'DOWN'.

    * ---- Eins runter ----

    SORT l_t_rows BY index DESCENDING.

    ENDIF.

    LOOP AT l_t_rows INTO l_s_rows.

    READ TABLE g_t_decision INTO l_s_dec INDEX l_s_rows-index.

    DELETE g_t_decision INDEX l_s_rows-index.

    IF e_ucomm = 'UP'.

    * ---- Eins hoch ----

    l_indx = l_s_rows-index - 1.

    ELSEIF e_ucomm = 'DOWN'.

    * ---- Eins runter ----

    l_indx = l_s_rows-index + 1.

    ENDIF.

    INSERT l_s_dec INTO g_t_decision INDEX l_indx.

    ENDLOOP.

    PERFORM decision_fill_lines

    CHANGING

    g_t_decision.

    CALL METHOD g_decision_grid->refresh_table_display

    EXCEPTIONS

    finished = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 17

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

    ENDIF.

    ENDCASE.

    ENDMETHOD. "lcl_decision

    * ==============

    * ==== Drag ====

    * ==============

    METHOD handle_alv_drag.

    DATA: l_r_dataobj TYPE REF TO lcl_decision_dd.

    CHECK p_display_only IS INITIAL.

    CALL METHOD g_decision_grid->check_changed_data.

    CREATE OBJECT l_r_dataobj.

    MOVE e_row-index TO l_r_dataobj->p_row.

    READ TABLE g_t_decision INDEX e_row-index INTO l_r_dataobj->p_s_decision.

    e_dragdropobj->object = l_r_dataobj.

    ENDMETHOD. "handle_alv_drag

    * ==============

    * ==== Drop ====

    * ==============

    METHOD handle_alv_drop.

    DATA: l_r_dataobj TYPE REF TO lcl_decision_dd,

    drop_index TYPE i,

    ls_sbook TYPE sbook,

    stable TYPE lvc_s_stbl.

    CHECK p_display_only IS INITIAL.

    stable-row = 'X'.

    stable-col = 'X'.

    CATCH SYSTEM-EXCEPTIONS move_cast_error = 1.

    l_r_dataobj ?= e_dragdropobj->object.

    IF e_dragdropobj->effect EQ cl_dragdrop=>copy.

    INSERT l_r_dataobj->p_s_decision INTO g_t_decision INDEX e_row-index.

    ELSE.

    DELETE g_t_decision INDEX l_r_dataobj->p_row.

    INSERT l_r_dataobj->p_s_decision INTO g_t_decision INDEX e_row-index.

    ENDIF.

    PERFORM decision_fill_lines CHANGING g_t_decision.

    CALL METHOD g_decision_grid->refresh_table_display

    EXPORTING

    i_soft_refresh = 'X'

    is_stable = stable.

    ENDCATCH.

    IF sy-subrc 0.

    CALL METHOD e_dragdropobj->abort.

    ENDIF.

    ENDMETHOD. "HANDLE_ALV_DROP

    ENDCLASS. "lcl_decision IMPLEMENTATION

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 18

    2. Start transaction SE80, select FUNCTION GROUP and function group name as ZRSPC_DECISION.

    3. Double click on ZRSPC_DECISION and click on main program on the following screen to display

    main program.

    4. Add following code

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

    * System-defined Include-files. *

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

    INCLUDE LZRSPC_DECISIONTOP. " Global Data

    INCLUDE ZINCLUDE_FORM_DEC.

    INCLUDE LZRSPC_DECISIONUXX. " Function Modules

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

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 19

    * User-defined Include-files (if necessary). *

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

    * INCLUDE LRSPC_PROCESSESF... " Subprograms

    * INCLUDE LRSPC_PROCESSESO... " PBO-Modules

    * INCLUDE LRSPC_PROCESSESI... " PAI-Modules

    INCLUDE LZRSPC_DECISIONO01.

    *INCLUDE LRSPC_PROCESSESO01.

    INCLUDE LZRSPC_DECISIONI01.

    *INCLUDE LRSPC_PROCESSESI01.

    INCLUDE LZRSPC_DECISIONF02.

    *INCLUDE LRSPC_PROCESSESF02.

    5. LZRSPC_DECISIONTOP

    Double click on LZRSPC_DECISIONTOP

    Add following code

    FUNCTION-POOL ZRSPC_DECISION. "MESSAGE-ID ..

    TYPE-POOLS: rs, rsoc.

    DATA: g_variant TYPE rspc_variant,

    g_variant_hlp TYPE rspc_variant,

    g_variant_text TYPE rstxtlg,

    g_variant_text_h TYPE rstxtlg,

    okcode TYPE syucomm,

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 20

    g_subrc TYPE sysubrc.

    DATA: g_user LIKE rspcvariantattr-tstpnm,

    g_date TYPE sydatum,

    g_time TYPE syuzeit,

    g_s_tstpint TYPE rststpint.

    DATA: g_r_variant TYPE REF TO cl_rspc_variant.

    DATA g_decision_container_name TYPE scrfname

    VALUE 'DECISION_CONTROL'.

    DATA g_decision_container TYPE REF TO cl_gui_custom_container.

    DATA g_decision_grid TYPE REF TO cl_gui_alv_grid.

    CLASS lcl_decision DEFINITION DEFERRED.

    CLASS lcl_decision_dd DEFINITION DEFERRED.

    DATA g_r_decision TYPE REF TO lcl_decision.

    DATA: g_t_decision TYPE ZRSPC_T_DECISION,

    g_t_decision_old TYPE ZRSPC_T_DECISION,

    g_t_dec_var TYPE rspc_t_variant,

    g_s_dec_vart TYPE rspcvariantt,

    g_t_dec_fcat TYPE lvc_t_fcat,

    g_dec_dd_behaviour TYPE REF TO cl_dragdrop,

    g_r_formulas TYPE REF TO cl_rsar_formulas.

    DATA: ok_code LIKE sy-ucomm.

    DATA: g_display_only TYPE rs_bool.

    DATA g_t_fcode LIKE okcode OCCURS 0 WITH HEADER LINE.

    DATA FU_OBJLIST LIKE STANDARD TABLE OF RSEUAP .

    DATA: onhp_code(72) type c,

    onhp_lt_code like standard table of onhp_code.

    DATA l_uniqueid LIKE rssgtpdir-uni_idc25.

    DATA: onhp_e_repid like sy-repid,

    onhp_l_t_repid like table of onhp_e_repid.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 21

    6. LZRSPC_DECISIONO01

    Add following code

    *----------------------------------------------------------------------*

    ***INCLUDE LZRSPC_PROCESSESO01 .

    *----------------------------------------------------------------------*

    *&---------------------------------------------------------------------*

    *& Module STATUS_0600 OUTPUT

    *&---------------------------------------------------------------------*

    * text

    *----------------------------------------------------------------------*

    MODULE status_0600 OUTPUT.

    IF g_r_variant IS INITIAL.

    PERFORM decision_get.

    ENDIF.

    PERFORM decision_init.

    ENDMODULE. " STATUS_0600 OUTPUT

    7. LZRSPC_DECISIONI01

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 22

    *&---------------------------------------------------------------------*

    *& Module USER_COMMAND_0600 INPUT

    *&---------------------------------------------------------------------*

    * text

    *----------------------------------------------------------------------*

    MODULE user_command_0600 INPUT.

    CASE sy-ucomm.

    WHEN 'SAVE'.

    PERFORM decision_save.

    WHEN 'CREA' OR 'EXIT' OR 'BACK' OR 'CANC'.

    PERFORM decision_changed CHANGING sy-subrc.

    IF sy-subrc 0.

    CALL FUNCTION 'RSPC_VARIANT_OPERATION_STOP'.

    ENDIF.

    WHEN 'DELE'.

    PERFORM decision_delete CHANGING sy-subrc.

    IF sy-subrc 0.

    CALL FUNCTION 'RSPC_VARIANT_OPERATION_STOP'.

    ENDIF.

    WHEN 'DISP'.

    PERFORM displaymode_toggle.

    IF g_display_only = 'X'.

    CALL METHOD g_decision_grid->set_ready_for_input

    EXPORTING

    i_ready_for_input = 0.

    ELSE.

    CALL METHOD g_decision_grid->set_ready_for_input

    EXPORTING

    i_ready_for_input = 1.

    ENDIF.

    CALL METHOD g_r_decision->displaymode_toggle.

    ENDCASE.

    ENDMODULE. " USER_COMMAND_0600 INPUT

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 23

    8. LZRSPC_DECISIONF02

    Add following code

    *----------------------------------------------------------------------*

    ***INCLUDE LRSPC_PROCESSESF02 .

    *----------------------------------------------------------------------*

    *&---------------------------------------------------------------------*

    *& Form decision_init

    *&---------------------------------------------------------------------*

    * text

    *----------------------------------------------------------------------*

    * --> p1 text

    *

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 24

    i_bypassing_buffer = rs_c_true

    CHANGING

    ct_fieldcat = l_t_fieldcatalog

    EXCEPTIONS

    inconsistent_interface = 1

    program_error = 2

    OTHERS = 3.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

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

    ENDIF.

    DELETE l_t_fieldcatalog WHERE fieldname = 'FORM'.

    DELETE l_t_fieldcatalog WHERE fieldname = 'EVENTCOLOR'.

    DELETE l_t_fieldcatalog WHERE fieldname = 'EVENTNO'.

    READ TABLE l_t_fieldcatalog INTO l_s_fieldcatalog

    WITH KEY fieldname = 'COMMANDTEXT'.

    MODIFY l_t_fieldcatalog FROM l_s_fieldcatalog INDEX sy-tabix.

    READ TABLE l_t_fieldcatalog INTO l_s_fieldcatalog

    WITH KEY fieldname = 'DESCRIPTION'.

    l_s_fieldcatalog-outputlen = 33.

    l_s_fieldcatalog-edit = 'X'.

    MODIFY l_t_fieldcatalog FROM l_s_fieldcatalog INDEX sy-tabix.

    READ TABLE l_t_fieldcatalog INTO l_s_fieldcatalog

    WITH KEY fieldname = 'BUTTON'.

    l_s_fieldcatalog-coltext = text-021.

    l_s_fieldcatalog-outputlen = 07.

    l_s_fieldcatalog-hotspot = 'X'.

    l_s_fieldcatalog-icon = 'X'.

    MODIFY l_t_fieldcatalog FROM l_s_fieldcatalog INDEX sy-tabix.

    READ TABLE l_t_fieldcatalog INTO l_s_fieldcatalog

    WITH KEY fieldname = 'EVENTICON'.

    l_s_fieldcatalog-coltext = text-022.

    l_s_fieldcatalog-outputlen = 02.

    l_s_fieldcatalog-icon = 'X'.

    MODIFY l_t_fieldcatalog FROM l_s_fieldcatalog INDEX sy-tabix.

    READ TABLE l_t_fieldcatalog INTO l_s_fieldcatalog

    WITH KEY fieldname = 'DANN'.

    l_s_fieldcatalog-outputlen = 5.

    MODIFY l_t_fieldcatalog FROM l_s_fieldcatalog INDEX sy-tabix.

    READ TABLE l_t_fieldcatalog INTO l_s_fieldcatalog

    WITH KEY fieldname = 'EVENTTEXT'.

    l_s_fieldcatalog-checktable = '!'.

    l_s_fieldcatalog-f4availabl = 'X'.

    MODIFY l_t_fieldcatalog FROM l_s_fieldcatalog INDEX sy-tabix.

    * ---- Dragdrop ----

    CREATE OBJECT g_dec_dd_behaviour.

    l_dd_effect = cl_dragdrop=>move + cl_dragdrop=>copy.

    CALL METHOD g_dec_dd_behaviour->add

    EXPORTING

    flavor = 'Line' "#EC NOTEXT

    dragsrc = 'X'

    droptarget = 'X'

    effect = l_dd_effect.

    CALL METHOD g_dec_dd_behaviour->get_handle

    IMPORTING

    handle = l_dd_handle.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 25

    l_s_layout-s_dragdrop-row_ddid = l_dd_handle.

    * ---- Layout ----

    l_s_layout-sel_mode = 'B'.

    l_s_layout-no_rowmove = 'X'.

    * ---- Toolbar ----

    PERFORM decision_tb_exclude CHANGING l_t_exclude.

    * ---- Start ----

    CALL METHOD g_decision_grid->set_table_for_first_display

    EXPORTING

    is_layout = l_s_layout

    it_toolbar_excluding = l_t_exclude

    CHANGING

    it_fieldcatalog = l_t_fieldcatalog

    it_outtab = g_t_decision.

    * ---- F4 ----

    CLEAR l_t_f4.

    l_t_f4-fieldname = 'EVENTTEXT'.

    l_t_f4-register = 'X'.

    l_t_f4-getbefore = 'X'.

    l_t_f4-chngeafter = 'X'.

    INSERT table l_t_f4.

    CALL METHOD g_decision_grid->register_f4_for_fields

    EXPORTING

    it_f4 = l_t_f4[].

    * ---- events ----

    CREATE OBJECT g_r_decision.

    SET HANDLER g_r_decision->on_f4

    FOR g_decision_grid.

    SET HANDLER g_r_decision->handle_data_changed

    FOR g_decision_grid.

    SET HANDLER g_r_decision->on_hotspot

    FOR g_decision_grid.

    SET HANDLER g_r_decision->handle_user_command

    FOR g_decision_grid.

    SET HANDLER g_r_decision->handle_toolbar

    FOR g_decision_grid.

    SET HANDLER g_r_decision->handle_alv_drag

    FOR g_decision_grid.

    SET HANDLER g_r_decision->handle_alv_drop

    FOR g_decision_grid.

    * ---- Input ----

    IF g_display_only = 'X'.

    CALL METHOD g_decision_grid->set_ready_for_input

    EXPORTING

    i_ready_for_input = 0.

    ELSE.

    CALL METHOD g_decision_grid->set_ready_for_input

    EXPORTING

    i_ready_for_input = 1.

    ENDIF.

    CALL METHOD g_r_decision->displaymode_set( g_display_only ).

    * ---- Toolbar ----

    CALL METHOD g_decision_grid->set_toolbar_interactive.

    ENDIF.

    ENDFORM. " decision_init

    *&---------------------------------------------------------------------*

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 26

    *& Form decision_get

    *&---------------------------------------------------------------------*

    * text

    *----------------------------------------------------------------------*

    * --> p1 text

    * create

    EXPORTING

    i_type = 'ZDECISION'

    i_variant = g_variant

    RECEIVING

    r_r_variant = g_r_variant

    EXCEPTIONS

    locked = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

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

    EXIT.

    ENDIF.

    * ==== Get Info ====

    CALL METHOD g_r_variant->get_info

    IMPORTING

    e_t_rspcvariant = g_t_dec_var

    e_s_rspcvariantt = g_s_dec_vart.

    g_variant_text = g_s_dec_vart-txtlg.

    * ==== Refresh fields ====

    REFRESH: g_t_decision_old, g_t_decision.

    * ==== Put to fields ====

    DATA: l_ccount LIKE l_s_rspcvariant-high.

    l_count = 0.

    DO.

    CLEAR: l_s_decision, l_s_rspcvariant.

    ADD 1 TO l_count.

    WRITE l_count TO l_ccount LEFT-JUSTIFIED.

    READ TABLE g_t_dec_var INTO l_s_rspcvariant

    WITH KEY high = l_ccount

    fnam = 'DESCRIPTION'.

    l_s_decision-description = l_s_rspcvariant-low.

    READ TABLE g_t_dec_var INTO l_s_rspcvariant

    WITH KEY high = l_ccount

    fnam = 'FORM'.

    l_s_decision-form = l_s_rspcvariant-low.

    READ TABLE g_t_dec_var INTO l_s_rspcvariant

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 27

    WITH KEY high = l_ccount

    fnam = 'EVENTCOLOR'.

    l_s_decision-eventcolor = l_s_rspcvariant-low.

    READ TABLE g_t_dec_var INTO l_s_rspcvariant

    WITH KEY high = l_ccount

    fnam = 'EVENTNO'.

    l_s_decision-eventno = l_s_rspcvariant-low.

    IF l_s_decision IS INITIAL.

    EXIT.

    ELSE.

    APPEND l_s_decision TO g_t_decision_old.

    ENDIF.

    ENDDO.

    * ==== Fill other information ====

    DESCRIBE TABLE g_t_decision_old LINES l_lines.

    IF l_lines = 0.

    PERFORM decision_standardlines USING 'X' 0 '' CHANGING g_t_decision_old.

    PERFORM decision_standardlines USING '' 0 'X' CHANGING g_t_decision_old.

    ENDIF.

    PERFORM decision_fill_lines CHANGING g_t_decision_old.

    g_t_decision = g_t_decision_old.

    ENDFORM. " decision_get

    *&---------------------------------------------------------------------*

    *& Form decision_changed

    *&---------------------------------------------------------------------*

    * text

    *----------------------------------------------------------------------*

    * --> p1 text

    * check_changed_data.

    IF sy-datar = 'X' OR g_t_decision_old g_t_decision.

    CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'

    EXPORTING

    defaultoption = 'Y'

    textline1 = text-002

    titel = text-006

    start_column = 25

    start_row = 6

    cancel_display = ' '

    IMPORTING

    answer = l_answer.

    IF l_answer = 'A'.

    p_subrc = 4.

    EXIT.

    ENDIF.

    IF l_answer = 'J'.

    PERFORM decision_save.

    ENDIF.

    ENDIF.

    ENDIF.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 28

    IF p_subrc = 0.

    CLEAR g_r_variant.

    CALL METHOD g_decision_grid->free.

    FREE g_decision_grid.

    CALL METHOD g_decision_container->free.

    FREE g_decision_container.

    REFRESH: g_t_decision, g_t_decision_old.

    ENDIF.

    ENDFORM. " decision_changed

    *&---------------------------------------------------------------------*

    *& Form decision_save

    *&---------------------------------------------------------------------*

    * text

    *----------------------------------------------------------------------*

    * --> p1 text

    * check_changed_data.

    REFRESH g_t_dec_var.

    LOOP AT g_t_decision INTO l_s_decision.

    ADD 1 TO l_count.

    l_s_rspcvariant-high = l_count.

    SHIFT l_s_rspcvariant-high LEFT DELETING LEADING space.

    l_s_rspcvariant-fnam = 'DESCRIPTION'.

    l_s_rspcvariant-low = l_s_decision-description.

    APPEND l_s_rspcvariant TO g_t_dec_var.

    l_s_rspcvariant-fnam = 'FORM'.

    l_s_rspcvariant-low = l_s_decision-form.

    IF NOT l_s_decision-form IS INITIAL.

    APPEND l_s_decision-form TO l_t_formex.

    ENDIF.

    APPEND l_s_rspcvariant TO g_t_dec_var.

    l_s_rspcvariant-fnam = 'EVENTCOLOR'.

    l_s_rspcvariant-low = l_s_decision-eventcolor.

    APPEND l_s_rspcvariant TO g_t_dec_var.

    l_s_rspcvariant-fnam = 'EVENTNO'.

    l_s_rspcvariant-low = l_s_decision-eventno.

    APPEND l_s_rspcvariant TO g_t_dec_var.

    ENDLOOP.

    CALL FUNCTION 'RSPC_VARIANT_GET'

    IMPORTING

    e_variant_text = g_s_dec_vart-txtlg.

    * ==== Save dependent formulas ====

    * IF g_r_formulas IS BOUND.

    * CALL METHOD cl_rspc_variant=>get_tlogo

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 29

    * EXPORTING

    * i_type = 'ZDECISION'

    * i_variant = g_variant

    * IMPORTING

    * e_tlogo = l_tlogo

    * e_objnm = l_objnm.

    * CALL METHOD g_r_formulas->save

    * EXPORTING

    * i_t_formex = l_t_formex

    * i_tlogo = l_tlogo

    * i_tlogo_objnm = l_objnm

    * EXCEPTIONS

    * rsfo_transport_error = 1

    * rsfo_invalid_unique_id = 2

    * rsfo_text_wrong_type = 3

    * OTHERS = 4.

    * IF sy-subrc 0.

    * MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    * ENDIF.

    * CALL METHOD g_r_formulas->delete_on_activate

    * EXPORTING

    * i_t_formex = l_t_formex

    * EXCEPTIONS

    * rsfo_delete_error = 1

    * OTHERS = 2.

    * IF sy-subrc 0.

    * MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    * ENDIF.

    * CALL METHOD g_r_formulas->activate

    * EXPORTING

    * i_t_formex = l_t_formex

    * i_tlogo = l_tlogo

    * i_tlogo_objnm = l_objnm

    ** IMPORTING

    ** E_T_MSG = l_t_msg

    * EXCEPTIONS

    * rsfo_delete_error = 1

    * rsfo_invalid_unique_id = 2

    * rsfo_empty_formula = 3

    * rsfo_transport_error = 4

    * OTHERS = 5.

    * IF sy-subrc 0.

    * MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    * ENDIF.

    * ==== Save ====

    CALL METHOD g_r_variant->save

    EXPORTING

    i_t_rspcvariant = g_t_dec_var

    i_s_rspcvariantt = g_s_dec_vart

    EXCEPTIONS

    failed = 1

    OTHERS = 2.

    * ==== Delete obsolete formulas ====

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 30

    * REFRESH l_t_formex.

    LOOP AT g_t_decision_old INTO l_s_decision WHERE NOT form IS INITIAL.

    READ TABLE g_t_decision WITH KEY form = l_s_decision-form

    TRANSPORTING NO FIELDS.

    IF sy-subrc 0.

    * ---- Obsolete ----

    delete report l_s_decision-form.

    ENDIF.

    ENDLOOP.

    * ==== Check ====

    PERFORM decision_check CHANGING sy-subrc.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    ENDIF.

    * ==== finish ====

    g_t_decision_old = g_t_decision.

    ENDFORM. " decision_save

    *&--------------------------------------------------------------------*

    *& Form decision_tb_exclude

    *&--------------------------------------------------------------------*

    * text

    *---------------------------------------------------------------------*

    * -->P_T_EXCLUDEtext

    *---------------------------------------------------------------------*

    FORM decision_tb_exclude CHANGING p_t_exclude TYPE ui_functions.

    DATA l_s_exclude TYPE ui_func.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_auf.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_average.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_back_classic.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_call_abc.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_call_chain.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_call_crbatch.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_call_crweb.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_call_lineitems.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_call_master_data.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_call_more.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_call_report.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_call_xint.

    APPEND l_s_exclude TO p_t_exclude.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 31

    l_s_exclude = cl_gui_alv_grid=>mc_fc_call_xxl.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_check.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_col_invisible.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_col_optimize.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_count.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_current_variant.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_data_save.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_delete_filter.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_deselect_all.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_detail.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_excl_all.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_expcrdata.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_expcrdesig.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_expcrtempl.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_expmdb.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_extend.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_f4.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_filter.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_find.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_fix_columns.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_graph.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_help.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_html.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_info.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_load_variant.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.

    APPEND l_s_exclude TO p_t_exclude.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 32

    l_s_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_maintain_variant.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_maximum.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_minimum.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_pc_file.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_print.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_print_back.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_print_prev.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_refresh.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_reprep.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_save_variant.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_select_all.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_send.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_separator.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_sort.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_sort_asc.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_sort_dsc.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_subtot.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_sum.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_to_office.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_to_rep_tree.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_unfix_columns.

    APPEND l_s_exclude TO p_t_exclude.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 33

    l_s_exclude = cl_gui_alv_grid=>mc_fc_url_copy_to_clipboard.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_variant_admin.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_views.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_view_crystal.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_view_excel.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_view_grid.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_view_lotus.

    APPEND l_s_exclude TO p_t_exclude.

    l_s_exclude = cl_gui_alv_grid=>mc_fc_word_processor.

    APPEND l_s_exclude TO p_t_exclude.

    ENDFORM. "decision_tb_exclude

    *&--------------------------------------------------------------------*

    *& Form decision_standardlines

    *&--------------------------------------------------------------------*

    * text

    *---------------------------------------------------------------------*

    * -->P_FIRST text

    * -->P_LAST text

    * -->P_S_DECISIOtext

    *---------------------------------------------------------------------*

    FORM decision_standardlines

    USING p_first TYPE rs_bool

    p_index

    p_last TYPE rs_bool

    CHANGING p_t_decision TYPE zrspc_t_decision.

    DATA: l_s_decision TYPE zrspc_s_decision.

    IF p_first = rs_c_true.

    l_s_decision-eventcolor = 'G'.

    l_s_decision-eventno = '01'.

    INSERT l_s_decision INTO p_t_decision INDEX 1.

    ENDIF.

    IF NOT p_index IS INITIAL.

    l_s_decision-eventcolor = 'G'.

    l_s_decision-eventno = p_index.

    INSERT l_s_decision INTO p_t_decision INDEX p_index.

    ENDIF.

    IF p_last = rs_c_true.

    l_s_decision-eventcolor = 'R'.

    l_s_decision-eventno = '00'.

    APPEND l_s_decision TO p_t_decision.

    ENDIF.

    ENDFORM. "decision_standardlines

    *&--------------------------------------------------------------------*

    *& Form decision_fill_lines

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 34

    *&--------------------------------------------------------------------*

    * text

    *---------------------------------------------------------------------*

    * -->P_T_DECISIOtext

    *---------------------------------------------------------------------*

    FORM decision_fill_lines CHANGING p_t_decision TYPE rspc_t_decision.

    DATA: l_s_decision TYPE zrspc_s_decision,

    l_lines TYPE i,

    l_icon TYPE icon_d,

    l_text TYPE rstxtsh.

    DESCRIBE TABLE p_t_decision LINES l_lines.

    LOOP AT p_t_decision INTO l_s_decision.

    IF sy-tabix = 1.

    l_s_decision-commandtext = text-018.

    ELSEIF sy-tabix = l_lines.

    l_s_decision-commandtext = text-020.

    ELSE.

    l_s_decision-commandtext = text-019.

    ENDIF.

    l_s_decision-dann = text-015.

    IF l_s_decision-eventcolor = 'R'.

    l_s_decision-eventtext = text-016.

    l_icon = '@[email protected]'.

    ELSE.

    CONCATENATE text-017 l_s_decision-eventno

    INTO l_s_decision-eventtext

    SEPARATED BY space.

    CALL FUNCTION 'RSPC_GET_EVENT_ICON'

    EXPORTING

    i_eventno = l_s_decision-eventno

    IMPORTING

    e_icon = l_icon.

    ENDIF.

    CALL FUNCTION 'RSSM_ICON_CREATE'

    EXPORTING

    name = l_icon

    info = l_s_decision-eventtext

    IMPORTING

    RESULT = l_s_decision-eventicon

    EXCEPTIONS

    icon_not_found = 0

    outputfield_too_short = 0

    OTHERS = 0.

    IF l_s_decision-form IS INITIAL.

    IF sy-tabix l_lines OR l_lines = 1.

    l_icon = '@[email protected]'.

    l_text = text-034.

    ELSE.

    CLEAR l_icon.

    ENDIF.

    ELSE.

    IF sy-tabix l_lines OR l_lines = 1.

    l_icon = '@[email protected]'.

    l_text = text-033.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 35

    ELSE.

    l_icon = '@[email protected]'.

    l_text = text-032.

    ENDIF.

    ENDIF.

    IF NOT l_icon IS INITIAL.

    CALL FUNCTION 'RSSM_ICON_CREATE'

    EXPORTING

    name = l_icon

    info = l_text

    IMPORTING

    RESULT = l_s_decision-button

    EXCEPTIONS

    icon_not_found = 0

    outputfield_too_short = 0

    OTHERS = 0.

    ELSE.

    CLEAR l_s_decision-button.

    ENDIF.

    MODIFY p_t_decision FROM l_s_decision.

    ENDLOOP.

    ENDFORM. "decision_fill_lines

    *&---------------------------------------------------------------------*

    *& Form decision_delete

    *&---------------------------------------------------------------------*

    * text

    *----------------------------------------------------------------------*

    * --> p1 text

    *

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 36

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

    ENDIF.

    IF l_answer = '2'.

    p_subrc = 12.

    EXIT.

    ENDIF.

    loop at l_t_repid into e_repid.

    delete report e_repid.

    endloop.

    ENDIF.

    ENDFORM. " decision_delete

    *&---------------------------------------------------------------------*

    *& Form decision_check

    *&---------------------------------------------------------------------*

    * text

    *----------------------------------------------------------------------*

    *

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 37

    * --> p1 text

    *

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 38

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 39

    11. Save and activate.

    Class ZCL_RSPC_DECISION

    To save time we will copy the existing class CL_RSPC_DECISION and add modified codes in the methods.

    1. Start transaction SE24.

    2. Give class name as CL_RSPC_DECISION.

    3. Click on copy class/interface button on toolbar or hit CTRL+F5

    4. Select copy to as ZCL_RSPC_DECISION.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 40

    1. Properties -> change description to suit your needs or let it be the same.

    2. Interfaces -> remain unchanged

    3. Attributes -> change type of attribute P_T_DECISION to ZRSPC_T_DECISION

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 41

    4. Methods

    4.1. IF_RSPV_TRANSPORT~AFTER_IMPORT

    METHOD IF_RSPV_TRANSPORT~AFTER_IMPORT.

    CALL METHOD zcl_rspc_decision=>activate_0bool

    IMPORTING

    e_t_prot = e_t_prot.

    ENDMETHOD.

    IF_RSPV_TRANSPORT~GET_RELATED

    METHOD IF_RSPV_TRANSPORT~GET_RELATED.

    DATA: l_s_decision TYPE zrspc_s_decision,

    l_t_obj TYPE rs_t_tr_object,

    l_s_obj TYPE rs_s_tr_object,

    l_s_export TYPE rso_s_tlogo_asc.

    CALL METHOD zcl_rspc_decision=>read_parameters

    EXPORTING

    i_variant = i_variant

    i_objvers = i_objvers

    EXCEPTIONS

    failed = 1

    OTHERS = 2.

    IF sy-subrc 0.

    RAISE EXCEPTION TYPE cx_rs_version_not_found.

    ENDIF.

    LOOP AT p_t_decision INTO l_s_decision WHERE NOT form IS INITIAL.

    l_s_export-tlogo = 'PROG'.

    l_s_export-objnm = l_s_decision-form.

    l_s_export-asc_type = rsoc_c_asc_type-existential.

    APPEND l_s_export TO e_t_obj_existential.

    ENDLOOP.

    ENDMETHOD.

    4.2. IF_RSPV_TRANSPORT~GET_ADDITIONAL_OBJECTS

    method IF_RSPV_TRANSPORT~GET_ADDITIONAL_OBJECTS.

    endmethod.

    4.3. IF_RSPC_TRANSPORT~GET_TLOGO

    METHOD IF_RSPC_TRANSPORT~GET_TLOGO.

    CALL METHOD cl_rspc_variant=>get_tlogo

    EXPORTING

    i_type = 'ZDECISION'

    i_variant = i_variant

    i_objvers = i_objvers

    IMPORTING

    e_tlogo = e_tlogo

    e_objnm = e_objnm.

    ENDMETHOD.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 42

    4.4. IF_RSPC_TRANSPORT~KEY_CHANGE

    method IF_RSPC_TRANSPORT~KEY_CHANGE.

    endmethod.

    4.5. IF_RSPC_MULTI_EVENT~GET_EVENTS

    METHOD IF_RSPC_MULTI_EVENT~GET_EVENTS.

    DATA: l_s_events TYPE rspc_s_events,

    l_s_decision TYPE zrspc_s_decision.

    CALL METHOD zcl_rspc_decision=>read_parameters

    EXPORTING

    i_variant = i_variant

    EXCEPTIONS

    failed = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    ENDIF.

    LOOP AT p_t_decision INTO l_s_decision.

    l_s_events-eventno = l_s_decision-eventno.

    l_s_events-text = l_s_decision-description.

    APPEND l_s_events TO e_t_events.

    ENDLOOP.

    ENDMETHOD.

    4.6. IF_RSPC_MULTI_EVENT~GET_EVENT

    METHOD IF_RSPC_MULTI_EVENT~GET_EVENT.

    DATA: l_s_events TYPE rspc_s_events,

    l_s_decision TYPE zrspc_s_decision.

    CALL METHOD zcl_rspc_decision=>read_parameters

    EXPORTING

    i_variant = i_variant

    EXCEPTIONS

    failed = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    ENDIF.

    READ TABLE p_t_decision INTO l_s_decision WITH KEY

    eventno = i_eventno.

    IF sy-subrc = 0.

    e_text = l_s_decision-description.

    ELSE.

    RAISE not_exist.

    ENDIF.

    ENDMETHOD.

    4.7. IF_RSPC_MAINTAIN~MAINTAIN

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 43

    METHOD IF_RSPC_MAINTAIN~MAINTAIN .

    DATA: l_t_prot TYPE rs_t_tr_prot,

    l_t_type TYPE rspc_t_processtypes_sel,

    l_s_type TYPE rspc_s_processtypes_sel.

    * ==== Activate 0BOOL if needed ====

    CALL METHOD zcl_rspc_decision=>activate_0bool

    IMPORTING

    e_t_prot = l_t_prot.

    IF NOT l_t_prot[] IS INITIAL.

    MESSAGE i111(rspc).

    EXIT.

    ENDIF.

    * ==== store context for later f4 ====

    p_t_chain = i_t_chain.

    * ==== Start maintainance ====

    PERFORM displaymode_set IN PROGRAM SAPLZRSPC_DECISION USING i_display_only.

    CALL FUNCTION 'RSPC_VARIANT_MAINTAIN'

    EXPORTING

    i_type = 'ZDECISION'

    i_dynnr = '0600'

    i_repid = 'SAPLZRSPC_DECISION'

    i_callback_at_exit = 'DECISION_CHANGED'

    i_variant = i_variant

    i_display_only = i_display_only

    IMPORTING

    e_variant = e_variant

    e_variant_text = e_variant_text

    EXCEPTIONS

    aborted = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno

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

    ENDIF.

    ENDMETHOD.

    4.8. IF_RSPC_MAINTAIN~GET_HEADER

    METHOD IF_RSPC_MAINTAIN~GET_HEADER .

    DATA: l_r_variant TYPE REF TO cl_rspc_variant,

    l_s_variantattr TYPE rspcvariantattr,

    l_s_variantt TYPE rspcvariantt.

    CALL METHOD cl_rspc_variant=>create

    EXPORTING

    i_type = 'ZDECISION'

    i_variant = i_variant

    i_no_transport = rs_c_true

    RECEIVING

    r_r_variant = l_r_variant

    EXCEPTIONS

    locked = 1

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 44

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno

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

    ENDIF.

    CALL METHOD l_r_variant->get_info

    IMPORTING

    e_s_rspcvariantattr = l_s_variantattr

    e_s_rspcvariantt = l_s_variantt.

    CALL METHOD l_r_variant->free.

    MOVE-CORRESPONDING l_s_variantattr TO e_s_changed.

    e_contrel = l_s_variantattr-contrel.

    e_conttimestmp = l_s_variantattr-conttimestmp.

    e_variant_text = l_s_variantt-txtlg.

    ENDMETHOD.

    4.9. IF_RSPC_GET_VARIANT~GET_VARIANT

    METHOD IF_RSPC_GET_VARIANT~GET_VARIANT.

    CALL METHOD cl_rspc_variant=>f4

    EXPORTING

    i_type = 'ZDECISION'

    i_variant = i_variant

    i_objvers = i_objvers

    i_t_select = i_t_select

    i_allow_new = rs_c_false

    IMPORTING

    e_variant = e_variant

    e_variant_text = e_variant_text

    EXCEPTIONS

    aborted = 1

    nothing_found = 2

    internal_error = 3

    OTHERS = 4.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

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

    RAISING nothing_selected.

    ENDIF.

    ENDMETHOD.

    4.10. IF_RSPC_GET_VARIANT~WILDCARD_ENABLED

    METHOD IF_RSPC_GET_VARIANT~WILDCARD_ENABLED.

    result = 'X'.

    ENDMETHOD.

    4.11. IF_RSPC_GET_VARIANT~EXISTS

    METHOD IF_RSPC_GET_VARIANT~EXISTS.

    CALL METHOD cl_rspc_variant=>exists

    EXPORTING

    i_type = 'ZDECISION'

    i_variant = i_variant

    RECEIVING

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 45

    r_exists = r_exists.

    ENDMETHOD.

    4.12. IF_RSPC_EXECUTE~EXECUTE

    METHOD IF_RSPC_EXECUTE~EXECUTE .

    DATA: l_unique_id TYPE sysuuid_25,

    l_s_processlist TYPE rspc_s_processlist,

    l_s_decision TYPE zrspc_s_decision.

    DATA: l_formid TYPE rscodeid,

    l_r_formula TYPE REF TO cl_foev_formula,

    l_r_connector TYPE REF TO zcl_rspc_decision,

    l_result TYPE bool,

    l_lines TYPE i.

    FIELD-SYMBOLS: TYPE ANY.

    CREATE OBJECT l_r_connector.

    CALL FUNCTION 'RSSM_UNIQUE_ID'

    IMPORTING

    e_uni_idc25 = l_unique_id.

    e_instance = l_unique_id.

    MESSAGE s008(rspc) WITH i_variant e_instance i_logid.

    p_t_processlist = i_t_processlist.

    p_variant = i_variant.

    CALL METHOD zcl_rspc_decision=>read_parameters

    EXPORTING

    i_variant = i_variant

    EXCEPTIONS

    failed = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno

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

    e_state = 'R'.

    EXIT.

    ENDIF.

    DESCRIBE TABLE p_t_decision LINES l_lines.

    LOOP AT p_t_decision INTO l_s_decision.

    CALL FUNCTION 'RSPC_GET_KILL'

    EXPORTING

    i_logid = i_logid

    EXCEPTIONS

    to_be_killed = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

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

    e_state = 'R'.

    EXIT.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 46

    ENDIF.

    MESSAGE s109(rspc) WITH l_s_decision-description.

    IF sy-tabix < l_lines.

    TRY.

    l_formid = l_s_decision-form .

    perform evaluate in program (l_formid) changing l_result.

    ASSIGN l_result TO .

    IF = rs_c_true.

    e_eventno = l_s_decision-eventno.

    e_state = l_s_decision-eventcolor.

    EXIT.

    ENDIF.

    CATCH cx_root.

    MESSAGE i110(rspc) WITH l_s_decision-description.

    e_state = 'R'.

    EXIT.

    ENDTRY.

    ELSE.

    e_eventno = l_s_decision-eventno.

    e_state = l_s_decision-eventcolor.

    ENDIF.

    ENDLOOP.

    ENDMETHOD.

    IF_RSPC_EXECUTE~GIVE_CHAIN

    METHOD IF_RSPC_EXECUTE~GIVE_CHAIN .

    return = 'X'.

    ENDMETHOD.

    4.13. IF_RSPC_DELETE~DELETE

    METHOD IF_RSPC_DELETE~DELETE.

    DATA: l_r_variant TYPE REF TO cl_rspc_variant.

    CALL METHOD cl_rspc_variant=>create

    EXPORTING

    i_type = 'ZDECISION'

    i_variant = i_variant

    i_lock = 'X'

    RECEIVING

    r_r_variant = l_r_variant

    EXCEPTIONS

    locked = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

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

    RAISING failed.

    ENDIF.

    CALL METHOD l_r_variant->delete

    EXCEPTIONS

    failed = 1

    OTHERS = 2.

    IF sy-subrc 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

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

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 47

    RAISING failed.

    ENDIF.

    ENDMETHOD.

    4.14. IF_FOEV_CONNECTOR~EVALUATE

    METHOD IF_FOEV_CONNECTOR~EVALUATE.

    FIELD-SYMBOLS: TYPE ANY,

    TYPE ANY.

    DATA:

    l_tabname TYPE tabname,

    l_fieldname TYPE fieldname.

    SPLIT im_fieldname AT '-' INTO l_tabname l_fieldname.

    IF l_tabname EQ 'SYST'.

    ASSIGN COMPONENT l_fieldname OF STRUCTURE syst TO .

    if sy-subrc ne 0.

    exit.

    endif.

    CREATE DATA re_result TYPE (im_fieldname).

    ASSIGN re_result->* TO .

    = .

    ENDIF.

    ENDMETHOD.

    4.15. FORMULA_GET_PREDECESSOR_PARAM

    METHOD FORMULA_GET_PREDECESSOR_PARAM .

    DATA: l_s_processlist TYPE rspc_s_processlist,

    l_type TYPE rspc_type,

    l_variant TYPE rspc_variant.

    CALL METHOD zcl_rspc_decision=>formula_get_predecessor

    IMPORTING

    e_type = l_type

    e_variant = l_variant.

    CALL METHOD zcl_rspc_decision=>formula_get_value

    EXPORTING

    i_type = l_type

    i_variant = l_variant

    i_fieldname = i_fieldname

    i_low_or_high = i_low_or_high

    i_number_of_value = i_number_of_value

    IMPORTING

    e_value = e_value.

    ENDMETHOD.

    4.16. FORMULA_GET_PROCESS_PARAMETER

    METHOD FORMULA_GET_PROCESS_PARAMETER.

    CALL METHOD zcl_rspc_decision=>formula_get_value

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 48

    EXPORTING

    i_type = i_type

    i_variant = i_variant

    i_fieldname = i_fieldname

    i_low_or_high = i_low_or_high

    i_number_of_value = i_number_of_value

    IMPORTING

    e_value = e_value.

    ENDMETHOD.

    4.17. FORMULA_EX_PROCESS_VALUE

    METHOD FORMULA_EX_PROCESS_VALUE .

    DATA: l_value TYPE rspc_value.

    CALL METHOD zcl_rspc_decision=>formula_get_value

    EXPORTING

    i_type = i_type

    i_variant = i_variant

    i_fieldname = i_fieldname

    i_value = i_value

    IMPORTING

    e_value = l_value.

    e_exists = l_value.

    ENDMETHOD.

    4.18. FORMULA_F4_BUFFER_TYPE

    METHOD FORMULA_F4_BUFFER_TYPE.

    DATA: l_s_type TYPE rspc_s_processtypes_sel,

    l_s_chain TYPE rspc_s_chain,

    l_s_typet TYPE rsprocesstypest.

    STATICS: s_t_typet TYPE TABLE OF rsprocesstypest.

    IF s_t_typet IS INITIAL.

    SELECT * FROM rsprocesstypest INTO TABLE s_t_typet WHERE langu = sy-langu.

    ENDIF.

    LOOP AT p_t_chain INTO l_s_chain.

    CALL FUNCTION 'RSPC_HAS_INTERFACE'

    EXPORTING

    i_type = l_s_chain-type

    i_method = 'GET_INFO'

    EXCEPTIONS

    interface_not_implemented = 1

    unknown_process = 2

    OTHERS = 3.

    IF sy-subrc 0.

    CONTINUE.

    ENDIF.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 49

    l_s_type-type = l_s_chain-type.

    READ TABLE s_t_typet INTO l_s_typet WITH KEY type = l_s_chain-type.

    l_s_type-description = l_s_typet-description.

    APPEND l_s_type TO e_t_type.

    ENDLOOP.

    SORT e_t_type BY description type.

    DELETE ADJACENT DUPLICATES FROM e_t_type.

    ENDMETHOD.

    4.19. FORMULA_F4_BUFFER_VARIANT

    METHOD FORMULA_F4_BUFFER_VARIANT .

    DATA: l_s_variant TYPE rspc_s_type_variant_f4,

    l_s_chain TYPE rspc_s_chain,

    l_object TYPE seoclsname.

    LOOP AT p_t_chain INTO l_s_chain.

    IF NOT p_formula_f4_type IS INITIAL AND

    p_formula_f4_type l_s_chain-type.

    CONTINUE.

    ELSE.

    CALL FUNCTION 'RSPC_HAS_INTERFACE'

    EXPORTING

    i_type = l_s_chain-type

    i_method = 'GET_INFO'

    IMPORTING

    e_object = l_object

    EXCEPTIONS

    interface_not_implemented = 1

    unknown_process = 2

    OTHERS = 3.

    IF sy-subrc 0.

    CONTINUE.

    ENDIF.

    ENDIF.

    l_s_variant-type = l_s_chain-type.

    l_s_variant-variant = l_s_chain-variante.

    CALL FUNCTION 'RSPC_HAS_INTERFACE'

    EXPORTING

    i_type = l_s_chain-type

    i_method = 'MAINTAIN'

    IMPORTING

    e_object = l_object

    EXCEPTIONS

    interface_not_implemented = 1

    unknown_process = 2

    OTHERS = 3.

    IF sy-subrc = 0.

    CALL METHOD (l_object)=>if_rspc_maintain~get_header

    EXPORTING

    i_variant = l_s_chain-variante

    IMPORTING

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 50

    e_variant_text = l_s_variant-text.

    ENDIF.

    APPEND l_s_variant TO e_t_variant.

    ENDLOOP.

    SORT e_t_variant BY text type variant.

    DELETE ADJACENT DUPLICATES FROM e_t_variant.

    ENDMETHOD.

    FORMULA_F4_BUFFER_FIELDNAME

    METHOD FORMULA_F4_BUFFER_FIELDNAME .

    DATA: l_s_fnam TYPE rspc_s_infoparms,

    l_object TYPE seoclsname.

    CALL FUNCTION 'RSPC_HAS_INTERFACE'

    EXPORTING

    i_type = p_formula_f4_type

    i_method = 'GET_INFO'

    IMPORTING

    e_object = l_object

    EXCEPTIONS

    interface_not_implemented = 1

    unknown_process = 2

    OTHERS = 3.

    IF sy-subrc 0.

    MESSAGE i115(rspc).

    EXIT.

    ENDIF.

    CALL METHOD (l_object)=>if_rspc_get_info~runtime_parameters

    EXPORTING

    i_variant = p_formula_f4_variant

    IMPORTING

    e_t_fnam = e_t_fieldname.

    ENDMETHOD.

    4.20. FORMULA_F4_BUFFER_PRED_FNAM

    METHOD FORMULA_F4_BUFFER_PRED_FNAM .

    DATA: l_s_fnam TYPE rspc_s_infoparms,

    l_object TYPE seoclsname,

    l_type TYPE rspc_type,

    l_variant TYPE rspc_variant.

    CALL METHOD zcl_rspc_decision=>formula_get_predecessor

    IMPORTING

    e_type = l_type

    e_variant = l_variant.

    CALL FUNCTION 'RSPC_HAS_INTERFACE'

    EXPORTING

    i_type = l_type

    i_method = 'GET_INFO'

    IMPORTING

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 51

    e_object = l_object

    EXCEPTIONS

    interface_not_implemented = 1

    unknown_process = 2

    OTHERS = 3.

    IF sy-subrc 0.

    MESSAGE i115(rspc).

    EXIT.

    ENDIF.

    CALL METHOD (l_object)=>if_rspc_get_info~runtime_parameters

    EXPORTING

    i_variant = l_variant

    IMPORTING

    e_t_fnam = e_t_fieldname.

    ENDMETHOD. "formula_f4_buffer_fieldname

    4.21. ACTIVATE_0BOOL

    METHOD ACTIVATE_0BOOL .

    DATA: l_r_iobj_coll TYPE REF TO cl_rsd_iobj_collection,

    l_exists TYPE rs_bool,

    l_rx_message TYPE REF TO cx_rs_error,

    l_t_msg TYPE rs_t_msg,

    l_s_msg TYPE bal_s_msg,

    l_s_prot TYPE sprot_u,

    l_ja TYPE rs_bool VALUE rs_c_true.

    CALL METHOD cl_rsd_iobj=>if_rso_tlogo_general~exists_on_db

    EXPORTING

    i_objnm = '0BOOL'

    i_objvers = rs_c_objvers-active

    i_with_message = rs_c_false

    RECEIVING

    r_answer = l_exists.

    IF l_exists IS INITIAL.

    CREATE OBJECT l_r_iobj_coll.

    TRY.

    CALL METHOD l_r_iobj_coll->add_tlogo

    EXPORTING

    i_objnm = '0BOOLEAN'

    i_modify = rs_c_false

    i_with_cto = rs_c_false

    i_objvers = rs_c_objvers-active

    i_detlevel = '2'.

    CATCH cx_rs_error INTO l_rx_message.

    CALL METHOD l_rx_message->if_rs_message~get_message

    RECEIVING

    r_s_msg = l_s_msg.

    l_s_prot-level = l_s_msg-detlevel.

    l_s_prot-severity = l_s_msg-msgty.

    l_s_prot-ag = l_s_msg-msgid.

    l_s_prot-msgnr = l_s_msg-msgno.

    l_s_prot-var1 = l_s_msg-msgv1.

    l_s_prot-var2 = l_s_msg-msgv2.

  • Enhanced Decision Process Type for BW Process Chains

    SAP COMMUNITY NETWORK SDN - sdn.sap.com

    2009 SAP AG 52

    l_s_prot-var3 = l_s_msg-msgv3.

    l_s_prot-var4 = l_s_msg-msgv4.

    APPEND l_s_prot TO e_t_prot.

    ENDTRY.

    IF NOT l_rx_message IS INITIAL.

    EXIT.

    ENDIF.

    TRY.

    CALL METHOD l_r_iobj_coll->activate_content

    EXPORTING

    i_with_activation