on 07-04-2016 8:42 AM
Dear All,
Hope you fine,
I have a qustion about the logic of mapping for a field. My data is like below:I have more than one Item, and More than one E1EDP26 in each Item.
I want to say if Qualf = 003 exist in the Item, write BETRG value of that in the target(here 9.36), otherwise write 0.
Can anyone help me how can I write it?
The important thing is that, I want if not exist replace 0 as target,
Thanks a lot
Sin
Hi
You need to look at 2 conditions.
The condition with which you are creating the line item E1EDP01 and the condition needed to creation of E1EDP26 with qualifiers. Both have to work in conjunction and with context handling.
E1EDP26 are not multiple here since each will have a different qualifier.
Once you understand this, mapping will get easy.
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ambrish,
Thanks for your reply,
I know these conditions, exactly my E1EDP26 is not multiple, is just single, based on the qualifier, but my problem is I can not say If is not exist, put "0.00" as value.
With createIf I can handle it easily, but I need to set it as Zero if the related qualifier does not exist. So I can not use Exist or CreateIf.
Do you have any idea that can help me?
Regards
Sin
Hi Sin,
As it seems, you have 2 fields ItemValue and NetItemValue in play.
You don't need any condition for ItemValue since it has to be created any ways...
In the other field, you need a condition if E1EDP26-Qualf EQ 003, then populate corresponding BETRG else populate 0.0.
Hope it works
Ambrish
yes, Both the contexts are E1EDP01, As I understand, It checks just the first E1EDP01 for all E1EDP26 fields and if the qualf is not 003 put 0.0 unless put the value of that. But it should put for first Item 97.5, instead of 0.0
Thanks a lot
I would be appreciate if you can suggest me any soloution
Sin
Hi again,
No this is not what I need. I have many E1EDP01 fields that in each of them there are many E1EDP26 fields.
each E1EDP01 is known as a item. so my requirement is to check all the E1EDP26 fields of one item, to see if there is one of them that has the qualifier 003.if yes, put the BETRG value of that field in my ItemNetValue. if no should be written 0.0.
for example here we have a field with qualifier 003, so the ItemNetValue for the first item should be 97.5
the other two Items field are related to another E1EDP01 fields that each of them has its own itemNetValue.
This is what I need.
Regards
Sin
Hi Sanjeev,
Thanks,
It sloved my problem. I Used this UDF
def void ItemNetValue(String[] QUALF,String[] BETRG , Output out){
int ItemCount=0;
for( int i=0; i< QUALF.length; i++) {
if (QUALF[i].equals("003")) {
out.addValue(BETRG[i])
ItemCount++;
break;
}
}
if (ItemCount ==0){
out.addValue("0.0");
}
}
}
Regards
Sin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghuraman
this is my mapping as you suugested
and this is my Result
This is My XML file with E1EDP01 and 26 values
<E1EDP01>
<POSEX>00254</POSEX>
<E1EDP26>
<QUALF>003</QUALF>
<BETRG>164.80</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>010</QUALF>
<BETRG>265.20</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>011</QUALF>
<BETRG>164.80</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>012</QUALF>
<BETRG>85.75</BETRG>
</E1EDP26>
</E1EDP01>
<E1EDP01>
<POSEX>00209</POSEX>
<E1EDP26>
<QUALF>010</QUALF>
<BETRG>26.52</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>012</QUALF>
<BETRG>7.90-</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>001</QUALF>
<BETRG>6.63</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>002</QUALF>
<BETRG>26.52</BETRG>
</E1EDP26>
</E1EDP01>
<E1EDP01>
<POSEX>000030</POSEX>
<E1EDP26>
<QUALF>003</QUALF>
<BETRG>57.12</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>010</QUALF>
<BETRG>90.00</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>011</QUALF>
<BETRG>57.12</BETRG>
</E1EDP26>
</E1EDP26>
</E1EDP01>
<E1EDP01>
<POSEX>00245</POSEX>
<E1EDP26>
<QUALF>003</QUALF>
<BETRG>45.27</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>010</QUALF>
<BETRG>86.22</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>011</QUALF>
<BETRG>45.27</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>012</QUALF>
<BETRG>37.32</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>014</QUALF>
<BETRG>45.27</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>001</QUALF>
<BETRG>9.58</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>002</QUALF>
<BETRG>86.22</BETRG>
</E1EDP26>
</E1EDP01>
<E1EDP01>
<POSEX>00233</POSEX>
<E1EDP26>
<QUALF>003</QUALF>
<BETRG>14.80</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>010</QUALF>
<BETRG>26.66</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>011</QUALF>
<BETRG>14.80</BETRG>
</E1EDP26>
<E1EDP26>
<QUALF>002</QUALF>
<BETRG>26.66</BETRG>
</E1EDP26>
</E1EDP01>
Regards
Thanks for your replies
Yes, This is my Logic. I have a Custom BO, that has this Logic
node Item [0,n] {
....
node NetValue {
[Label("Item Net Value")] element ItemNetValue_NETWR : Amount;
}
}
and this is My IDOC
As you can see I have more than E1EDP01 field that has mapped to my Item Node.
inside each E1EDP01 field I have more than one E1EDP26 fields.
We have used a logic like this for NetValue field
and ItemNetValue
the problem was that, if QUALF =003 was not exist, it did not create the field at all, But we want to put 0 if there was no Qualf = 003 inside the E1EDP01 field.
Can you help me about this?
Regards
Sin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghuraman,
But Is not working
This is the simulation Result. I have three E1EDP01, means I have three items. so I mapped also E1EDP01 to NetValue
Is just check the first E1EDP26 and see the QUALF is not equal to 003, put 0.00
and also is not create the field for other items, if you look at the second Item, I dont have the NetValue field.
Should I check something else?
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sin,
Try the below logic
Qualf
----------------Equals-------------------------------IF
003
---------------------------------------------Target
Betrg------------------- Then
Constant------------------Else
[0]
If its not working let us know we may need to add Remove contexts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.