on 2023 May 26 12:01 PM
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.
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
please check Customizing , Systemanpassung, Feldauswahl
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
59 | |
8 | |
8 | |
6 | |
5 | |
5 | |
4 | |
3 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.