on 2012 Sep 11 4:49 PM
Hi Sap All.
i have got a requirement where in an Idoc To File Interface ,i need to check two IF conditions and then pass the result of any one of IF Condition(if it is TRUE) to the target.
If /ZRPA_ORDERS01/IDOC/Z1EDRPAORDCR1/E1EDK01/E1EDP01/E1EDP05/KSCHL = ‘’PAT’ then /ZRPA_ORDERS01/IDOC/Z1EDRPAORDCR1/E1EDK01/E1EDP01/E1EDP05/KRATE-> ‘gross_cost_excl’ when /ZRPA_ORDERS01/IDOC/Z1EDRPAORDCR1/E1EDK01/BSART is ‘ZRIC’ or ‘ZRUC’ or ‘ZUC’ or ‘ZIC’
or
If /ZRPA_ORDERS01/IDOC/Z1EDRPAORDCR1/E1EDK01/E1EDP01/E1EDP05/KSCHL = ‘’TODD’ then /ZRPA_ORDERS01/IDOC/Z1EDRPAORDCR1/E1EDK01/E1EDP01/E1EDP05/KRATE-> ‘gross_cost_excl’ when /ZRPA_ORDERS01/IDOC/Z1EDRPAORDCR1/E1EDK01/BSART is ‘ZRIC’ or ‘ZRIM’ or ‘ZC’ .
i have tried to use the Boolen 'OR' Condition but i couldnt get it right as it was not accepting the normal input values(output of IFTHEN Condition) (other than true or false ).so is there any way that i still can use the boolean IF Condition or can i go for the User Defined condition)
i have also tried with UDF by submitting the output of 2 IFTHENWithoutElse conditions but still i couldnt get the right values in the target according to the Context.
the source code of usd is as follows :
public void OR(String[] a, String[] b, ResultList result, Container container) throws StreamTransformationException{
if(!a.equals(""))
{
result.addValue(a);
}
if(!b.equals(""))
{
result.addValue(b);
}
will be waiting for the quick answer.
regards.
Varma
Request clarification before answering.
Please mark answered for this thread.
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.
Hi mr Praveen.
thanks for the response but any way i have got the solution through the following below shown mapping.
The source code of UDF 'OR' is as below :
public void OR(String[] a, String[] b, ResultList result, Container container) throws StreamTransformationException{
String conditionA = "";
String conditionB = "";
for (int i = 0; i < b.length; i++)
{
if (!b[i].equals("")) conditionB = b[i];
}
if (!conditionB.equals("")) result.addValue(conditionB);
for (int i = 0; i < a.length; i++)
{
if (!a[i].equals("")) conditionA = a[i];
}
if (!conditionA.equals("")) result.addValue(conditionA);
Regards.
Varma
User | Count |
---|---|
74 | |
29 | |
8 | |
8 | |
7 | |
6 | |
6 | |
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.