cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Thanks for the replies.

Muru, I tried with your logic,but im not getting any E1EDPT1 generated.

For the LP value check, im checking and passing the values to the udf

Please suggest

Former Member
0 Kudos

Hi,

did you change the context of the first segment of the UDS that u pass as input ?

If so, you should be able to see the corresponding filtered output.

Use, Queue Monitor to effectively debug the issue

Best Regards,

XA

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Sindhu,

I tried the same logic and it is working fine for me.

You can also try by changing the context for the TDLine to a level above E1EDPT1 and keep the E1EDPT1 context as it is , dont change anything.

Please try and lel me know

- Muru

Former Member
0 Kudos

Hi Muthu,

Problem solved. Thanks. Points awarded

Answers (4)

Answers (4)

Former Member
0 Kudos

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

Former Member
0 Kudos

My issue is not to determine the interface. It is a mapping issue.

Pls help with grapical mapping and any user defined functions

Former Member
Former Member
0 Kudos

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>

Former Member
0 Kudos

You can use XPATH to make conditional interface determination.

Former Member
0 Kudos

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