Skip to Content

       1.    Introduction

Enhancements are the means by which we add our own/ modify existing functionality to SAP’s standard business applications.

Screen Enhancement means enhancing the Standard SAP Screen with the custom defined fields according to the customer Requirements.

In Audit Management, the BADI used for enhancing the standard screen with the custom defined fields is BADI_PLM_COR_CUSTOM_FIELDS.

Methods Implemented: SET_SCREEN_DATA

2.      Steps to  find the Business Add-Ins in Audit Management

             There are two ways to find the Business Add-Ins

Direct Method:

We can find the BADI by keeping the breakpoint inside the method CL_EXITHANDLER -> GET_INSTANCE and execute the transaction PLMD_AUDIT.

  Alternate Method:

Go to Transaction Code: PLMC_AUDIT

/wp-content/uploads/2013/04/1_205448.jpg

Expand the Tree Structure “System Adjustment” in which all the Business Add-Ins will be shown.

/wp-content/uploads/2013/04/2_205449.jpg

We can see the functionality of the BADI by Clicking  the button/wp-content/uploads/2013/04/3_205450.jpg .

/wp-content/uploads/2013/04/4_205454.jpg

3.      Methods to create Corrective Action.

Transaction Code for Audit: PLMD_AUDIT

3.1          Creating an Audit

Go to Create –> Audit.

/wp-content/uploads/2013/04/5_205455.jpg

3.2         Creating a Question List

The Audit should be assigned to the Question List. Go to Audit–> Right click–>Create –>Audit Question.

/wp-content/uploads/2013/04/6_205456.jpg

Hierarchy Profile should be filled with values.

/wp-content/uploads/2013/04/7_205457.jpg

4.    Creating a Corrective Action

Two   ways of Creating a Corrective   Action.

a)      Creating from Questions List

b)      Creating directly from node

 

4.1        Creating Corrective Action  from Question List

We can create the Corrective Action from the Question List page.

We have two options in the View Selection

a)      Details

b)      Valuation

Click on the Valuation Button, we have an option of creating the Corrective Action.

/wp-content/uploads/2013/04/8_205458.jpg

4.2        Creating  Corrective Action directly from node

After Creating the Question List, We can right click on the Question list and create a Corrective Action from here.

/wp-content/uploads/2013/04/9_205459.jpg

5.      Process Overview

Corrective Action will have the Screen as shown below.

/wp-content/uploads/2013/04/10_205469.jpg

When the user creates a Corrective Action in the Transaction PLMD_AUDIT, the Additional Fields highlighted below should be added to the BASIC DATA Tab.

/wp-content/uploads/2013/04/11_205470.jpg

When the user creates a Corrective Action in the Transaction PLMD_AUDIT, the Additional Text Types highlighted below should be added to the TEXTS Tab.

/wp-content/uploads/2013/04/12_205471.jpg

6.    Additional Fields in BASIC DATA TAB

Create a Module Pool Program   and design a screen with all the additional fields.

/wp-content/uploads/2013/04/13_205472.jpg

Create a BADI Implementation for Enhancement Spot BADI_PLM_COR_CUSTOM_FIELDS

/wp-content/uploads/2013/04/14_205473.jpg

We can see   two nodes created under our Implementation.

Ø  Implementing Class

Ø  Screen Enhancements

Implementing Class

Inside implementing class we can have all the methods of the class in which coding can be done.

/wp-content/uploads/2013/04/15_205474.jpg

We have to pass the data from module pool to the methods of class. While passing the data from Module Pool Program to the BADI Implementation, the values disappeared. The reason behind that is there is no data visibility between the screen and the Methods of the class. So, we created two function modules for importing and exporting the data. While creating a Corrective Action, a unique key will be created. A custom table is created with the unique key for saving all the values of the Corrective Actions. The values of the Additional fields are moved to the global variables of the function Group.

Screen Enhancements

Under Screen Enhancements our module pool program name and the Subscreen number should be assigned to the standard program.

/wp-content/uploads/2013/04/16_205476.jpg

Pseudo code

While creating a Corrective Action, a unique key will be created. A Custom table is created for saving all the values of the Corrective Actions. From Module pool program the values of the Additional fields are moved to the global variables of the function Group. Then we can export the data from Global variables based on the unique key.

