Skip to Content

Query question: FMS DueDate - Leadtime in recommendations ORCM

Hello,

I have a problem with a query for a Formatted Search in the recommendations-Window (ORCM)

SELECT $[$3.3.0]-$[$3.1250002010.0]

or:

SELECT $[ORCM.DueDate] - $[OITM.LeadTime]

The Error is:

operand data type varchar is invalid for subtract operator

I want to avoid the SAP-Error that the Duedate must be equal or earlier then Startdate.
My collegues often do some changes in the recommendations and after they setup an earlier DueDate before creation of a Productorder... SAP blocks with an error.

What is my mistake ?

Thanks for your help.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Feb 15 at 02:58 PM

    Hello Markus

    the ORCM.DueDate field is a date field and OITM.LeadTime field is an integer field. You must use a special SQL command such as dateadd

    Regards

    Hector

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 16 at 03:40 AM

    Hi,

    Instead of FMS, can you try with transaction notification?

    Regards,

    Nagarajan

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 18 at 02:34 PM

    You cannot do direclty in query you have to use date add or date diff dunction

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 07 at 04:46 PM

    Hi Hector, Hi Abdul

    thanks for the idea...

    now it works:

    Select 
    Case
    When ISNULL((Select ISNULL(LeadTime,0) from OITM where ItemCode = $[$3.7.0]),0) = 0 
    Then Convert(date, $[$3.3.0], 104)
    Else
    DATEADD(day, (-1)*(Select LeadTime from OITM where ItemCode = $[$3.7.0]), Convert(date, $[$3.3.0], 104))
    End

    :)

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 07 at 04:50 PM

    The FMS works fine, but the SAP-automation of Startdate and DueDate does not allow any flexible reworking and editing of the dates.

    :(

    Add comment
    10|10000 characters needed characters exceeded