on 04-06-2016 7:53 PM
Hi Experts,
Currently I'm working on EDI 850 to JDBC Mapping and my requirement is simple.
As you may be aware that we use N1 segment contains ShipTo, BillTo and ShipFrom details and the same needs to map to the target field i.e., FIELD1
Now my requirement is, we are getting ShipFrom details in N1 segment with D_98 qualifier as SF then all the fields i.e., D_93, D_67, D_166, D_19, D_156, D_116 and D_26 should be mapped to FIELD1 at target side separated by | symbol. (only Ship From data need to mapped to FIELD1 separated by |)
EX: Source Side
<G_SN1>
<S_N1>
<D_98>SF</D_98>
<D_93>XYZ</D_93>
<D_67>001<D_67>
<S_N3>
<D_166>1112 Ridgewood Road</D_166>
</S_N3>
<S_N4>
<D_19>St. Cloud</D_19>
<D_156>MN</D_156>
<D_116>56395</D_116>
< D_26>US</D_26>
</S_N4>
</S_N1>
</G_SN1>
Target FIELD1 = XYZ | 001 |1112 Ridgewood Road | St.Cloud | MN | 56395 | US
Can anybody help me in this regard? Either by direct map or by creating an UDF.
Your help is highly appreciated.
Regards
Faisal
Hi Abdul,
Use below UDF:
Execution Type: Single Values
public String mapField1(String D_98, String D_93, String D_67, String D_166, String D_19, String D_156, String D_116,
String D_26, Container container) throws StreamTransformationException {
StringBuilder sb = new StringBuilder();
String delim = "|";
if (D_98.equals("SF"))
sb.append(D_93).append(delim).append(D_67).append(delim).append(D_166).append(delim).append(D_19).append(delim)
.append(D_156).append(delim).append(D_116).append(delim).append(D_26);
return sb.toString();
}
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Adul,
Try like below
<D_93>-------------
Concat(Delimiter |)-------Concat(Delimiter |)-----------Target
<D_67>------------- |
<D_166>--------------|
Repeat the same for rest all fields
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.