Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member197610
Active Contributor

Business Scenario

In order to manage and optimize the procurement process in Public sector area a detailed reporting on the Workflow Process is needed. To be able to measure and analyze how long the process takes, where roadblocks may be occurring, and where there may be opportunities for improvement. 

The following types of workflow data required in BW to do reporting on the workflow statuses.

       For each RFx, RFx Response and Contract:

       When the document was created and who created

       For each step in the approval process, who submitted it, who received it, what the outcome was, and how long it took to accomplish the approval step (measured by the elapsed time between when it was first submitted and when a decision was made)Total amount of time taken to process the document.

       In addition, it is desirable to be able to incorporate relationships between documents into the workflow data, so that workflow across all of the documents related to procurement can be analyzed. Ex:To know what RFx Responses were tied to an RFx, as well as any contracts or POs that resulted from the responses so that we can measure and analyze how long it takes  to go from an RFx through to one or more POs or contracts

       The implementation needs to address the complexity of the process, in that there are several different scenarios that can occur, including

       The most common scenario, which is one RFx leading to 1 or more responses, with each response leading to 0 to many POs or contracts

       A contract can be entered without an RFx having been done in the system

       A contract can be tied to more than one RFx

       An RFx may result in a follow-up RFx .


To achieve the above business requirement, ccBPM integration with BW is required.All the below data modeling is done based on the requirement mentioned above.

Data Sources
0BPM_WIHEAD
0BPM_LOGHIST
0BPM_OBJREL
ZWF_REL_DOCS --Generic Extractor based on Function Module
ZSRM_DOC_GETDETAIL – Generic Extractor based on  Function Module


Data Store Objects

ZWF_DS01  Work Flow Items
ZWF_DS02  Work Flow Details
ZWF_DS03  Work item object relation information
ZWF_RDOC WF Related Documents (Newly Created DSO)
ZSRM_DET SRM Document Details   (Newly Created DSO)


Info Sets

ZWF_IS01

This info set will be used to create queries to find the workflow execution timings for each single document with the departmental approvals, approver name, purchase org, etc. Execution timings can be converted to Hours, minutes and seconds based on the client need.

ZWF_DS01  Work Flow Items
ZWF_DS03  Work item object relation information
ZSRM_DET SRM Document Details

ZWF_IS02

ZWF_DS01  Work Flow Items

ZWF_DS03  Work item object relation information

ZSRM_DET SRM Document Details

ZWF_RDOC WF Related Documents

This Infoset will be used to create queries to find the workflow execution timings for the related documents with the departmental approvals, approver name, purchase org, etc. Execution timings can be converted to Hours, minutes and seconds based on the client need.

Ex : Rfx – RFx’s response  --  Contract.

Data Model

Data source Enhancements

Following data sources can be enhanced based on the requirement and the fields needed in the report.

0BPM_WIHEAD – Enhancement can be done to get the approver name of the work item by calling the Function Module SUSR_USER_ADDRESS_READ

0BPM_OBJREL – Enhancement can be done to find the approving department based on the business object by reading the workflow configuration table. We made the customization as such to pull the approval steps of the workflow not all the workflow steps.

Generic Extractors

1. ZWF_REL_DOCS (Custom FM extractor, any nomenclature can be used)

This extractor is based on the function module RSAX_BBP_PROCDOC_GETDETAIL to extract related documents for a given RFx/Response/Contract.


Inputs 

  1. Create an extract structure ZWF_REL_EXTRACT with the following fields:
Component

Component Type

Data Type

Length

GUID_A

BBP_GUID

RAW

16

OBJID_A

BE_OBJECT_ID

CHAR

20

DOCDATE_A

BBP_DOC_DATE

DATS

8

OBJTYPE_A

SWO_OBJTYP

CHAR

10

LOGSYS_A

LOGSYS

CHAR

10

ROLETYPE_A

ROLETYPE

CHAR

10

GUID_B

BBP_GUID

RAW

16

OBJID_B

BE_OBJECT_ID

CHAR

20

DOCDATE_B

BBP_DOC_DATE

DATS

8

OBJTYPE_B

SWO_OBJTYP

CHAR

10

LOGSYS_B

LOGSYS

CHAR

10

ROLETYPE_B

ROLETYPE

CHAR

10

RELATED_RFX

BE_OBJECT_ID

