on 03-12-2008 5:07 AM
Scenario : IDOC - Soap
Target fields:
Location (0...unbounded)-segment
+name
+Part ((0...unbounded)-segment
++name
++Ord (0...unbounded)-segment
+++type
+++cost
Name, name, type and cost are fields.
The source fields ...
Location (0...unbounded)-segment
+name : 001 , 002
+Part ((0...unbounded)-segment
++name : Engine
++Ord (0...unbounded)-segment
+++type : General
+++cost : Qty
The output shud be:
Line1:
Location (0...unbounded)-segment
+name : 001
+Part ((0...unbounded)-segment
++name : Engine
++Ord (0...unbounded)-segment
+++type : General
+++cost : Qty
Line2:
Location (0...unbounded)-segment
+name : 002
+Part ((0...unbounded)-segment
++name : Engine
++Ord (0...unbounded)-segment
+++type : DEFAULT
+++cost : 0
I am facing problem while populating the DEFAULT segment in case the source side the value doesnt come.
how do I do it?
Thanks and reagards,
Nikhil..
Hi,
You could use
Source ---> mapWithDefault --->Target
double click on mapWithDefault to give defult value
or check for
Source ->Exists->If true the pass else pass constant with default value --->target
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Swarup,
for better understanding I have explained taking an example of target structure.
Actually the source is MATMAS04 IDOC
it will come like this...
MATMAS04
+IDOC
++E1MARAM (segment)
+++MATNR --> Part_name
+++E1MARCM (segment)
++++WERKS --> location_name
++++ZSEGMENT (segment)
+++++CLABS ---> type
+++++CUMLM ---> Qty
HI,
You could achieve this with formatByExample API.
Look the segment will be based on the existance of the sub-fileds in that segment so
pass segment as 1st param and sub-field as 2nd> FormatByExample>mapWithDefault --> target
This should work out.
Remember if the occurance of field and segment should be same
In your case
E1MARAM - >mapWithDefault--> FormatByExample ---> TargetField
________________MATNR----
>
Nikhil,
Does it got solved?
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes Raj,
This s the solution :
I have duplicated Ord node
Mapping to the original ORD node :
field > exists > formatbyeg > createif > target
field>mapwithdefault (II input to formatbyeg)
-
Mapping to the duplicated subtree:
field>exists>formatbyeg>count>==1?>removecontext>splitbyvalue> createif>
field>mapwithdefault (II input to formatbyeg)
I think you would have written UDF as the input in name is comma separated and you are spilitting the input based on comma and then changing its context .you can use the following UDF keep in mind the input to the udf will be the output of udf that u would have written for splitting the name based on comma and the other i/p will be type
u can change thae name as per u r conviniant .
String default = "DEFAULT" ;
for (int i = 0 ; i < name.length ; i++)
{
if(type<i>.equals(null) || type<i>.length() == 0)
{
result.addValue(default) ;
}
else
{
result.addValue(type<i>) ;
}
result.addValue(ResultList.CC);
}
if helpful reward points
Thanks
Sunil Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try to use the mapWithDefault function and put the Context of type to Node.
Please let me know if u need furthur help.
Thanks,
Bhargav
Note:Award Points if found useful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
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.