on 2012 Jun 25 9:28 AM
Hi Guy
I have a Scenario JDBC to WebServer.. on my target system the Document Number is a primary key, so at some point I am getting a data that repeats with tha same Doc Num and now I want is to create this segment/node once on the target system if the doc number is the same on the reapiting source:
Below is my source and target structures please help me out on how to get this mapping to working.
SOURCE
______________________
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_POHeader_Sender xmlns:ns0="http://Eskom/ContractManagement/SAPMM_PCM_MM">
<row>
<DOC_NUM>4500001096</DOC_NUM>
<TO_COMP_CODE>11000031</TO_COMP_CODE>
<TO_CONTACT_CODE>DG</TO_CONTACT_CODE>
<FROM_COMP_CODE>11042988</FROM_COMP_CODE>
<DOC_OWNER_CONTCODE/>
<FROM_CONTACT_CODE>CS</FROM_CONTACT_CODE>
<PROJ_OBJ_ID>C.EGINGUL</PROJ_OBJ_ID>
<TO_DOCOWN_COMPCODE/>
<TO_DOCOWN_CONTPCODE/>
<PROJ_NAME>UBRAAM</PROJ_NAME>
<DOC_DATE>2012-05-11 00:00:00.0</DOC_DATE>
<ERP_OBJ_ID>4500001096</ERP_OBJ_ID>
<MAIN_CONTRACT>4600000262-B</MAIN_CONTRACT>
<TIMESTAMP>2012-6-22.0.0. 0. 0</TIMESTAMP>
<IN_PROCESS_FLAG>N</IN_PROCESS_FLAG>
<EXISTS_PCM>false</EXISTS_PCM>
</row>
<row>
<DOC_NUM>4500001096</DOC_NUM>
<TO_COMP_CODE>11000031</TO_COMP_CODE>
<TO_CONTACT_CODE>DG</TO_CONTACT_CODE>
<FROM_COMP_CODE>11042988</FROM_COMP_CODE>
<DOC_OWNER_CONTCODE/>
<FROM_CONTACT_CODE>CS</FROM_CONTACT_CODE>
<PROJ_OBJ_ID>C.EGINGUL</PROJ_OBJ_ID>
<TO_DOCOWN_COMPCODE/>
<TO_DOCOWN_CONTPCODE/>
<PROJ_NAME>UBRAAM</PROJ_NAME>
<DOC_DATE>2012-05-11 00:00:00.0</DOC_DATE>
<ERP_OBJ_ID>4500001096</ERP_OBJ_ID>
<MAIN_CONTRACT>4600000262-B</MAIN_CONTRACT>
<TIMESTAMP>2012-6-22.0.0. 0. 0</TIMESTAMP>
<IN_PROCESS_FLAG>N</IN_PROCESS_FLAG>
<EXISTS_PCM>false</EXISTS_PCM>
</row>
<row>
<DOC_NUM>4500001096</DOC_NUM>
<TO_COMP_CODE>11000031</TO_COMP_CODE>
<TO_CONTACT_CODE>DG</TO_CONTACT_CODE>
<FROM_COMP_CODE>11042988</FROM_COMP_CODE>
<FROM_CONTACT_CODE>CS</FROM_CONTACT_CODE>
<PROJ_OBJ_ID>C.EGINGUL</PROJ_OBJ_ID>
<TO_DOCOWN_COMPCODE/>
<TO_DOCOWN_CONTPCODE/>
<PROJ_NAME>UBRAAM</PROJ_NAME>
<DOC_DATE>2012-05-11 00:00:00.0</DOC_DATE>
<ERP_OBJ_ID>4500001096</ERP_OBJ_ID>
<MAIN_CONTRACT>4600000262-B</MAIN_CONTRACT>
<TIMESTAMP>2012-6-22.0.0. 0. 0</TIMESTAMP>
<IN_PROCESS_FLAG>N</IN_PROCESS_FLAG>
<EXISTS_PCM>false</EXISTS_PCM>
</row>
</ns0:MT_POHeader_Sender>
My target should be like this:
TARGET
_________________________________________
<?xml version="1.0" encoding="UTF-8"?>
<ns1:CreateContracts xmlns:ns1="http://xmlns.oracle.com/Primavera/CM/WS/Contract/V1">
<ns1:Contract>
<ns1:DocumentDate>2012-05-11</ns1:DocumentDate>
<ns1:DocumentNumber>4500001096</ns1:DocumentNumber>
<ns1:FromCompanyCode>11042988</ns1:FromCompanyCode>
<ns1:FromContactCode>CS</ns1:FromContactCode>
<ns1:ProjectName>UBRAAM</ns1:ProjectName>
<ns1:Title>PO 4500001096</ns1:Title>
<ns1:ToCompanyCode>11000031</ns1:ToCompanyCode>
<ns1:ToContactCode>DG</ns1:ToContactCode>
<ns1:CustomFields>
<ns1:CustomField>
<ns1:Name>Main Contract (SAP 46 No.)</ns1:Name>
<ns1:Value>4600000262-B</ns1:Value>
</ns1:CustomField></ns1:CustomFields>
</ns1:Contract>
</ns1:CreateContracts>
Ta
Yonela
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please try with the below logic
DOC_NUM-->removecontext-->sort-->splitByValuechange-->collapseContext-->terget node to be created
Regards,
Priyanka
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
With a few context manipulation, you can satisfy your requirement e.g
DocumentDate:
DOC_DATE -> removeContext -> formatByExample -> collapseContext -> splitByValue:eV -> DocDate
DOCNUM -> removeContext -> splitByValue:VC /
The logic would be the same for all fields (except for DocNum).
DocumentNumber:
DOCNUM -> removeContext -> splitByValue:VC -> collapseContext -> splitByValue:eV -> DocNum
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.