CHAR

20

RELATED_RESPONSE

BE_OBJECT_ID

CHAR

20

  1. Create a function module ZRSAX_BBP_PROCDOC_GETDETAIL with the following interface:

IMPORTING

Parameter Name

Associated Type

Default Value

I_REQUNR

SRSC_S_IF_SIMPLE-REQUNR

                    

I_DSOURCE

SRSC_S_IF_SIMPLE-DSOURCE

                    

I_MAXSIZE

SRSC_S_IF_SIMPLE-MAXSIZE

                    

I_INITFLAG

SRSC_S_IF_SIMPLE-INITFLAG

                    

I_READ_ONLY

SRSC_S_IF_SIMPLE-READONLY

                    

I_REMOTE_CALL

SBIWA_FLAG

SBIWA_C_FLAG_OFF

TABLES

Parameter

Associated Type

I_T_SELECT

SRSC_S_IF_SIMPLE-T_SELECT

I_T_FIELDS

SRSC_S_IF_SIMPLE-T_FIELDS

E_T_DATA

ZWF_REL_EXTRACT

Processing (pseudo code)

  1. Read all the documents from crmd_orderadm_h into table lt_head
  2. Loop through lt_head into ls_head
a. Call function module ‘BBP_PROCDOC_GETDETAIL’ to get the related documents into lt_header_rel for ls_head-guid
  1. b. Append entries from lt_header_rel into e_t_data
  2. a. If <fs_header_rel>-objtype_a EQ ‘BUS2200’ (RFx)
  3. i. Assign <fs_header_rel>-objid_a to <fs_header_rel>-related_rfx
  4. ii. Assign blank to <fs_header_rel>-related_response
  5. b. If <fs_header_rel>-objtype_a EQ ‘BUS2202’ (RFx Response)
  6. i. Read table lt_e_t_data where guid_b = <fs_header_rel>-guid_a and objtype_a = ‘BUS2200’. This will return the preceding document (RFx).
  7. ii. Assign <fs_header_rel>-related_rfx = lt_e_t_data-objid_a
  8. iii. Assign <fs_header_rel>-related_response = <fs_header_rel>-objid_a
  9. c. If <fs_header_rel>-objtype_b EQ ‘BUS2000113’ (Contract)
  10. i. <fs_header_rel>-related_response = <fs_header_rel>-objid_a.
  11. ii. Read table lt_e_t_data where guid_b = <fs_header_rel>-guid_a and objtype_a = ‘BUS2200’.
  12. iii. Assign <fs_header_rel>-related_rfx = lt_e_t_data-objid_a.
  1. Copy e_t_data to lt_e_t_data
  2. Loop through e_t_data assigning <fs_header_rel>

2. ZSRM_DOC_GETDETAIL (Custom FM extractor, any nomenclature can be used)


This extractor is based on the function module  RSAX_SRM_DOC_GETDETAIL to extract the following details for an SRM document.

  1. Created date and time
  2. Object Type
  3. Purchasing Organization
  4. Purchasing Group
  5. Process type
  6. Process subtype
  7. Smart Number
  8. Bidder
  9. Bidder name
  10. Version

Inputs  (attach record layout if applicable)

  1. 1. Create an extract structure ZSRM_DOC_DETAILS with the following fields:

Component

Component Type

Data Type

Length

GUID

CRMT_OBJECT_GUID

RAW

16

OBJECT_ID

CRMT_OBJECT_ID_DB

CHAR

10

CREATED_ON

SYSTDATLO

DATS

8

CREATED_AT

SYSTTIMLO

TIMS

6

CREATED_BY

CRMT_CREATED_BY

CHAR

12

OBJECT_TYPE

CRMT_SUBOBJECT_CATEGORY_DB

CHAR

10

PROC_ORG

BBP_PROC_ORG_ID

CHAR

12

PROC_GROUP

BBP_PROC_GROUP_ID

CHAR

12

PROCESS_TYPE

CRMT_PROCESS_TYPE_DB

CHAR

4

PROCESS_SUBTYPE

ZZHELPDESK

CHAR

15

SMART_NUMBER

CRMT_PROCESS_DESCRIPTION

CHAR

40

BIDDER_ID

BU_PARTNER

CHAR

10

BIDDER_NAME

BU_NAMEOR1

