on 02-11-2014 9:56 AM
Hi Experts,
We have a scenario in SAP PI 7.1 where we give the item as input to RFC. The RFC checks for the item and returns the corresponding material . In case the corresponding material is not found the material value is populated with the source item. The problem we are facing is at times the RFC call fails for some unknown reason and the material code comes as blank. The material belongs to a standard idoc and hence cannot be made mandatory. I have created the below UDF to handle the issue but it seems not to work.
if (inputValue == null || "".equals(inputValue)){
throw new RuntimeException ("The value cannot be blank .");
}else {
return inputValue;
}
I am unable to find the flaw in the code. Please help me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
What is the problem that you are facing ?.Do you want to fail the mapping when blank value comes from ECC ?
If yes then below code is fine .Hope you are using singlevalues for excecution type
if (inputValue == null ||
inputValue.trim().length()
== 0) {
throw new StreamTransformationException("The value cannot be blank") ;
}else {
return inputValue;
}
Regards
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When the RFC lookup display queue gives error "Cannot perform RFC Lookup" at that time I need to throw the error output. Currently when in display queue we are getting Cannot perform RFC Lookup what happens is that the Material value does not occur in the target IDOC. The problem is when I check the display queue I get Cannot perform RFC Lookup but when I test the same it is successful without Material. What required is at any point if RFC fails due to network failure or any other issue and does not generate any result be it blank[]/null the mapping should fail then and there and not give any output like I am getting without the Material.
Hello,
>>The problem we are facing is at times the RFC call fails for some unknown reason + When the RFC lookup display queue gives error "Cannot perform RFC Lookup" at that time I need to throw the error output
U should know what's the reason and check why ur RFC is returning such messages - This is not a correct nehaviour
Not sure u can do much apart from debugging RFC, may be u can try to check "Use Exception" option in RFC lookup.
https://scn.sap.com/thread/1512208
Thanks
Amit Srivastava
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
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.