cancel
Showing results for 
Search instead for 
Did you mean: 

Approval using User Queries

douglas_marroquin
Participant
0 Kudos

Hello everyone.

I need approval using User Queries on  Detail Sales Order  when User Field "U_DifSec" value change '02' (default value) to '01' at least one row.

This is the Query, but don't  function on SAP if running on SQL Managment studio do function very good.

Declare @conteodescuento int,

        @docentry int

Set @docentry=(select DocEntry FROM ORDR Where DocNum = $[$8.1.0])

Set @conteodescuento = (select count (*) from RDR1 Where docentry=@docentry and U_DifDesc='01' group by U_DifDesc, DocEntry)

--Check row by row and sumary when U_DifDesc = '01'

Select distinct 'true'

from  ORDR where Docnum = $[$8.1.0] and @conteodescuento >=1

-- trigger true when @conteodescuento >=1

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Approval will NOT be available to line table at all. Only the first line may be checked because approval only concern about header data.

Thanks,

Gordon

douglas_marroquin
Participant
0 Kudos

Hi Gordon,

All clear with your clarification.

SELECT Distinct 'true'

FROM dbo.OITM T0

WHERE T0.ItemCode = $[$38.1.0] and $[$38.U_DifDesc]='01'

This query function very good.  runs on first line when it is  true about condition

Very thanks

Answers (2)

Answers (2)

KennedyT21
Active Contributor
0 Kudos

Hi Douglas Marroguin...

Approval Procedure is not possible by the Row wise in the standard behaviour ...

try this work around

http://it.toolbox.com/blogs/sap-library/approval-procedures-line-level-and-header-level-part-1-9662

Hope Helpful

Regards

Kennedy

douglas_marroquin
Participant
0 Kudos

Hi Kenedy,

I understand, Can I try declare a var and return only integer value ?

by example...

Set @conteodescuento = (select count (*) from RDR1 Where docentry=@docentry and U_DifDesc='01' group by U_DifDesc, DocEntry)

to condition only result?

don´t Approval line by line, but approval the result only?.

Thanks.

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Approval procedure works only on header level not on row level. This is standard system design.

Thanks & Regards,

Nagarajan

douglas_marroquin
Participant
0 Kudos

Thanks.