on 02-09-2010 9:38 PM
Hi Experts,
I have a problem with the mapping in XI. The transformation of data is very complex (see below) for field HBKID. I'm not having understanding the process of mapping is performed for the field HBKID. The creation of the transformation was performed using the graphical method for mapping in XI for this case. I think the person who created this data transformation didn't know that could be used USER DEFINED FUNCTION. Could you explain in more detail this MAPPING?
In the test displays the message: RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns1:ZSD000TF01/ZVBAP/item[2]/HBKID.
The message is: Exception:java.lang.StringIndexOutOfBoundsException: String index out of range: 3]
Edited by: Rafael Sá on Feb 9, 2010 10:40 PM
Text Preview: HBKID=iF(const([value=]), stringEquals(const([value=]), /ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), iF(const([value=237BA]), stringEquals(/ns0:OrdemVenda_Leitura/row/MEIO_PGTO=, const([value=D])), iF(const([value=237DA]), stringEquals(/ns0:OrdemVenda_Leitura/row/MEIO_PGTO=, const([value=E])), iF(iF(const([value=AMEX]), stringEquals(/ns0:OrdemVenda_Leitura/row/TP_CARTAO_CREDITO=, const([value=AMEX])), iF(const([value=VISA]), stringEquals(/ns0:OrdemVenda_Leitura/row/TP_CARTAO_CREDITO=, const([value=VISA])), iF(const([value=CRED]), stringEquals(/ns0:OrdemVenda_Leitura/row/TP_CARTAO_CREDITO=, const([value=MC])), const([value=])))), stringEquals(/ns0:OrdemVenda_Leitura/row/MEIO_PGTO=, const([value=J])), iF(iF(const([value=001DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), const([value=001])), iF(const([value=033DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), const([value=033])), iF(const([value=151DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), const([value=151])), iF(const([value=237DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), const([value=237])), iF(const([value=341DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), const([value=341])), iF(const([value=347DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=),const([value=347])), iF(const([value=356DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), const([value=356])), iF(const([value=409DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), const([value=409])), const([value=]))))))))), stringEquals(/ns0:OrdemVenda_Leitura/row/MEIO_PGTO=, const([value=W])), const([value=]))))))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rafael,
Please go to test tab and then paste the payload in source xml and then move to Design and go to the field which is giving out error.Check the display queue option for that particular field mapping.Check the input values and do recheck the desired output after each condition.I believe its an issue beacuse of an input value length.
Regards,
Nutan
Hi Experts,
So, I've done several tests on the tab of tests with various XML and I can't understand reason of the error in MAPPING.
I'll detail a little more the problem:
The processing of the interface is made by many items.
MAPPING ERROR:
When the interface processes a first item with the information below:
CHAVE_BANCO = EMPTY
MEIO_PGTO = D
TP_CARTAO_CREDITO = EMPTY
AND a second item with the information below:
CHAVE_BANCO = 314/3705
MEIO_PGTO = W
TP_CARTAO_CREDITO = EMPTY
The error occurs: The message is: Exception:java.lang.StringIndexOutOfBoundsException: String index out of range: 3]
MAPPING OK:
But when the processing is performed inversely, the MAPPING is done correctly.
When the interface processes a first item with the information below:
CHAVE_BANCO = 314/3705
MEIO_PGTO = W
TP_CARTAO_CREDITO = EMPTY
AND a second item with the information below:
CHAVE_BANCO = EMPTY
MEIO_PGTO = D
TP_CARTAO_CREDITO = EMPTY
I don't understand logic mapping for the field HBKID.
Hi
Its a clearcut issue of substring. Remove the standard function and use this UDF( var1 being the source input string).
if (var1.length() > 0)
{
String var2 = var1.substring(0,1);
return var2;
}
else
{
return "";
}
Here if you have a string of desired length you will get teh desired output else you will get a blank value. You can change the return statement under ELSE as per your need. And under IF put the required values for trimming the string(substring function).
Hope it helps.
Regards
Soumen...
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
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.