cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Query question: FMS DueDate - Leadtime in recommendations ORCM

0 Kudos
638

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.

View Entire Topic
0 Kudos

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

🙂