I am having a little trouble with a UDF and a FMS search at the moment and am hoping somebody can help me.
The UDF created on the OCRD is a Service Fee that gets applied when a customer purchases a few selected items. There are three service fees namely 6.38, 11.28, and 0.00 that I have created.
I have created the same UDF on Marketing Document Rows and with a FMS that field gets populated without any problems. I have created another UDF on Marketing Document Rows called Service Fee Total. This field times the quantity by the Service Fee UDF without any problems.
Here comes the problem.
If I create a document with more than one line item and both line items have a Service Fee Total I want them to be added together and then the total inserted into the discount field so that the amount can come off the total of the document.
A FMS that I use has a query attached to it that looks like this
however this does not work as it only sums the first line.
If anybody understands what I am trying to do here could you please give me some advice on how to get this working.
Any help appreciated.
Sorry to say, but your problem can not be solved by FMS.
There is no possibility for an FMS to reference more rows of the actual transaction. The standard SQL expressions can access the data already stored in the data base, and the special references (with the $...) can access only the header level and the actual (or the first) row data.
To be honest, I never encountered such case as yours, but even if I encountered it, I won't bother to do it using FMS. I don't think that FMS could do the aggregate things such as your case. When you type
, actually SAP will replace that with certain value from the form. It couldn't automatically read from first line to last line. I think the only way to achieve what you want here is to use SDK.