Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Reflecting to every marketing document

Hi Experts,

This is my SP Query .This query is made for only for  Production order .This query is executing perfectly.

While adding marketing documents more than 19 documents . And SP Query is Reflecting here. How i can overcome this problem

I want this query only in production order not in other documents.

If @object_type='202' and @transaction_type='a'            

declare @doc int

set @doc=(select count(DocNum) from OWOR where Status like '%[pr]' )

BEGIN

if  exists( select T1.[DocNum]  FROM  OWOR T1  where T1.[DocEntry]=@list_of_cols_val_tab_del and @doc>=19)

         BEGIN

            SET @error=-1

            SET  @error_message=N'Open work order Exceeds 19 Orders'

         END

END

Please Help me

Regards

Ram

Former Member
Former Member replied

Hi

Now I understand the problem.

You need to put"BEGIN" after the condition and END at the end

use this query it should work

If @object_type='202' and @transaction_type='a'  

BEGIN         

declare @doc int

set @doc=(select count(DocNum) from OWOR where Status like '%[pr]' )

BEGIN

if  exists( select T1.[DocNum]  FROM  OWOR T1  where T1.[DocEntry]=@list_of_cols_val_tab_del and @doc>=19)

         BEGIN

            SET @error=-1

            SET  @error_message=N'Open work order Exceeds 19 Orders'

         END

END

END

shachar

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question