on 2022 Mar 18 10:05 AM
Dear Experts,
How can I prevent someone remove a bill of material in the system? I user Sap business One ver. Hana.
Request clarification before answering.
Hi,
I would suggest using a TransactionNotification. You can try with the following code:
IF :object_type = N'4' AND :transaction_type = N'U' THEN
SELECT IFNULL(COUNT(T0."ItemCode"), 0) INTO BoM_cnt
FROM OITM T0
INNER JOIN AITM T1 ON T0."ItemCode" = T1."ItemCode" AND T1."LogInstanc" = (SELECT MAX(A0."LogInstanc") FROM AITM A0 WHERE A0."ItemCode" = T0."ItemCode")
WHERE T0."TreeType" = 'N' AND T1."TreeType" != 'N'
if :BoM_cnt > 0 THEN
begin
error := 1;
error_message := N'Bill of Materials cannot be deleted';
end;
end if;
end if;<br>
BR,
Matija
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just try this, 100% working.
IF :object_type = '66' AND :transaction_type = 'D' THEN
error := 672;
error_message := 'You are not authorised to Delete BOM';
END IF;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey
Please refer to these link for more information about your query.
https://answers.sap.com/questions/2581004/deletion-of-bom.html
(Above link explain activation of change management for BOM object)
https://answers.sap.com/questions/669006/unable-to-mark-bom-for-deletion.html
( This link will explain all ways of bom deletion which could be controlled through authorization restriction or screen variant to hide field which allows deletion flag etc.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
17 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.