cancel
Showing results for 
Search instead for 
Did you mean: 

SBO Transaction Checking Problem in Good Receipt

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In the SP_TN, is U type included?

Thanks,

Gordon

Former Member
0 Kudos

Yes. And I am not updating the existing document. It happens when I add a new document after previous successful document. Thanks for reply.

Former Member
0 Kudos

May you post your SP here for checking?

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Thankyou so much Gordon~~ Problem Solved!

Would u mind explain a little bit what mistake I did? I am a beginner in SQL...

Appreciated~

Former Member
0 Kudos

Compare two codes, you will know.

Answers (0)