on 09-22-2011 8:46 AM
Hi,
Im stuck with a mapping issue. Below is the Idoc structure.
<IDOC>
E1EDPT1 -
0..99
SEGMENT
A
B
C
E1EDPT2-------0..99
SEGMENT
TDLINE-------0..1
|
</IDOC>
E1EDPT1 has some fields and another segment E1EDPT2. Mapping condition is if the source value in any E1EDPT2-TDLINE = LP, then that E1EDPT1 must be copied to the target,
As from the below sample, there are 2 E1EDPT1 segments in the idoc.But only the second E1EDPT1 must be copied to the target idoc since the value of TDLINE in the second E1EDPT2 is = LP
<E1EDPT1 SEGMENT="1">
<A>YS70</A>
<B>E</B>
<C>EN</C>
<E1EDPT2 SEGMENT="1">
<TDLINE>L1</TDLINE>
<TDFORMAT>123</TDFORMAT>
</E1EDPT2>
<E1EDPT2 SEGMENT="1">
<TDLINE>MP</TDLINE>
<TDFORMAT>456</TDFORMAT>
</E1EDPT2>
</E1EDPT1>
<E1EDPT1 SEGMENT="1">
<A>YS70</A>
<B>E</B>
<C>EN</C>
<E1EDPT2 SEGMENT="1">
<TDLINE>M1</TDLINE>
<TDFORMAT>ABC</TDFORMAT>
</E1EDPT2>
<E1EDPT2 SEGMENT="1">
<TDLINE>LP</TDLINE>
<TDFORMAT>123</TDFORMAT>
</E1EDPT2>
<E1EDPT2 SEGMENT="1">
<TDLINE>QP</TDLINE>
<TDFORMAT>PQR</TDFORMAT>
</E1EDPT2>
</E1EDPT1>
Pls give some resolutions
Thanks in advance
Hi,
Please use the below UDF;
//write your code here
int len = Integer.parseInt(a[0]);
for(int i=0;i<len;i++)
{
if(c<i>.equals("LP"))
result.addValue(b<i>);
else
result.addValue(SUPPRESS);
}
Pass E1EDPT1 segment count as 'a' , E1EDPT1 as 'b' and the E1EDPT2-LPLINe in 'c'. the mapping will look like ;
E1EDPT1 - Count & E1EDPT1 & LPLINE -- UDF-- Target segment
This will create the target segment based in the E1EDPT1 segment and change the context of the E1EDPT1 segment to the parent segment of E1EDPT1 inorder to consider all the occurences of E1EDPT1.
While transferring the values you need to check the LPLINE value , u can use the same udf by changing the 'b' value alone.
- Muru
Edited by: Murugavel Singaravel on Sep 22, 2011 11:35 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello ,
Thanks for the reply
I have mapped accordingly
E1EDPT1---> COUNT --> to UDF |
E1EDPT1 to UDF - > | UDF - > E1EDPT1(target node) |
if TDLINE = LP then TDLINE to UDF -
> |
TDLINE context is changed from E1EDPT2 to E1EDPT1
As mentioned, i passed the 3 inputs to UDF ,still im not getting the required output
Pls correct me and help to get the output
Thanks in advance
Pls
Hi Sindhu,
SoTry this UDF ;
//write your code here
int len = Integer.parseInt(a[0]);
for(int i=0;i<len;i++)
{
if(c<i>.equals("LP"))
result.addValue(b<i>);
else
result.addValue(SUPPRESS);
}
Change the context of TDline to the TOP segment of E1EDPT1 and also the E1EDPT1 to the top segment of that.
Try and let us know for any info.
- Muru
Edited by: Murugavel Singaravel on Sep 23, 2011 11:00 PM
Edited by: Murugavel Singaravel on Sep 23, 2011 11:06 PM
Hi Muru,
Your logic is not working.I have tried implementing the UDF but ,not getting the output .In the UDF ouput, E1EDPT1 is getting suppressed. I have tried in several other ways,but im only getting the first context i.e, if in the IDOC there are 2 E1EDPT1 segments,only the first E1EDPT1 is populated in the target,even if the TDLINE in the first E1EDPT1does not contain LP
Pls help to resolve this problem
Hi Sindhu,
You can do this mapping with graphical mapping.
If TDLINE = LP, pass TDFORMAT else pass constant with value "space" (" ").
Output of this If Then Else Function should be given to Remove Context --> Sort (dscending Order) --> Collapse Context and target.
You might have to use format by example before TDLINE as TDLINE belongs to segment E1EDPT2 which is under segment E1EDPT1. But need to check.
Please do this mapping and let me know the results.
Regards,
Gouri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My issue is not to determine the interface. It is a mapping issue.
Pls help with grapical mapping and any user defined functions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Refer below Link:
http://www.riyaz.net/blog/xipi-value-mapping-using-graphical-editor/technology/sap/382/
Thanks
Mary Durai
Sorry,there were some typo moistakes in the above sample data
Pls find the data below. As mentioned only if TDLINE = LP ,then the E1EDPT1 must be sent to target
<E1EDPT1 SEGMENT="1">
<TDID>YS70</TDID>
<TSSPRAS>E</TSSPRAS>
<TSSPRAS_ISO>EN</TSSPRAS_ISO>
<E1EDPT2 SEGMENT="1">
<TDLINE>L1</TDLINE>
<TDFORMAT>123</TDFORMAT>
</E1EDPT2>
<E1EDPT2 SEGMENT="1">
<TDLINE>MP</TDLINE>
<TDFORMAT>abc</TDFORMAT>
</E1EDPT2>
</E1EDPT1>
<E1EDPT1 SEGMENT="1">
<TDID>YS80</TDID>
<TSSPRAS>E</TSSPRAS>
<TSSPRAS_ISO>EN</TSSPRAS_ISO>
<E1EDPT2 SEGMENT="1">
<TDLINE>M1</TDLINE>
<TDFORMAT>123</TDFORMAT>
</E1EDPT2>
<E1EDPT2 SEGMENT="1">
<TDLINE>LP</TDLINE>
<TDFORMAT>pqr</TDFORMAT>
</E1EDPT2>
<E1EDPT2 SEGMENT="1">
<TDLINE>QP</TDLINE>
<TDFORMAT>xyz</TDFORMAT>
</E1EDPT2>
</E1EDPT1>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sindhu,
You have to use XPATH conditional interface determination to solve this problem.
/people/abhishek.salvi/blog/2009/07/15/sap-pi71-receiver-determination-xpath-and-you
/people/abhishek.salvi/blog/2009/07/15/sap-pi71-receiver-determination-xpath-and-you
Use the above links for inference and apply for your requirement.
regards
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
11 | |
11 | |
10 | |
9 | |
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.