CHAR

40

VERSION_NO

BBP_VERSION_NO

CHAR

8

  1. 2. Create a function module ZRSAX_SRM_DOC_GETDETAIL with the following interface.

IMPORTING

Parameter Name

Associated Type

Default Value

I_REQUNR

SRSC_S_IF_SIMPLE-REQUNR

                    

I_DSOURCE

SRSC_S_IF_SIMPLE-DSOURCE

                    

I_MAXSIZE

SRSC_S_IF_SIMPLE-MAXSIZE

                    

I_INITFLAG

SRSC_S_IF_SIMPLE-INITFLAG

                    

I_READ_ONLY

SRSC_S_IF_SIMPLE-READONLY

                    

I_REMOTE_CALL

SBIWA_FLAG

SBIWA_C_FLAG_OFF

TABLES

Parameter Name

Associated Type

I_T_SELECT

SRSC_S_IF_SIMPLE-T_SELECT

I_T_FIELDS

SRSC_S_IF_SIMPLE-T_FIELDS

E_T_DATA

ZSRM_DOC_DETAILS

Processing (pseudo code)

  1. Select guid, object_id, created_at, created_by and object_type from crmd_orderadm_h into table lt_head.
  2. Read crmd_link table into t_link_h for all guid in lt_head, objtype_hi = ’05’ and objtype_set = ‘07’ to get the partners
  3. Get Partner Functions for Vendor (Partner Type: 0012) and Bidder (Partner Type: 0011) through function module call BBP_PARTNER_TYPE_TO_FUNCTION
  4. Move entries from t_link_h to lt_link where objtype_set = ‘07’
  5. Select guid partner_fct, partner_no and partner_guid into table lt_part_link from table crmd_partner for all guid in lt_link, partner_fct = ‘00000018’ or ‘00000019’ and disabled = ‘’.
  6. Select partner_guid, valid_from and valid_to into table lt_relevant_part_t from table bbp_pdbgp for all partner_guid in lt_part_link.
  7. Delete invalid/expired partners from lt_part_link comparing lt_relevant_part
  8. Select partner, partner_guid and name_org1 from but000 into table lt_but000 for all partner_no in lt_part_link.
  9. Loop through lt_but000 and populate table t_bup_h with partner, partner_guid and name_org1.
  10. Loop through lt_head into ls_head
a. Call function module BBP_PROCDOC_GETDETAIL exporting ls_head-guid and import header data (s_header) and org data (table lt_orgdata)
  1. b. Assign lt_orgdata-proc_org_id to e_t_data-proc_org
  2. c. Assign lt_orgdata-proc_group_id to e_t_data-proc_group_id
  3. d. Read table t_bup_h where guid_hi = ls_head-guid
  4. e. If ls_head-object_type = ‘BUS2202’
  5. i. Assign t_bup_h-partner-bidder_id to e_t_data-bidder_id.
  6. ii. Assign t_bup_h-partner_name to e_t_data-bidder_name.
  7. f. If ls_head-object_type = ‘BUS2000113’

                        Assign t_bup_h-partner-vendor_id to e_t_data-bidder_id.

                        Assign t_bup_h-partner-partner_name to e_t_data-bidder_name.

  1. g. Assign s_header-version_no to e_t_data-version_no
  2. h. Assign s_header-description to e_t_data-smart_number
  3. i. Assign s_header-process_type to e_t_data-process_type
  4. j. Assign s_header-helpdesk_number to e_t_data-process_subtype
  5. k. Assign ls_head-guid to e_t_data-guid
  6. l. Assign ls_head-object_id to e_t_data-object_id
  7. m. Assign ls_head-created_by to e_t_data-created_by
  8. n. Assign ls_head-object_type to e_t_data-object_type
  • o. Convert timestamp ls_head-created_at into date and time through function module IB_CONVERT_FROM_TIMESTAMP and assign to e_t_data-created_on and e_t_data-created_at.
  1. Loop through e_t_data and assign object type text to e_t_data-object_type based on e_t_data-object_type.

References

http://wiki.sdn.sap.com/wiki/display/BPX/Workflow

http://wiki.sdn.sap.com/wiki/display/BPX/BPX+ccBPM

http://wiki.sdn.sap.com/wiki/display/BPX/BPX+Business+Workflow

6 Comments
Labels in this area