Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
5,612

1.     Introduction

In Audit management module of SAP it is necessary to show text (Value text) for the different audit

objects. The value text for the audit objects which have permitted input values will be displayed

automatically. This was implemented in the standard BADI implementation PLM_AUDIT_OBJECT_63

of the BADI PLM_AUDIT_OBJECT for the audit objects with input help for audit object as

63 SAP Standard implementation: specify value table as in customizing. For Audit objects

which reference SAP tables for values instead of permitted input values the value text won’t get

displayed.To display the value text for these audit objects we need to implement the logic

in the implicit enhancement present within the standard implementation PLM_AUDIT_OBJECT_63.

2.     Business Description

Displaying the value text descriptions for audit objects are a mandatory requirement to the system

from the business, from a user point of view.

3.     Configuring an Audit Type

Let us have some hindsight of configuring an audit type so that we can have some knowledge on the

input help for audit object.

Go to transaction SPRO 

SAP Reference IMG---->Cross Application components---->Audit management---->Audit Definition----> Audit Type

Or go to the transaction PLMC_AUDIT.

Audit Definition---->Audit Type

Click on new entries.

Provide the audit type and its name. Select the audit usage, audit category, input values, status profile and

structure type from the dropdown list.

The value selected in the Input values determines the filter type that needs to be used for the BADI implementation.

For example the value selected here “SAP Standard implementation: Specify value table as in customizing” is

assigned to the filter type 63 of the BADI PLM_AUDIT_OBJECT.

 

Select the created audit type and assign the input fields (Audit Object) for that audit type by selecting the input

fields for audit type.

You will be navigated to the following screen.

Click on the new entries and add the audit objects to the audit type.

Provide the object, description, data element, object type, value table, field name and search help

for the audit object.

When the value table and field is given this audit object can only have values that exist

in the value table.

Now we will create an audit object which will have the permitted input values.

Create an audit object and select it then select the permitted input values. We don’t need

to provide any other values like data element for audit objects that have permitted input

values.

You will be navigated to the following screen.

Click on new entries.

Provide the input values for the audit object. This audit object will only have values provided here.

Go to the transaction PLMD_AUDIT and create an audit.

Select the audit type as Sample audit object which we have created.

Now provide the values for the audit objects Material and Business unit.

Now we can see that for the audit object Business unit  that have permitted input values

the value text (Chennai) is displayed beside it while for the audit object Material which

have values from the table, the value text is not getting displayed.

To display the values text for the audit object Material we need to implement the logic

in the implicit enhancement of the method GET_VALUE_SHORT_TEXTS of standard

BADI implementation PLM_AUDIT_OBJECT_63 of the BADI PLM_AUDIT_OBJECT.

4.     Implementing the BADI

BADI: PLM_AUDIT_OBJECT

Implementation: PLM_AUDIT_OBJECT_63

Implementing Method: GET_VALUE_SHORT_TEXTS

Parameters of the Method:

Parameter

Type

Description

FLT_VAL

Importing

Filter value (63 in our case)

IO_AUDIT

Importing

Audit - Assignment

IV_AUDIT_TYPE

Importing

Audit Type (A1 in our case)

IT_AUDIT_OBJ_CUST

Importing

Parameters of audit object (created in SPRO)

IO_PROJECT

Importing

Project Planning: Projects

CT_PLMT_AUDIT_OBJECT_UI

Changing

Table with Dialog Structure for Audit Object

Create an implicit enhancement implementation in the method GET_VALUE_SHORT_TEXTS of

the BADI in the enhancement spot present after the function module.

 

We can fetch the value text (description) based on any one of the following attributes of the audit object.

1.       1. Value table name and/or its field – will be present in the import parameter

              IT_AUDIT_OBJ_CUST fields Value_tab_name and  value_tab_field.

2.       2. Data element - will be present in the import parameter IT_AUDIT_OBJ_CUST

              field Data_element

3.      3. Audit object name - will be present in the import parameter IT_AUDIT_OBJ_CUST

             fields Auditobject_text

The value text for the audit objects which have permitted input values will be retrieved by the

function module PLM_AUDIT_OBJECT_PBO_CONVERT used in the standard implementation.

Fetch the Value text (description) for the audit objects (which have values from the table) from

the table using the value that will present in the changing parameter CT_PLMT_AUDIT_OBJECT_UI

field object_value.

The value present in the object_value field that to be used to fetch the value text from the table

may be type incompatible with the field in the table, particularly for the fields that use domain

which have conversion routine. Hence use the conversion exit to make the value type compatible

with the table field and then use this value to fetch the value text (description) from the table.

Update the field Value_text of the changing parameter CT_PLMT_AUDIT_OBJECT_UI with

the retrieved value text (description) of the value from the table.

Pseudo code

  LOOP AT ct_plmt_audit_object_ui INTO w_auobj_ui WHERE
                                              object_value
IS NOT INITIAL AND
                                              value_text
IS INITIAL.

* Get the value table of the object from the internal table it_audit_obj_cust


   
READ TABLE it_audit_obj_cust INTO w_auobj_cust WITH KEY
                                      object_type
= w_auobj_ui-object_type.
   
IF sy-subrc = 0.
     
CASE w_auobj_cust-value_tab_name.
       
WHEN 'MARA'.
           
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
             
EXPORTING
               
input  = w_auobj_ui-object_value
             
IMPORTING
               
output = l_matnr.

SELECT SINGLE matnr maktx FROM makt INTO w_material WHERE matnr = l_matnr AND
                                                          spras
= lc_spras.
 
IF sy-subrc = 0.
   w_auobj_ui
-value_text = w_material-maktx.
  
MODIFY ct_plmt_audit_object_ui FROM w_auobj_ui TRANSPORTING value_text.
  
ENDIF.
 
ENDCASE.
ENDIF.

ENDLOOP.

Screen shot of the audit after the value text has been implemented.

Here we can see the value text displayed for the audit object Material.

1 Comment
Labels in this area