Mass Maintenance

Use Comparison Appovals

The Comparison Approval functionality allows the Review role user to see the current SAP field value as well as the value the field will be changed to as a result of the data entry process. The Review role can then easily compare the current state and the future state of records before any changes take place. The Review role has the ability to reject any changes and keep the original values.

NOTE: Advanced users such as Syniti consultants should configure the comparison approval feature as it requires knowledge of both SQL and SAP. Once configured, business end users assigned to the Review role can use the feature.

To configure and use comparison approvals:

  1. Create the template. Comparison approvals can be used for requests based on BDC Scripts, GUI Scripts and custom templates.
  2. Refer to Create a Template from the Templates Page for more information. To use comparison approvals with a custom template, a user must create the CompareIns stored procedure manually.
  3. Configure the Comparison Approval Setting
  4. Register the CompareIns Stored Procedure
  5. Create a Request for Comparison Approval
  6. Use the Comparison Approval Page

Once Mass Maintenance is set to use Comparison Approvals, when a template is generated, Mass Maintenance creates a stored procedure used to control the Comparison page in the cMass_Data database. The naming convention for the procedure is web[Template Name]CompareIns. To see the before and after data entries, the CompareIns stored procedure must be modified.

Refer to Sample Stored Procedure For Comparison Approval for an example of a modified stored procedure.

The stored procedure is used to insert what is currently in SAP (the dgSAP tables) to the Comparison staging table in cMass_Data for the request.

NOTE: Comparison approvals can be used on a template that also allows partial approvals. Refer to Perform a Partial Approval for more information.

Configure the Comparison Approval Setting

Access the Template (Role) page and enable a check box to allow Mass Maintenance to use comparison approvals.

To configure the comparison approval setting:

  1. Click Team on Navigation pane.
  2. Click Templates for a team.
  3. Click Roles for a template.
  4. Click Vertical View for the Review role.
  5. Click Approve and Finish Settings tab.
  6. Click the Use Comparison Approval Page check box to enable it.

Continue with Register the CompareIns Stored Procedure.

Register the CompareIns Stored Procedure

Next, register the CompareIns stored procedure to the Finish event for the Data Entry Role. The procedure will then run when the Data role user clicks the Finish button on the Request (Roles) page.

Refer to Sample Stored Procedure For Comparison Approval  for more information.

To register the CompareIns stored procedure:

  1. Click Team on Navigation pane.
  2. Click Templates for a team.
  3. Click Roles for a template.
  4. Click Events for the Data role.
  5. Click Rules next to the Finish event.

    NOTE: If no records exist, the page displays in add mode. Otherwise, click Add.

    View the field descriptions for the Template (Role Event Rule) page

  6. Enter a number in the PRIORITY field.

    NOTE: If multiple template role events are assigned, the priority determines the order the rules are run.

  7. Select dspCompose_Data from the DATA SOURCE ID list box.
  8. Select web[dspComposetemplatename]CompareIns from the RULE list box.
  9. Click Save.

Continue with Create a Request for Comparison Approval.

Sample Stored Procedure For Comparison Approval

These sample stored procedures are original and modified code for the CompareIns stored procedure that must be registered to the Template Role Event rule. Refer to Register the CompareIns Stored Procedure for more information.

A user modifies the original code as needed for each client’s business needs.

As shown in the sample original code of the stored procedure (below), the commented section that starts after the “BEGIN” statement lists the guidelines and the SQL Code that must be added to the modified code between the “BEGIN” and “END” statements.

If a comparison approval for a request uses partial approvals, the user should include additional code in the modified stored procedure.

This code displays below the comment

--Delete logic needed to support partial approval  

in the modified stored procedure sample below.

Original Sample

 

USE[dspCompose_Data]

GO

/****** Object:  StoredProcedure [dbo].[webAB_BDC_MM02Compare1CompareIns]    Script Date: 8/8/2013 11:15:32 AM ******/

SETANSI_NULLSON

GO

SETQUOTED_IDENTIFIERON

GO

ALTERPROCEDURE[dbo].[webAB_BDC_MM02Compare1CompareIns]

@RequestIDint

 AS

BEGIN

/* This Procedure is used for populating the ComparisonApproval page for a Template.

*

*  This procedure must be modified to correctly populate table ttAB_BDC_MM02Compare1Compare.

*  ttAB_BDC_MM02Compare1Compare should contain one record for each corresponding record

*  in the ttAB_BDC_MM02Compare1 table.

*

*  Records in ttAB_BDC_MM02Compare1Compare should contain the values currently in SAP

*  for the data inserted into ttAB_BDC_MM02Compare1.

*

*  The following are guidelines for modifying this procedure:

*  1) Delete any records from ttAB_BDC_MM02Compare1Compare for the current Request.

*  2) Delete any records from ttAB_BDC_MM02Compare1Compare where ID = an ID retrieved by the

*       select statement.  When requests are automatically created by partial rejection of

*       another request, ID values will be duplicates of IDs inserted for the original request.

*  3) Remove the SELECT statement delivered in this procedure.

*  4) Insert into ttAB_BDC_MM02Compare1Compare by joining ttAB_BDC_MM02Compare1 with

*     all source tables or views originally used to populate ttAB_BDC_MM02Compare1.

*     -- Key fields should be populated from ttAB_BDC_MM02Compare1Compare.

*     -- Data fields should be populated from the original source(s).

*     -- Limit the Select/Insert to the current RequestID.

*/

