on 10-26-2007 4:18 PM
Hi everybody!
This is my first post in this forum, and as i could see you're very helpful with many SAP XI topics.
I've a iDoc to file scenario,
My question is the next one:
I would like to add the same field in the different segments that an iDoc could be sent, lets suppose that this is an example of an incoming idoc:
IDOC
|
|------ZPAGOS_CAB
|----
MyField
|------ZPAGOS_CAB
|----
MyField
|------ZPAGOS_CAB
|----
MyField
I would like to sum all the "MyField" instances that come in the different segments, the segments are always the same ones and the field too.
Any suggest?
Thanx in advance.
John
Ok, thanx, i'll try making an udf and i'll tell you what happened.
Regards,
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I undestand well the structure of the segment of IDoc should be:
ZPAGOS_CAB 0..unbounded (or 1..unbounded)
MyField 1..1
For your problem I suggest you to use a user defined function as this one:
type of function: context
public String concatenateString(String field[], ResultList result){
String resultTmp = new String();
// We concatenate all the value of the field
for (int i = 0; i < field.length; i ++){
resultTmp = resultTmp + field[ i ];
}
result.addValue(resultTmp);
}
Note: you have to use as input "MyField" and set the context one level up context respect to the default choice. (right click of the mouse --> context)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does you want to add all the value of Myfield adn then send to target :
for this you need to write an UDF to add the values
or
You want to create the different segemtn at target for each value of Myfield:
Use the SPLIBYVALUE function in the MM
Myfield->SPLITBYVALUE->taget
correct me if i am wrong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cho,
Use the standard airthmetic funciton Add (for the first two fields) and the result you once again to the third field. So concatenating two adds should solve your issue.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.