on 05-13-2014 10:57 PM
Hi
Here id the soruce strucre
Target - I need to map it to Reference qualifer 1:Unbounded
z1EKPD1 can occur muliple times in one item
If zzontractnumber not eual to blank then
if substring(ZZPARSRATING(0,2) = DS then
copy DS
else
if substring(ZZPARSRATING(0,2)= DX then
copy DX
If the value of zzparsrating existing in all the line items it is working but it it has only in 2nd item i am getting arryindexout of bound exception and not populating the value of zzparsrating
and if the Z1EKPD1 has more than one then also i am getting exception
Thanks for your help
The issue is resolved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is not completely solved i am getting other issue.If you help that will be appreciated.
1) Z1EKPD1 segment coming from idoc many times . But in target i have to create only one REF segment . This can be done by mapping Z1EKPD1 to constant .But sometimes i am getting the value of ZZASQTY with 0.000 in segment Z1EKPD1 and any not any other fields. In this case it should not create REF segment in target . How can i give the condition to satisfy these
Thanks
Mahesh
Thank you Harish. I have one Z1EDKP1 with all the four fields In each line item .The ref segment created for first line item only and 2nd line item ther is no refsegment
what properties should i set up sort . Attached the screen shot
If the z1edkp1 has only one field it is not created REF segment which is i am expected . expected the issue above
Thanks
Hi Harish,
Here is my scenarios
In each line item
1) If one Z1EKPD1 present with four fiedls(ZZCONTRACTNUMBER,ZZDPASRATING,ZZPRIMECONTRACT,ZZASQTY )
then create on REF on target
2) If more than one Z1EKPD1 present with four fiedls then create only one REF on target
3) If Z1EKPD1 is not present in any line item it should not create REF segment
4) If Z1EKPD1 is present one line item and not present 2nd line
item it should create one REF segment in the corresponding line item
5) Sometimes from idoc data coming with Z1EKPD1 and with only field ZZASQTY =0.000
In this case it should not create REF segment in target
Thanks
How can i make it to create only one REFsegment in target If Z1EDKP1 repeated multiple times I need only one in target .Context change for ZZASQTY is Z1EDKP1. But this getting the issue when there Z1EDKP1 is not in first item and Z1EDKP1 is in 2nd item. In this case it is creatting in first item only and not 2nd item level . I changed the context to E1EDP01 it is working but creating issue if Z1EDKP1 is present multiple times. It is creating multiple REF segments
Hi Mahesh,
When you have more then one Z1EDKP1 in one line item and they can have ZZASQTY 0.000 or more. So you need to create target when atleast one ZZASQTY is more then 0.000. Please change your mapping as below
ZZASQTY (context of line item) --> trim --> equals (0.000) --> Not --> Sort (true on top) --> Collaps context --> input to if withoult else and map the constant.
In case of any issue, past the display queue screenshot.
regards,
Harish
Thank you for looking in to this. with the above suggestion tested with two Z1EDKP1 in first item and one
Z1EDKP1 segment in second line item . But it created two ref segments in first line item and expecting only one and in 2nd line item expecting one REF segment and it didnt created anything.
Attached testdata.png for this and ifelse display queue .
if ZZASQTY =0.000 then this will always only once and only this field will be coming not other fields along with that This is default is coming from idoc.
Attached testdata2.png for this sample and in this case it should not create any segment in target
Thank you Harish we are almost there. When I am testing with no Z1EDKP1 segment in any item or one of the item getting the following error.
Thank you Harish. I tried with this and getting one issue. If the ZIEDKP1 doesnot exist in first item and if it exist in 2nd item with all the data then in first item level it created the REF segment and not in 2nd item level
If ZIEDKP1 exist in first item level and doesnot exist in 2nd item level it worked perfect
Thanks for your help
I will appreciate if you could send me udf
1 Z1EKPD1 segment repeate multiple times in each item level and there should be one rfe segment
2 Z1EKPD1 may present one line item and not in other line items. corresponding line item it should create only one ref segment
3 Z1EKPD1 may not present any line items it should not create refsegment
4.sometimes Z1EKPD1>ZZASQTY field comes with default value with 0.000 and not any other fields from idoc ,it should not create refsegment
I wrote the following udf but working as expected
int i;
for (i=0;i<z1edpk1.length;i++)
{
if (((z1edpk1[i]==null))||((z1edpk1[i]!=null)&&(zzsqty[0].equals("0.000"))))
{
result.addSuppress();
}
else
{
result.addValue("");
//result.addContextChange();
}
}
Thanks
Hi Mahesh,
You are getting this error because substring function is being used with ZZParserating and it throws error for empty value.
If empty zzparserating is valid, then check for empty string first then use substring node function on zzparserating, no need to use udf.
Hope this helps.
If you have still confussion place your output structure, will help you.
Regards
Jitender
(No need to make thing complex when you can do it easily)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can use mapwithdefault to populate some values when there is no zzparsrating is present.
you have to use this before udf.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mahesh,
use duplicate subtree at the target side to create the target node(s) based on the conditions outlined above and populate a constant in the field below the structure. You have not shown the target structure so I am bit lost there.
Cheers
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.