on 05-17-2007 9:59 AM
Hi all
i am doing Idoc to file Scenario.my problem is in message mapping..
sometime at (IDOC) source one segment get repeated 2 times.
like
E1IDPUK2 (a,b,c)
E1IDPUK2 (a,b,c)... <b> but i want the particularfield value which comes from 2nd segment..in above case take "a".</b>
the segment occurances can be 2....many.. and so want the particular field value from last segment
the particular field (ex="a") is populated for every repetition of segment but i want
the last repeated segment ,"a" field value...
can any body share me the java code...
note : a,b,c are taken as example fields of the segment.
Thanks & Regards,
Ajay..
the structure is :
pexr2002/ idoc/ EIIDPU1/E1EDP02/BELNR
I need the belnr field value of the last generated segment..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear all i am new to java...
so that why i am asking the code..
regards,
ashutosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ajay,
First time you should clearly says that "i m new in java".
/******UDF*******/
public static void myFormatByExample(String[] a, ResultList result,Container container){
for (int j=0;j<a.length;j++){
if(!a[j].equals("") || !a[j].equals(ResultList.CC)){
result.addValue(a[j]);
result.addSuppress();//as per requirement.
}
}
}
Cheers!
Samarjit
Hi Ajay,
Could you please send us Parent and Super Parent segments of E1IDPUK2 segment.
and also which element under E1IDPUK2 segment you want it in output?
Cheers,
Jag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi all
can any one share me the code of supressing the field "a" value...
except the last generated segment."a" field value..
the segment are dynamic...i cannot count them ..it is runtime...it may be 2, 3...
regards'
Ajay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ajay,
Michal was right.
I have some code which related to my project and it might be help you.
/********UDF*********/
public static void myFormatByExample(String[] a, ResultList result,Container container){
for (int j=0;j<a.length;j++){
if (a[j].equals(ResultList.SUPPRESS))
result.addContextChange();
else{
while (a[j].equals(ResultList.SUPPRESS) && j<a.length){
j++;
}
result.addValue(a[j]);
j++;
}
System.out.println("J:"j" result:"+result);
}
}
Cheers!
Samarjit
Hi,
it's pretty easy:
you need to use UDF of type queue
inside it:
check how many segment are there
and choose the last one
and you will have this field
I also presented such mapping exercises (with E1EDKA1 - partner segment) in my book:
<a href="/people/michal.krawczyk2/blog/2006/10/11/xi-new-book-mastering-idoc-business-scenarios-with-sap-xi"><b>Mastering IDoc Business Scenarios with SAP XI</b></a>
Regards,
michal
-
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.