Posting Julian dates to EDIFACT date elements and vice versa
(The work field pass through work-around)
Subscribe to keep this site alive! Under new management but as always, still 100% FREE. Anyone with the IBM i is a friend of ours.
(The work field pass through work-around)
The Challenge: How do you map a Julian date (CYYDDD) from a user field in the UFD to DTM 1.2 (in CCYYMMDD) in a DESADV Document without complicated conversions or use of user exits?
The Analysis: This can easily be solved for X12 documents. X12 dates are by default Data Type: DATE. All you need to do is make sure that both sides: the element and user field are both defined as date fields as described in this article and straight mapping will do it.
The Solution: But for EDIFACT, the Data Type Property of DTM 1.2 is by default ALPHANUMERIC. Override the Data Type Property of the target element, DTM 1.2 to DATE (and by the default the date will be in CCYYMMDD).
But! if it is the reverse where CCYYMMDD or other in your ERP system to and you want Julian format to be mapped to DTM 1.2; check out the solution in the following section:
Solution Vice Versa:
There are 3 parts:
1. The source (user field) should be data type DATE.
2. Create a work field that will be a date field (Julian YYDDD). This is where the conversion takes place when the source is "mapped" to this work field.
3. The target element should be ALPHANUMERIC (so that there will be no conversion when the work field is mapped to the element.
Thinking of a new CHALLENGE? Let us know HERE.