on 04-13-2010 3:08 AM
Hello All,
Scenario is like this....
Source:
E1EDK03
IDDAT 011
Datum 20090331
E1EDK03
IDDAT 017
Datum 20100401
<PAYHEADM>
<payHead>
<docType>testing mapping</docType>
<docRef>54948989</docRef>
<docDate>20090331</idocDate>
<paymDate>99999999</paymDate>
</payHead>
</PAYHEADM>
Based on the Qualifier 011 and 017, target fields document creation date and payment date are to be mapped. I tried using removecontext on both the source fields dint work also tried changing the context to IDOC instead of E1EDK03. Nothing works, my maps looks something like below:
/ns0:MT_PAYHEAD/PAYHEADM/payHead/idocDate=iF(removeContexts(/PEXR2002/IDOC/E1EDK03/DATUM), equalsA(removeContexts(/PEXR2002/IDOC/E1EDK03/IDDAT), const(value=011)), const(value=99999999))
/ns0:MT_PAYHEAD/PAYHEADM/payHead/paymDate=iF(removeContexts(/PEXR2002/IDOC/E1EDK03/DATUM), equalsA(removeContexts(/PEXR2002/IDOC/E1EDK03/IDDAT), const(value=017)), const(value=99999999))
What I can see in the test is it keeps reading the first occurence of E1EDK03 and just maps that. Am on PI7 can anyone suggest where I am going wrong.
--Prashanth
Prashanth,
Can you give us the condition on what you want to achieve? It will be more helpful to suggest a solution.
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Raj,
The condition for populating payment date will be check E1EDK03-IDDAT = '017' and populating Paymentdate in target with E1EDK03-DATUM.
Condition for document creation date check E1EDK03-IDDAT = '011' and populating Docdate in target with E1EDK03-DATUM.
The E1EDK03 segment will appear twice with 2 different qualifiers in the source under IDOC.
--Prashanth
Can you try with the below code?
Create UDF - All values in Queue, three input parameters IDDAT,CONST,DATUM
for(int i=0;i<IDDAT.length;i++)
{
if(IDDAT<i>.equals(CONST[0]))
result.addValue(DATUM<i>);
}
Map like
IDDAT (Change Context to IDOC level)
DATUM (Change Context to IDOC level) ---> PaymentDate
CONST ("017")
IDDAT (Change Context to IDOC level)
DATUM (Change Context to IDOC level) ---> DocumentDate
CONST ("011")
Thanks!
Hi Raj,
Thanks for your help.. The map sent by you did work.
I also realised that. using IF(with then and else) was not giving the desired output, but using Ifwithoutelse did work as it is supposed to in this scenario..
Any Inputs on what might be going wrong with using either of them, as I thought both would do the same thing.
Did not have to use MapwithDefault as well..
--Prashanth
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.