on 11-03-2017 3:01 PM
Hi Experts,
We are working on File to IDoc scenario.Number of ADRMAS01 IDocs that get generated should depend on below logic.
If IsCustomer and IsSupplier both are equal to string "true" then number of IDocs that should get generated should be equal to (number of occurrences of NatVer field multiplied by 2) i.e., suppose both of them are true then number of ADRMAS01 IDocs that should generate are 2 * no.of occurrences of NatVer field in input. Else if either of them IsCustomer andIsSupplier value is equal to "true" then number of ADRMAS01 IDocs that should occur is equal to number of occurrences of NatVer field.
Can this be achieved by standard functions or UDF is required. Kindly help.
Snippet of roles nodes.
Thanks,
Ramu.
Hi Raghu/Experts,
Can you help/guide me in this requirement.
Thanks,
Ramu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ramu,
Provide district fields sample input and how it is required.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much Raghu, now it creates the number of IDocs as expected:)
But I need one more help like segments under the IDocs should occur accordingly. For example:
In our case receiver IDoc ADRMAS01 with message type ADRMAS. "DISTRICT" target field should occur same number of times "district" in source payload and also the value should be mapped to appropriate context of E1BPAD1VL. "Address" node can occur multiple times in source payload under "NationalVersion".
Thanks,
Ramu.
Hello Ramu,
Try chaning the UDF with all values of context or share one small xml?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghu
Thank you very much for your help!
The above UDF works when the occurrence ofBusinessPartnernode is only one [i.e., NameDetails node in your case occurs only once]. The requirement is like below where the BusinessPartnernode can occur multiple times as shown in 1st snippet andNationalVersionnode may or maynot occur as shown in 3rd snippet. The number of IDocs generated should be equal to (number of occurrences ofNatVerfield multiplied by 2) if suppose both of them are true i.e IfIsCustomerand IsSupplierboth are equal to string "true" then number of IDocs that should get generated should be equal to (number of occurrences ofNatVerfield multiplied by 2) i.e., suppose both of them are true then number of ADRMAS01 IDocs that should generate are 2 * no.of occurrences of NatVer field in input. Else if either of themIsCustomerandIsSuppliervalue is equal to "true" then number of ADRMAS01 IDocs that should occur is equal to number of occurrences ofNatVerfield.
Input structure looks like below:
BusinessPartnernode will have the following field details:
NationalVersion node may or may not occur under BusinessPartner as shown below:
Thanks,
Ramu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ello Ramu,
Try the below UDF(All Values of Queue):
for(int i=0;i<var1.length;i++)
{
if(var1[i].equals("true")&&var2[i].equals("true"))
{
for(int k=0;k<var3.length*2;k++)
{
result.addValue("");
}
}
else if (var1[i].equals("true")||var2[i].equals("true"))
{
for(int j=0;j<var3.length;j++)
{
result.addValue("");
}
}
}
With both the Input values as true:
With both the Input values one as true and other as false:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Experts,
Please help to achieve this.
Thanks,
Ramu.
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 | |
10 | |
10 | |
9 | |
7 | |
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.