Skip to Content

SPT Not working

Dear Experts

i had created a SPT for blocking user who try to add Good issue with out Cost Center and Project, both are Mandatory.

but its not working could any one help me to solve it

Pls the attache SPT

Regards

IF @transaction_type IN ('A','U') AND @Object_type = '60'
BEGIN
IF EXISTS (SELECT T0.[DocEntry] FROM IGE1 T0  INNER JOIN OIGE T1 ON T0.[DocEntry] = T1.[DocEntry] WHERE T0.OcrCode IS NULL and T1.Project IS NULL and 
T0.DocEntry = @list_of_cols_val_tab_del)
BEGIN
SELECT @Error = 18, @error_message = 'Please Select the Cost Center or Project Code'
END
End
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 08 at 01:59 PM

    Hi,

    Try this,

    IF @transaction_type IN ('A','U') AND @Object_type = '60'

    BEGIN

    IF EXISTS (SELECT T0.[DocEntry] FROM IGE1 T0 INNER JOIN OIGE T1 ON T0.[DocEntry] = T1.[DocEntry]

    WHERE ISNULL(T0.OcrCode,' ') = '' and ISNULL(T1.Project,'')='' and T0.DocEntry = @list_of_cols_val_tab_del)

    BEGIN SELECT @Error = 18, @error_message = 'Please Select the Cost Center or Project Code'

    END

    End

    Add comment
    10|10000 characters needed characters exceeded