Skip to Content

Approval using User Queries

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 22, 2014 at 10:34 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 22, 2014 at 12:28 AM

    Hi,

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

    Thanks & Regards,

    Nagarajan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 22, 2014 at 01:21 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.