SELECT SINGLE yycorno FROM   yplm_refnumber INTO w_cor WHERE yycorno = plmt_audit_act_uiexternal_id.
  IF sysubrc NE 0.
    MOVE plmt_audit_act_uiexternal_id TO w_coryycorno.
    INSERT INTO  yplm_refnumber  VALUES w_cor.
  ENDIF.

  IF plmt_audit_act_uiyytype IS NOT INITIAL.
    w_flag = wc_x.
    CALL FUNCTION ‘Y_PLM_FIELDS_SET’
      EXPORTING
        i_corno     = plmt_audit_act_uiexternal_id
        i_type      = plmt_audit_act_uiyytype
        i_desc      = plmt_audit_act_uiyydescription
        i_category  = plmt_audit_act_uiyycategory
        i_catdesc   = plmt_audit_act_uiyycat_desc
        i_error     = plmt_audit_act_uiyyerrorcode
        i_ecode     = plmt_audit_act_uiyyecode
        i_err_desc  = plmt_audit_act_uiyyerr_desc
        i_cause     = plmt_audit_act_uiyycausecode
        i_ccode     = plmt_audit_act_uiyyccode
        i_cau_desc  = plmt_audit_act_uiyycau_desc
        i_reftype   = plmt_audit_act_uiyyref_type
        i_refdesc   = plmt_audit_act_uiyyref_desc
        i_refnumber = plmt_audit_act_uiyyref_number
        i_flag      = w_flag.
ENDIF.

Inside the method SET_SCREEN_DATA of the BADI Implementation we export  the global variables from the module pool program.

Pseudo code

METHOD if_ex_plm_cor_custom_fields~set_screen_data.

CALL FUNCTION ‘Y_PLM_FIELDS_GET’
    EXPORTING
      i_corno     = is_plmt_audit_act_uiexternal_id
    IMPORTING
      e_type      = is_plmt_audit_act_uiyytype
      e_desc      = is_plmt_audit_act_uiyydescription
      e_category  = is_plmt_audit_act_uiyycategory
      e_catdesc   = is_plmt_audit_act_uiyycat_desc
      e_error     = is_plmt_audit_act_uiyyerrorcode
      e_ecode     = is_plmt_audit_act_uiyyecode
      e_err_desc  = is_plmt_audit_act_uiyyerr_desc
      e_cause     = is_plmt_audit_act_uiyycausecode
      e_ccode     = is_plmt_audit_act_uiyyccode
      e_cau_desc  = is_plmt_audit_act_uiyycau_desc
      e_reftype   = is_plmt_audit_act_uiyyref_type
      e_refdesc   = is_plmt_audit_act_uiyyref_desc
      e_refnumber = is_plmt_audit_act_uiyyref_number.
  MOVE is_plmt_audit_act_ui TO w_plmt_audit_act_ui.
ENDMETHOD.

OUTCOME:

Additional Fields are added to the BASIC DATA Tab.

/wp-content/uploads/2013/04/17_205477.jpg

7.    Additional Fields in TEXTS TAB

When the user creates a Corrective Action in the Transaction PLMD_AUDIT, the Additional Text Types should be added to the TEXTS Tab.

Additional Text Types:

CAUSE:

      Whenever a Corrective Action is created, the user has to mention the cause for creating it, which makes the End User to understand the reason for Creating the Corrective Action.

PLAN:

    Whenever a Corrective Action is created, the user has to mention the plan for correcting it ,so that  End User understands that some planning activities has been done for correcting it.

/wp-content/uploads/2013/04/18_205482.jpg

Create a BADI Implementation for PLM_AUDIT_TEXT_ID

/wp-content/uploads/2013/04/19_205483.jpg

We can have the implementing class to incorporate our code.

/wp-content/uploads/2013/04/20_205487.jpg

Method CHECK_TDID is used to display the Text ID’s in the TEXTS Tab.Passing the newly added text types in the method CHECK_TDID.

Pseudo code

  Corrective Action: ‘COR’.

  WHEN ’COR’.
      MOVE ‘CAUSE’ TO ls_tdidtdid.
      CALL METHOD check_tdid
        EXPORTING
          i_tdid    = ls_tdidtdid
        RECEIVING
          r_tdid_ok = l_tdid_ok.
      IF l_tdid_ok = co_true.
        MOVE ‘X’ TO ls_tdidchangeable.
        APPEND ls_tdid TO et_tdid.
      ENDIF.

      MOVE ‘PLAN’ TO ls_tdidtdid.
      CALL METHOD check_tdid
        EXPORTING
          i_tdid    = ls_tdidtdid
        RECEIVING
          r_tdid_ok = l_tdid_ok.
      IF l_tdid_ok = co_true.
        MOVE ‘X’  TO ls_tdidchangeable.
        APPEND ls_tdid TO et_tdid.
      ENDIF.

OUTCOME:

Additional Text Types ‘CAUSE’ and ‘PLAN’ are added to the TEXTS Tab.

/wp-content/uploads/2013/04/21_205488.jpg

8.        Challenges

·        When the data is passed from the module pool program to the BADI Implementation there is no data visibility. So, a function group assigned with two function modules is created and the data is stored in a global variable in the function group.

To report this post you need to login first.

2 Comments

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

Leave a Reply