SAP B1 Check Dates ...
 
Notifications
Clear all

SAP B1 Check Dates Transaction Notification  

  RSS

Sathish Kumar
(@sathish)
Member Moderator
Joined: 4 months ago
Posts: 1203
30/03/2021 11:12 am  

I need help implementing a transaction notification for Outgoing Payments (OVPM) under the Payment Methods (VPM1) menu. I need an error message for when the user tries to set a Due Date prior to the current date. Thanks.

IF object_type = '46' AND transaction_type in ('A','U') THEN

SELECT T1."DueDate" INTO Fecha1 FROM VPM1 T1 INNER JOIN OVPM T0 ON T1."DocNum" = T0."DocEntry"

WHERE T0."DocEntry" = list_of_cols_val_tab_del;

IF DAYS_BETWEEN(CURRENT_DATE,Date1) < 0 THEN

error := 90008;

error_message := N'You are trying to set a prior date';

END IF;

END IF;


Quote
Ganesh A
(@ganesh)
Noble Member
Joined: 4 months ago
Posts: 1170
30/03/2021 11:12 am  

PLEASE TRY THIS

IF :Object_type ='46' and ( :transaction_type ='A' OR :transaction_type ='U') THEN
Declare temp_var_0 integer;
SELECT
(SELECT Count(*)
FROM OVPM T0
INNER JOIN VPM1 T1 ON T0."DocEntry" = T1."DocNum"
WHERE DAYS_BETWEEN(T1."DueDate", CURRENT_DATE)>1 and T0."DocEntry" = :list_of_cols_val_tab_del ) INTO temp_var_0 FROM DUMMY;
IF :temp_var_0 > 0 THEN
SELECT 1, 'You are trying to set a prior date' INTO Error, error_message FROM DUMMY;
END IF;
END IF;


ReplyQuote
Share: