on 04-18-2013 5:55 PM
Hello all,
My IDOC structure is as below :
<?xml version="1.0" encoding="UTF-8"?>
<ORDERS05>
<E1EDK14 SEGMENT="">
<QUALF>Z03</QUALF>
<ORGID>AB-13254-ER</ORGID>
</E1EDK14>
<E1EDK14 SEGMENT="">
<QUALF>Z06</QUALF>
<ORGID>AB-2662-ER</ORGID>
</E1EDK14>
</IDOC>
</ORDERS05>
The mapping is done in this way :
ORGID---->substring(3..8)-->
QUALF--->EqualS ----->if then else------->OrderNumber
Constant(Z06)-->
Constant(000000)----->
I am getting result as Ordernumber = 0000 because it's always taking the first value of the QUALF .What need to be done such that it takes the rest of the nodes too and show the correct value as OrderNumber = "2662"?
Thanks in advance !!
Regards,
Sambaran
Hi Sambaran,
You can use a higher context of the parent segment of the fields ORGID and QUALF and use ifWithoutElse (Keep Suppress value unchecked). After this mapping, you can use MapwithDefault function. It should work. For using standard substring function, make sure you have checked the length before you apply substring else it will result in mapping failure.
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Make the context of QUALF and ORGID to higher node. Check the below mapping.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sambaran,
Here is how I would personally, map it, it should work without UDFs:
QUALF --> EqualsS(Constant Z06) --> ifWithoutElse( ORGID -->substring(3..8) ) -->
collapseContexts --> mapWithDefault(000000) --> OrderNumber
Also, make sure ORGID is always long enough, otherwise mapping will go into error.
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sambaran,
According to your requirement, if any <QUALF> is Z06 you need to pass the corresponding <OrgID>.
Use a UDF for the the above. Remove context for both <QUALF> and <ORGID> and give it as input to the UDF.
<ORGID> -->
UDF_ORGID_FROM_Z06--->substring(3..8) ---> OrderNumber
<QUALF>--->
Small piece of code that you will require:
int sum=0000;
for (int i=0;i<a.length;i++)
{
if(QUALF[i].equals("Z06")
sum = ORGID[i];
}
return sum;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Sambaran,
SAP PI/XI converts all incoming Idocs/File in short the source into XML for mapping purposes. The only language the SAP XI mapping understands is XML.
These nodes as mentioned above would be XML nodes and they will surely work. The two inputs would be the data coming in <ORGID> and <QUALF> node.
We could have used the substring function in the UDF itself but since its available in Graphical Mapping. I have made the UDF output the QUALF which corresponds to ORDIG Z06 and then used the Substring function to take only 2662 as output.
As a correction to above function you can just make the int sum = 00000000; so that there is no error during substring.
Thanks & Regards,
Tejas Bisen
Hi
Make the context of QUALF to higher node i.e right click on QUALF & make its context to immediately higher node. Dont change anything else
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.