Need help to change some code

Hi Experts,
I am new to Java and i struck up in some java code. could some one modify the code according to my requirement please..
we hava a booking form contains the details like Destination ware house no, load number,PO number, line number.... When the supplier submit the form,Here we should reject the booking form .
The booking form should reject in some cases where i have mentioned below. accordingly could some one modify the java code please..
We have to reject such a booking form through the logic
If Destination Warehouse = Different AND Load number = Common then
“Reject the booking form”
Else if
Destination Warehouse = Different AND Load number = Different then
"Pass the Booking form"
Else If
If Destination Warehouse = Common AND (Load number = Common OR Load number = Different)
“Pass the booking form”
Else
it should Reject the form for different site on same load.
The java code has been written like this. could someone modify it according to my requirement as i am new to Beginner to Java
String[] vendor = new String[status.length];
String[] load = new String[status.length]; //array of load numbers
String[] site = new String[status.length]; // array of site (dest wh) numbers
String[] temp = new String[20];
String[] lstatus = status;
String[] fail_loads = new String[status.length];
String[] fail_sites = new String[status.length];
MappingTrace trace = container.getTrace();
trace.addInfo("No. of records: " + status.length);
for(int i=0;i<status.length;i++){
result.addValue(status);
try{
if (status.length != 1) {
//Split input into Load Number and Vendor Number
for (int i = 0; i < status.length; i++) {
temp = status[i].split(":");
load[i] = temp[1];
site[i] = temp[5];
if (temp[2].equals("9999999999")) vendor[i] = null;
else vendor[i] = temp[2];
temp = null;
//Get Loads with two or more vendors
String p_vendor = vendor[0];
String p_load = load[0];
String p_site = site[0];
int idx = 0;
int idxs = 0;
trace.addInfo("Load Length: " + load.length);
for (int i = 1; i < load.length; i++) {
if (vendor[i] != null) {
if (p_vendor != null && load[i].equals(p_load) && !load[i].equals("00")) { //same load as previous
if (!vendor[i].equals(p_vendor)) { //second vendor in same load
fail_loads[idx] = load[i];
idx = idx + 1;
if (!site[i].equals(p_site)) { //second site in same load
fail_sites[idxs] = load[i];
idxs = idxs + 1;
p_load = load[i];
p_vendor = vendor[i];
p_site = site[i];
trace.addInfo("For Loop 2: Index: " + i);
trace.addInfo("fail Loads length: " + fail_loads.length);
trace.addInfo("fail Sites length: " + fail_sites.length);
//Set values in array Status[]
for (int i = 0; i < status.length; i++) {
for (int j = 0; j < fail_loads.length; j++)
if (load[i].equals(fail_loads[j])) {
//set status[i] to fail
trace.addInfo("status[" + i + "] = " + status[i]);
String msg = "fail" + status[i].substring(4);
if (msg.length() <= 30)
msg += ":999";
status[i] = msg;
trace.addInfo("status[" + i + "] = " + status[i]);
break;
for (int j = 0; j < fail_sites.length; j++)
if (load[i].equals(fail_sites[j])) {
//set status[i] to fail
trace.addInfo("status[" + i + "] = " + status[i]);
String msg = "fail" + status[i].substring(4);
if (msg.length() <= 30)
msg += ":998";
status[i] = msg;
trace.addInfo("status[" + i + "] = " + status[i]);
break;
result.addValue(status[i]);
}// end for i
}//endif
else
result.addValue(status[0]);
}//end try
catch (Exception e)
StringWriter stringWritter = new StringWriter();
PrintWriter printWritter = new PrintWriter(stringWritter, true);
e.printStackTrace(printWritter);
String error = "Exception: "
+ stringWritter.toString();
trace.addInfo("This is exception: " + e.getStackTrace());
Thanks,
Suesh

990094 wrote:
I am new to Java and i struck up in some java code. could some one modify the code according to my requirement please..No. Ask for help so YOU can change it and learn from it, don't flat out ask other people to do it for you. People will just assume you'll be the one flipping their burgers in the future if you do that.
new to JavaThere is a forum that has this exact name, I suggest you take your further questions (not requests to outsource work) there.

Similar Messages

  • Need help with a activation code for Adobe Acrobat X Standard for my PC,, Don't have older version serial numbers,  threw programs away,  only have Adobe Acrobat X Standard,  need a code to unlock program?

    Need help with a activation code for Adobe Acrobat X Standard for my PC, Don't have older Version of Adobe Acrobat 9, 8 or 7. 

    You don't need to install the older version, you only need the serial number from your original purchase. If you don't have them to hand, did you register? If so, they should be in your Adobe account. If not you really need to contact Adobe, though it isn't clear they will be able to do anything without some proof of purchase etc.

  • Need help in changing the langauge on the Nokia570...

    Anybody can help please. I was given a brand new Nokia 5700 by my nephew from Taiwan and the langauge set is Chinese. I do not read or write chinese. Need help to change thelangauge on the phone. Any body can help.
    Thanks in advance

    Friend, I am based in China and my secretary is chinese - but nobody can figure out how to do it. I have another engineer who has the same phone has been playing around with it for 2 days and cannot get it done also. That is the reason I am getting on this site for help.
    Thanks anyways

  • Change some code from as3 to as2

    Hi, I want to use as2 because it compatible with my website.
    I want to change some code from as3 to as2
    /////////////////////////////image1//////////////////////////////// if(MovieClip(this.parent).imagetxt.text == "a") {     var imgurl:String = "C:/Users/Thái/Desktop/ls/cotton-1.jpg";     var myrequest:URL = new URL(imgurl);     myloader.scaleContent = true;     myloader.load(myrequest); } /////////////////////////////image2//////////////////////////////// else if(MovieClip(this.parent).imagetxt.text == "b") {     var imgurl2:String = "http://aloflash.com/images/upload/3.jpg";     var myrequest2:URLRequest = new URLRequest(imgurl2);     myloader.scaleContent = true;     myloader.load(myrequest2); }thank you for your support.

    use:
    var myloader:MovieClip=this.createEmptyMovieClip("loader_mc",this.getNextHighestDepth());
    if (MovieClip(this._parent).imagetxt.text == "a") {
        var imgurl:String = "C:/Users/Thái/Desktop/ls/cotton-1.jpg";
        myloader.load(imgurl);
    } else if (MovieClip(this._parent).imagetxt.text == "b") {
        var imgurl2:String = "http://aloflash.com/images/upload/3.jpg
        myloader.load(imgurl2);

  • I need help getting new authorization codes for digital copies

    I need help getting new authorization codes for digital copies of movies. Can someone help me out?

    There's a lot of results in Google when you search for this but unfortunately refreshing the page doesn't seem to generate a different code anymore. Mine also says already redeemed

  • HT2204 I need help to change my security questions I have forgot them

    I need help to change my security questions I have forgot them

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then you can try going to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address.
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then see if this user tip helps : https://discussions.apple.com/docs/DOC-4551
    e.g. you can try contacting iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then try Apple ID Account Security
    or try ringing Apple in your country and ask to talk to the Accounts Security Team : http://support.apple.com/kb/HE57

  • HT1212 I cannot remember my passcode and need help to change/reset my passcode.  I need this information in simple terms.  I have attempted to follow the instructions above without success

    I cannot remember my passcode and need help to change/reset my passcode.  I have tried to reset using the instructions on the website without success.  Please explain to me in simple easy terms how to access my ipod.  Thanks

    Forgotten Screen-Lock Passcode
    Connect the iOS device to your computer and try to make a backup
    iOS: How to back up
    Then restore via iTunes. The iPod will be erased. Place the iOS device in Recovery Mode if necessary to allow the restore.
    If recovery mode does not work try DFU mode.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up    
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store    
    You can also Google for YouTube videos that show how to do it

  • I got my mac from granddaughter.need help to change admin password

    i just got my mac from granddaughter. i need help to change the admin password. she has no clue what i am talking about when i ask for the password. please help me. i can't even install my tiger replacement cd until i change the admin password. thanks for your help. lee

    Hi, Lee. Welcome to Apple Support Communities.
    From this Apple Knowledge Base article:
    Start up from a Mac OS X Install disc (one whose version is closest to the version of Mac OS X installed).  Usually, you can start from the disc by putting it in your computer, restarting, and holding the C key. Or, put it in the computer and click the Install or Restore icon you see in the disc's main window (after which the computer will start from the disc without you needing to hold C). Or, you can use Startup Manager or the Startup Disk preference pane to select the Install disc.
    Choose a language, click the arrow button to continue,
    Mac OS X v10.6 or later: Choose Password Reset from the Utilities menu.
    Mac OS X v10.5 or v10.4: Choose Reset Password from the Utilities menu.
    Mac OS X v10.3: Choose Reset Password from the Installer menu.
    Tip: If you don't see this menu or menu choice, you're probably not started from the disc yet.
    Note: The default keyboard layout is U.S. English while started from the installation disc. If you use a keyboard layout other than U.S English, use the Input menu (the flag icon on the right side of the menu bar) to select the desired layout before typing a new password.
    Select your Mac OS X hard disk volume.
    Select the user name of your original administrator account.
    Important: Do not select "System Administrator (root)". This is actually the root user. You should not confuse it with a normal administrator account.

  • Bought Used Mac Mini...need help to change email for updates

    Purchased an used Mac Mini and I want to change my defaults to my name and get rid of the sellers name, I also need help in changing the email default for getting my updates from Apple.  That's the most important to me... I've got 5 updates waiting and the message I receive is to get my updates from the sellers email address.  Thanks!!!

    What OS is on your Mini? What year/model is the Mini? The seller should have reinstalled the OS that came with the Mini instead of just selling it to you as is.
    Once you determine the OS, you can erase your Mini's Macintosh HD and reinstall the OS which will allow you to setup your own account during the Setup process.

  • Need help to change my apple store to canada

    i need help to change my app itones store to canada

    Click here and follow the instructions to change the iTunes Store country.
    (103776)

  • Need help to redeem contact code for OS X 7

    Need help to redeem contact code for OS X 7

    Hello NOREDEEM,
    Thanks for using Apple Support Communities.
    If you have the purchase code for OS X 10.7 Lion, then you can follow the directions below to redeem it on your Mac.
    Mac App Store: Redeem gift cards and download codes
    Take care,
    Alex H.

  • I need to need help with changing my app store to canada to us but i have 49cents balance can you remove it please

    I need to need help with changing my app store to canada to us but i have 49cents balance can you remove it please

    Contact iTunes Support - http://apple.com/emea/support/itunes/contact.html - and ask them to clear your balance.

  • I need help with changing my verizon vm to the system voicemail

    I need help with changing my verizon vm to the system voicemail

    Deleting the iTunes account is not the solution as you will very likely lose any and all purchases ever made with the account.
    If you cannot find the option on the site, contact iTunes support.

  • I need help I scratched the code off my itunes card

    I need help I scratched the code off my itunes card

    Click here and ask the iTunes Store staff for assistance. Supply them with as much of the code as you can.
    (102006)

  • Need help with adjusting Javascript code to work in Adobe Edge (Countdown)

    Hello
    Im a newbie when it comes to working with Javascript and Adobe Edge and need a bit of help with adjusting some javascript code to work with Adobe Edge. A friend of mine helped me with making this javascript code: Edit fiddle - JSFiddle
    Its a simple countdown which counts down to a certain time at a certain date. What I aim to do is to add this code as a trigger on a text-element called "countdown" (within a symbol called "count").
    I have tried to do this as the code is, but it does not work. Anyone have any suggestions?
    Thanks!
    Mvh,
    Øyvind Hermans

    Hello again
    I have stumbled upon a problem with these animations; They crash the browser after viewing them a little while, usually less than 30 seconds in.
    Is this problem also occuring when you watch the animations?
    Is the countdown-code to much for the browsers to handle?
    Thanks in advance for your answers.
    Sincerely,
    Øyvind Hermans

Maybe you are looking for

  • PORTAL ERROR : when we configured xRPM roles to the user.

    we have installed  netweaver 2004s(abap+java)  with EP . To this installation as a add on we have installed xRPM 4.5. we configured xrpm roles like project managent, design colloboration, portfolio management to the user. when we login with that user

  • Problem with Excise duty Scenario

    Hi Experts     my Scenario is  ,  i am gieving PO say to vendor A , he is procuring material from vendor B , now the excise invoice  , given by vendor B is  forwarded by vendor A , but vendor A is increesing the basic value value of material Say A bu

  • Change of email?

    OK here is my problem I use a .mac membership for my login to the itunes store, but i dont use that .mac account for email at all....how can i change my email address to my gmail account so that all itunes notifications go there instead of to the .ma

  • Creating A Scale Animation Cant Find Numeric In Transform In CS3

    Hi All I am on a course at a College and on my 411 page handout it wants me to create a Scale Animation in PhotoShop MX 2004 (I have PhotoShop CS3 and Windows XP OS) the annoying thing is that I cant not find Numeric In Transform (by going to edit) a

  • Launching SWF file within the project - Video Avatar and Calculator

    Hi There, I am somewhat new to Captivate so please bear with me. I am using Captivate 6.0 and have basic coding knowledge. I have a question about how to launch SWF files within my project. There are 2 things I am trying to accomplish. 1. I have a vi