on 05-29-2009 2:33 PM
Hi,
I'm wondering how the missing return statement error can be avoided in this code, I've tried all sorts of syntaxes but it just won't work:
public String DetermineCostCenter(String KTOS,String KTOH,String FNR,String KST,Container container){
int KTOHNR = 0;
int KTOSNR = 0;
KTOHNR = new Integer(KTOH).intValue();
KTOSNR = new Integer(KTOS).intValue();
if (KTOSNR > 6999999 || KTOHNR > 6999999) {
if (FNR.equals( "1"))
return "1008590";
else if (FNR.equals("2"))
return "5008090";
else
return " ";
}
if (KTOSNR > 6999999 || KTOHNR > 6999999)
return KST;
if (KTOSNR < 3000000 && KTOHNR < 3000000)
return " ";
Thanks
Tom
Try this...
int KTOHNR = 0;
int KTOSNR = 0;
String tmpktosnr = "";
KTOHNR = new Integer(KTOH).intValue();
KTOSNR = new Integer(KTOS).intValue();
if (KTOSNR > 6999999 || KTOHNR > 6999999) {
if (FNR.equals( "1"))
tmpktosnr = "1008590";
else if (FNR.equals("2"))
tmpktosnr = "5008090";
}
if (KTOSNR > 6999999 || KTOHNR > 6999999)
tmpktosnr = KST;
if (KTOSNR < 3000000 && KTOHNR < 3000000)
tmpktosnr = " ";
return tmpktosnr;
Hope this will help.
Nilesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey
Try to use the following
public String DetermineCostCenter(String KTOS,String KTOH,String FNR,String KST,Container container){
int KTOHNR = 0;
int KTOSNR = 0;
KTOHNR = new Integer(KTOH).intValue();
KTOSNR = new Integer(KTOS).intValue();
if (KTOSNR > 6999999 || KTOHNR > 6999999)
{
if (FNR.equals( "1"))
return "1008590";
else if (FNR.equals("2"))
return "5008090";
else
return " ";
}
else if (KTOSNR > 6999999 || KTOHNR > 6999999)
return KST;
else if (KTOSNR < 3000000 && KTOHNR < 3000000)
return " ";
else
return " ";
Thanks
aamir
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 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.