cancel
Showing results for 
Search instead for 
Did you mean: 

QM PLM Audit - make an audit object(s) a mandatatory field

ashelk
Explorer
0 Kudos
698

I need to make some audit objects by audit creation to be mandatory to enter. At the moment the default behaviour of the system is just to give a warning if nothing was entered for an audit object and further saving and processing of the audit is possible.

What I need to do is that empty values should not be allowed for some audit objects, error message should be shown and saving of the audit would not be allowed.

Please advise on the solution of this problem.

Accepted Solutions (1)

Accepted Solutions (1)

AlbertMolnar
Product and Topic Expert
Product and Topic Expert

Dear Alexander Schell,

thank you for the details provided.

The default message type is warning for the message PLM_AUDIT025.

Relevant code:

...
*/Check is only possible if audit type is known
  CHECK NOT me->audit_attributes-audit_type IS INITIAL.

*/Set message type (used only for checking whether object is provided;
*/non-existing object always results in error message)
  lv_msgty = iv_msgty.
  IF lv_msgty IS INITIAL.
    lv_msgty = cgplc_con_msg_warning.
  ENDIF.
...
*/    check if all object values are given (obligatory field)
      IF ls_plmm_audit_obj-object_value IS INITIAL.
*/      no object defined yet
        MESSAGE e025(plm_audit)
                WITH lr_audited_object->m_auditobject_text
                INTO lv_msgtext.
        CALL METHOD cl_cgpl_application_log=>message_add
          EXPORTING
            im_msgty = lv_msgty
            im_msgid = sy-msgid
            im_msgno = sy-msgno
            im_msgv1 = sy-msgv1.
        lv_result = 'E'.
        MOVE lv_result TO cv_result.
...<br>

Relevant background for above code:

-Class/Interface: CL_PLM_AUDIT_ASSIGNMENT

--Method: CHECK_AUDITED_OBJECT

---Parameter: IV_MSGTY

----> default value 'W'

Type group CGPLC Active (CGPL PLanung: Definition von Konstanten)

...
* Messagetypes<br>...
cgplc_con_msg_warning  TYPE c VALUE 'W',
...

*****

Nevertheless, if you wish to influence the audit objects, there is BAdI PLM_AUDIT_OBJECT (Standard Implementation of Audit Object: Cust. Value Table). You might trigger an error there. Or modify the standard code referred above.

Have a nice day,

Albert

***
Read and follow the 'SAP Community Rules of Engagement' at
https://www.sap.com/community/about/rules-of-engagement.html

Answers (3)

Answers (3)

ashelk
Explorer

Dear Albert,

thank you very much for the hint.

I have also already found myself that this is a 'hard-coded' constant 'W' which gives back a warning message.

Also found a note that SAP intentionally changed this behaviour: 1158350

Saving of the audit is allowed and the error message is only issued when an audit is released.

ashelk
Explorer
0 Kudos

I was checking evertything in Customizing.

Audit Object in not in the list of available activities:



Audit Object is part of the Audit, but in Audit there are no fields which would relate to it:

holger_hartung
Contributor
0 Kudos

Hello,

please check Customizing , Systemanpassung, Feldauswahl