I really wanted to just vent my spleen at how annoying BPM is around handling Date values passed from Java / Web Dynpro front end and mapping them as input into an RFC call.
I've seen many recommendations to use an EJB mapping function but I just can't believe that is the only way. Presently, I'm using a CAF service in between my BPM and RFC due to other historic reasons but due to changes, I'd like to remove this CAF layer to simplify the build. However, in doing so I hit the issue with converting dates. So frustrating!
What am I missing?
As I thought, if I use the date-from-dateTime() function I get the following syntax error:
"Incompatible expression type.
Unless I'm being completely stupid (possible!) I'm really annoyed and frustrated that what should be a very common mapping in BPM is not straight forward. I cannot believe there isn't an easy way to pass a Java/XSD type date from BPM directly in to an RFC call.
I think the problem comes from the RFC import defining its own data type for date fields which is of type:
This is defined as:
<xsd:union xmlns="urn:sap-com:document:sap:rfc:functions" memberTypes="xsd:date genericDate" />
I'm very tired at the moment so not thinking clearly but I'm struggling to see an easy way of mapping an xsd:date to the date type shown above.
p.s. genericDate is defined as:
<xsd:pattern value="....-..-.." />
Message was edited by: Gareth Ryan
It is puzzling why this would change from one Ehp to the next...
The type "date" itself is anytype because it contents can be "xsd:date" XOR "genericDate". You should be able to simply 'cast as xsd:date' to get the result you want. i.e it is a cast not a convert or map.
A few help links (from CE 7.2 but shouldn't have changed)