on 12-12-2011 7:59 AM
Dear Sir/Madam,
I found a strange problem after I did a checking in SBO Transactions. My target document is Good Receipt and Good Issue.
My environment:
SAP 8.81 Patch 06
SQL 2008
What i did is:
1. Add UDF in header level -> Reasoncode which linked to UDT with Reasoncode and Acctcode
2. Add a formatted search to Reasoncode then corresponding account of all items will be changed.
3. Edit SBO Tran to check if the Reasoncode is selected. If it's NULL, Error message will come up and document is not able to add.
Problem:
This checking work fine when adding the Good Receipt with Reasoncode selected for the first time. However, if I continue stock in with Good Receipt (after successful adding previous document) and trying NOT to select the Reasoncode, the checking is not working.
Good Receipt alone WITHOUT Reasoncode, Error.
Good Receipt alone WITH Reasoncode, OK.
Good Receipt (after successful previous document) WITHOUT Reasoncode, OK ---> ??
Good Receipt (after successful previous document) WITH Reasoncode, OK
Thanks for any response.
William
Hi,
In the SP_TN, is U type included?
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good Receipte--
IF (@object_type = '59' AND (@transaction_type = 'A' or @transaction_type = 'U'))
BEGIN
IF EXISTS(
SELECT 1
FROM OIGN INNER JOIN IGN1 ON OIGN.DocEntry = IGN1.DocEntry AND OIGN.DOCEntry = @list_of_cols_val_tab_del
WHERE ( OIGN.U_ReasonCodeH = NULL or OIGN.U_ReasonCodeH = '')
)
BEGIN
SET @error = 100
SET @error_message = '"No Reason Code!!"!'
END
END
-
Thankyou for reply
Try:
IF @object_type = '59' AND @transaction_type IN ('A', 'U')
BEGIN
IF EXISTS (SELECT 1
FROM OIGN T0 INNER JOIN IGN1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T0.DOCEntry = @list_of_cols_val_tab_del AND ISNULL(T0.U_ReasonCodeH,'') = '')
BEGIN
SET @error = 59
SET @error_message = '"No Reason Code!!"!'
END
END
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.