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

Query question: FMS DueDate - Leadtime in recommendations ORCM

0 Kudos
624

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.

Accepted Solutions (0)

Answers (6)

Answers (6)

0 Kudos

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

😞

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

🙂

Abdul
Active Contributor
0 Kudos

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

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Instead of FMS, can you try with transaction notification?

Regards,

Nagarajan

HectorSantos
Active Participant
0 Kudos

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

newbiesap1
Discoverer
0 Kudos

how to join ORCM and PRQ1