cancel
Showing results for 
Search instead for 
Did you mean: 

SBO transaction notification for draft in

former_member522789
Participant
0 Kudos

Hello expert

I have a question

I made an SBO transaction notification to fill the REF2 field in OIGE & OIGN but there is now an approval procedure and the document is first created as a draft. As a consequence the stored procedure is not working and I need to update the transaction notification to include draft as well

I sanyone able to help to write the stored procedure below for draft in OIGE and OIGN ?

Thank you

If

@object_type ='59' and @transaction_type in ('A','U')



           

Begin



                 

If EXISTS



                       

(



                        

select DocEntry from OIGN



                             

where DocEntry = @list_of_cols_val_tab_del



                                    

and isnull(Ref2,'') = ''



                       

)                



                       

Begin



                             

set @error_message = 'Please fill in REF. 2 field with shift+F2'



                             

set @error = 1



                       

END



           

END

Accepted Solutions (1)

Accepted Solutions (1)

KennedyT21
Active Contributor
0 Kudos

HI

Try This....

For both Goods Issue & Goods Receipt

IF @object_type ='112' and @transaction_type in ('A','U')

Begin

If EXISTS

     (

select DocEntry from odrf

Where DocEntry = @list_of_cols_val_tab_del

and  ref2 is null and ( ObjType='60' or ObjType='59')

)              

Begin

set @error_message = 'Please fill in REF. 2 field with shift+F2'

set @error = 1

END

END

Regards

Kennedy

KennedyT21
Active Contributor
0 Kudos

Hi ,

Does the issue is solved or not....

Regards

Kennedy

Answers (4)

Answers (4)

former_member218051
Active Contributor
0 Kudos

Hi G. Delanoe,

Even if Ref2 field is left blank while punching receipt and or issue. Document goes for approval and got saved as draft.

After approval it will be converted into a valid document at that time of adding it by the originator why SPTN is not firing ?

And if document did not go for approval then obviously SPTN has to fire.

The issue is not clear to me.

Thanking you

Malhaar

former_member209066
Active Contributor
0 Kudos

Hi,

All Draft Document Stored in The ODRF,DRF1

Create the Store Procedure in This Tables

Thanks,

Nithi

former_member211460
Participant
0 Kudos

Hi Nithi

I followed your instrucicones but does not work, does not validate the TN

TN itself, if it works ¡

I'm Doing Wrong?

IF (@object_type = 60) and @transaction_type in ('A','U')

BEGIN
     DECLARE @Linea as int
     SELECT TOP 1 @Linea = T1.LineNum+1
     FROM ODRF T0 INNER JOIN DRF1 T1 ON T1.DocEntry = T0.DocEntry INNER JOIN OACT ON T1.AcctCode = OACT.AcctCode
     WHERE T0.DocEntry = @list_of_cols_val_tab_del AND ISNULL(T1.OcrCode,'')=''
     and (T1.[AcctCode] BETWEEN N'_SYS00000000267' AND N'_SYS00000000354')
          
          
     IF @Linea >= 1 
     BEGIN
          SET @error = 101
          SET @error_message = 'Error en Linea Centro de Costos obligatorio'
     END
END

Former Member
0 Kudos

Hi,

Approval and SP_TN is mutually exclusive. They may not co-exist.

Thanks,

Gordon

Former Member
0 Kudos

Hi......

Try this............

IF (@object_type = '112' And (Select ObjType From ODRF

       Where DocEntry = @list_of_cols_val_tab_del)='59'

AND @transaction_type IN ('A'))

BEGIN

Begin  

If EXISTS

                       

(

                  

select DocEntry from OIGN

where DocEntry = @list_of_cols_val_tab_del   

and isnull(Ref2,'') = ''     

)                               

Begin

set @error_message = 'Please fill in REF. 2 field with shift+F2'     

set @error = 1             

END   

END

Regards,

Rahul