on 01-30-2008 6:52 AM
Hello All.
I have a requirement as follows:
SOURCE
if value unequal 'blank' and numeric map value to
TARGET.
Is that possible with Graphical Mapping?
Please let me know.
Regards
Hari
Solution is here...
I suppose your field at both the source and target side (lets call it A) is of type STRING
Use the Following code in the UDF with context as "value"
Name that UDF as "Validate"
public String Validate(String a,Container container)
//write your code here
int b ;
if (a.length()>0)
{
try{
b = Integer.parseInt(a);
return "true";
}
catch (Exception e)
{
return "false";
// I have returned Blank here
// However you can stop your Message Processing here
}
}
else return "false";
Now do the Following MM for this Field A
A(source)-->Validate()->Use IfThanWithoutElse--->A(target)
IfThanWithoutElse: Output of check will go to "if" and A(source) will go to "than" . Output of IfWithoutElse will go to A(target).
Hope this should work.
(Assumption : The numeric values would be Integer only)
Regards.
Jeet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeet,
Thanks for your valuable reply.
When i try to use the same in my mapping i am getting runtime error.
Again i am posting the same issue but i need only one part of it like
Source (Integer) -
if value unequal 'blank' and numeric map value to
Target (Integer)
(if value unequal 'blank)' --- This i can handle in graphical mapping.
What could be the solution for (if value unequal numeric) in Java mapping?
Thanks & regards
Hari
Hi Raddy,
I think for your problem, the best suitable solution is giving condition at receiver determination step. when you are specifying condition at receiver determination step, you can find ur input field, operator and its equivalent value.
So there you can mension it as field !=<space or whatever char u want> (for operator chose not equal( !=) symbol)
then click on plus symbol...there u can give field = some integer.
this is same as
if ( field!=null & field = integer )
then
go to that business service
end if
so I think this solves your answer!!!
Regards,
Pavani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
if i am not wrong ur requrement needs condition statements .........right?
XI provides various node functions and if else then is one of them u can use this ...........this below link may help u
http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/frameset.htm
Hope this may help u
Regards,
Azeez khan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the datatype of the field is String, then you can use the "text functions" to get this condition check and then map the value to the target.
Regards.
Jeet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try using standard API as below
Source--> MapWithDefaultValue -->Target.
This wud check if source eq blank and populate the default value given by u.
or u can directly use if then else and then not function
Thanks
Kiran
Edited by: kiran dasari on Jan 30, 2008 12:36 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if value unequal 'blank' and numeric map value to
--->
for unequal blank, you can use IfWithoutElse , compare it with constant ""(Blank), then use Not function(logical Not)
for numeric comparison you can write a UDF
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes write a UDF usin if-then-else condition or select the conditional if from functions list.
you can satisfy your condition.
BR,
Alok
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi HP CReddy,
You could either use below code in your UDF
Create new UDF then if the occurance of source and target structure is 1 use Cache parameter value or use queue for multiple occurance.
For single occurance of source
Pass the source field as A
//write your code here
try{
int abc = 0;
abc = Integer.parseInt(a);
return(Integer.toString(abc));
}catch (NumberFormatException e) {}
return("");
For multiple occurance of source
//write your code here
for(int i=0; i<a.length;i++)
{
try{
int abc = 0;
abc = Integer.parseInt(a<i>);
return(Integer.toString(abc));
}catch (NumberFormatException e) {return("");}
}
Thanks
Swarup
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.