abapauditsap-erp

How to pre-sign and disable signature button, and make an Audit object a mandatory field?


There are a number of changes in PLM QM Audit module with which I am struggling at the moment.

First requirement: disable (deactivate) Signature button in the Result tab of the audit object and therefore also the pre-requirement to sign (click this button) in order to change the audit status to Complete:

Result tab

Second requirement is: make audit objects by audit creation to be mandatory to enter. At the moment the default behavior 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:

Audit objects

Maybe someone already has faced with these issues before.

Customizing settings / possibilities and some coding of the module were checked.


Solution

  • First requirement

    Not possible to implement in a delivered application (except of course the modification of the application code itself, but it is already far from standard functionality and is better to be avoided for maintainability / future compatibility reasons).

    What is possible, however, is to sign and close the audit in one step (set the status to Completed) by clicking on the Signature button. SAP Note 2694780

    To activate this behavior it is necessary to set the user parameter PLM_AUDIT_SIGN_COMPL to a non-empty value (i.e. to X).

    Second requirement

    As was discovered this is a standard behavior now and it was changed in the past: SAP Note 1158350

    Saving of the audit is allowed with empty audit objects, on this stage only warning messages are issued, and the error message is only issued when an audit is released.

    The relevant code:

    Class: CL_PLM_AUDIT_ASSIGNMENT
    Method: CHECK_AUDITED_OBJECT
    Parameter: IV_MSGTY default value 'W'

    ...
      " 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)
      " no object defined yet
      IF ls_plmm_audit_obj-object_value IS INITIAL.
        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.
    ...
    

    Type group CGPLC Active (CGPL Planung: Definition of Constants):

    ...
      cgplc_con_msg_warning  TYPE c VALUE 'W',
    ...
    

    There is also a BAdI PLM_AUDIT_OBJECT (Standard Implementation of Audit Object: Cust. Value Table) available, where it is possible to change the process.