SELECT''WHERE 1 = 0

END

 

Modified Sample

 

USE[dspCompose_Data]

GO

/****** Object:  StoredProcedure [dbo].[webAB_BDC_MM02Compare1CompareIns]    Script Date: 8/14/2013 2:18:42 PM ******/

SETANSI_NULLSON

GO

SETQUOTED_IDENTIFIERON

GO

ALTERPROCEDURE[dbo].[webAB_BDC_MM02Compare1CompareIns]

@RequestIDint

 AS

BEGIN

/* This Procedure is used for populating the ComparisonApproval page for a Template.

*

*  This procedure must be modified to correctly populate table ttAB_BDC_MM02Compare1Compare.

*  ttAB_BDC_MM02Compare1Compare should contain one record for each corresponding record

*  in the ttAB_BDC_MM02Compare1 table.

*

*  Records in ttAB_BDC_MM02Compare1Compare should contain the values currently in SAP

*  for the data inserted into ttAB_BDC_MM02Compare1.

*

*  The following are guidelines for modifying this procedure:

*  1) Delete any records from ttAB_BDC_MM02Compare1Compare for the current Request.

*  2) Delete any records from ttAB_BDC_MM02Compare1Compare where ID = an ID retrieved by the

*        select statement.  When requests are automatically created by partial rejection of

*        another request, ID values will be duplicates of IDs inserted for the original request.

*  3) Remove the SELECT statement delivered in this procedure.

*  4) Insert into ttAB_BDC_MM02Compare1Compare by joining ttAB_BDC_MM02Compare1 with

*     all source tables or views originally used to populate ttAB_BDC_MM02Compare1.

*     -- Key fields should be populated from ttAB_BDC_MM02Compare1Compare.

*     -- Data fields should be populated from the original source(s).

*     -- Limit the Select/Insert to the current RequestID.

*/

DELETEFROM  ttAB_BDC_MM02Compare1CompareWHERERequestID=@RequestID

 

--Delete logic needed to support partial approval 
DELETE FROM   ttAB_BDC_MM02Compare1Compare

WHEREIDIN(SELECTIDFROMttAB_BDC_MM02Compare1WHERERequestID = @RequestID)

 

INSERTINTOttAB_BDC_MM02Compare1Compare

([ID],

[RequestID],

[RMMG1-MATNR],

[MARA-BISMT],

[MARA-EXTWG],

[MARA-LABOR],

[MARA-BEGRU],

[MARA-BRGEW],

[MARA-GEWEI],

[MARA-NTGEW],

[MARA-WRKST])

 

SELECT

dbo.ttAB_BDC_MM02Compare1.ID,

dbo.ttAB_BDC_MM02Compare1.RequestID,

dbo.ttAB_BDC_MM02Compare1.[RMMG1-MATNR],

dgSAP.dbo.MARA.BISMT,

dgSAP.dbo.MARA.EXTWG,

dgSAP.dbo.MARA.LABOR,

dgSAP.dbo.MARA.BEGRU,

dgSAP.dbo.MARA.BRGEW,

dgSAP.dbo.MARA.GEWEI,

dgSAP.dbo.MARA.NTGEW,

dgSAP.dbo.MARA.WRKST

FROM  dbo.ttAB_BDC_MM02Compare1INNERJOINdgSAP.dbo.MARAONdbo.ttAB_BDC_MM02Compare1.[RMMG1-MATNR]=dgSAP.dbo.MARA.MATNR

WHEREdbo.ttAB_BDC_MM02Compare1.RequestID=@RequestID

 

END

Create a Request for Comparison Approval

Create requests based on the template following the standard procedure. Refer to Create Requests for more information.

Continue with Use the Comparison Approval Page.

Use the Comparison Approval Page

The Comparison Approval functionality allows the Review role user to see both the current SAP field value as well as the value the field will be changed to during the review process.

To view the comparison:

  1. Select Request from Navigation pane.
  2. Click Roles for the request that uses Comparison Approvals.
  3. Click Data Entry for the Review Role.

NOTE: The data elements that were changed display. The original value is first next to a green arrow and the changed value displays after the arrow.

The Review role can reject a change by clicking the REJECT check box to enable it for the record, or edit data by clicking Edit, making an update and then clicking Save.

After Comparison Approval is complete, the request can be processed like any other request. Refer to Review Request Data, Correct Rejected Records and Post Request Data to the Target ERP System for more information.