Coding Problem

I have only been programming in Java for two weeks now and I am having problems. Frankly, I do not know Javascript either, but I am trying.
I am using a Stringbuffer to dynamically generate my webpage using a servlet and I am all mixed up.
I would like to update my database when the user leaves an input box
meaning it automatically updates the database when the input box no longer has focus.
I set a function called change_it to execute in the onblur in HTML.
The ResultSet behaves as if it is closed within the change_it function on the page.
The ResultSet is Updateable and is scrollable.
Please look at my code and let me know what I should do and give me a code example if possible.
import java.io.*;
import java.util.Enumeration;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.net.*;
public class HtmlImportType extends HttpServlet {
Connection theConnection;
public void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException,
IOException
getHTML(request, response);
public void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException,
IOException
getHTML(request, response);
public String getHTML(HttpServletRequest request,
HttpServletResponse res) throws ServletException,
IOException
String strName;
StringBuffer sbHtmlText = new StringBuffer();
HttpSession session = request.getSession(true);
sbHtmlText.append("<html>");
sbHtmlText.append("<HEAD>");
sbHtmlText.append("<title>Import Type Code</title>");
res.setContentType("text/html");
sbHtmlText.append("<script language=\"JavaScript\">");
sbHtmlText.append("<!-- hide from non-JavaScript browsers ");
sbHtmlText.append("function change_it(int intPrimaryKey) { ");
sbHtmlText.append("theConnection = DriverManager.getConnection(\"jdbc:odbc:dcs_dialysis;UID=dcs_dialysis;PWD=dcs_dialysis\"); ");
sbHtmlText.append("Statement theStatement=theConnection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); ");
sbHtmlText.append("ResultSet rs=theStatement.executeQuery(\"Update DESCRIPTION from REF_IMPORT_TYPE WHERE IMPORT_TYPE_CODE = \" + intPrimaryKey); ");
sbHtmlText.append("rs.absolute(intPrimaryKey); ");
sbHtmlText.append("rs.updateString(\"DESCRIPTION\", txt\" + intPrimaryKey + \".value); ");
sbHtmlText.append("rs.updateRow(); ");
sbHtmlText.append("rs.close(); ");//Close the result set
sbHtmlText.append("theStatement.close(); ");//Close statement
sbHtmlText.append("theConnection.close(); "); //Close database
Connection sbHtmlText.append("}");
sbHtmlText.append("// end hide -->");
sbHtmlText.append("</script>");
sbHtmlText.append("</HEAD>");
sbHtmlText.append("<BODY text=#008000 topMargin=0>");
sbHtmlText.append("<FONT face=Helvetica><BIG>Import Data Types</BIG>");
sbHtmlText.append("");
sbHtmlText.append("<TABLE align=center border=1 cellPadding=1 cellSpacing=1 width=\"40%\">");
sbHtmlText.append("<TR>");
sbHtmlText.append("<TH>Import Type Code</TH>");
sbHtmlText.append("<TH>Description</TH>");
sbHtmlText.append("</TR>");
try{ //Loading Sun's JDBC ODBC Driver Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//Connect to Data source
theConnection = DriverManager.getConnection("jdbc:odbc:dcs_dialysis;UID=dcs_dialysis;PWD=dcs_dialysis");
Statement theStatement=theConnection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
ResultSet rs=theStatement.executeQuery("select IMPORT_TYPE_CODE, DESCRIPTION from REF_IMPORT_TYPE");
int intCounter = 1;
//Fetch all the records and print in table
while(rs.next())
sbHtmlText.append("<TR>");
sbHtmlText.append("<TD><CENTER>");
sbHtmlText.append(rs.getString(1) + "</TD></CENTER>");
sbHtmlText.append("<TD>");
sbHtmlText.append("<input type=\"text\" size=\"30\" style=\"font-family: Verdana; font-size: 10pt\"");
sbHtmlText.append("name=\"");
sbHtmlText.append("txt" + intCounter + "\"");
sbHtmlText.append("value =\"");
sbHtmlText.append(rs.getString(2));
sbHtmlText.append("\" onBlur=\"change_it(" + rs.getString(1) + ")\">"); //PUTS PRIMARY KEY IN TO ASSIST WITH QUERIES
sbHtmlText.append("</TD>");
sbHtmlText.append("</TR>");
intCounter = intCounter + 1; }
rs.close();//Close the result set
theStatement.close();//Close statement
theConnection.close(); //Close database Connection
catch(Exception e)
sbHtmlText.append(e.getMessage()); //Print trapped error.
sbHtmlText.append("</TABLE>");
sbHtmlText.append("</FONT></BODY></HTML>");
return (sbHtmlText.toString());
}

Basically I am flying by the seat of my pants and I do not know Java very well at all and I do not have anyone to ask. I am trying to do this in the only way that I can think of which is updating the record after an onblur. I know it is fascinating to those who have read this, because I do not have one solution listed. However, I still do not know how to update the database. AJAX is nothing more than a bleaching agent to me, can you provide any coding example of how to do an update?

Similar Messages

  • Three new bioinformatic coding problems now in WIKI (all require regex)

    At the bottom of this page:
    https://wiki.sdn.sap.com/wiki/display/EmTech/Bio-InformaticBasicsInRelationtoScriptingLanguages
    I've defined three new bioinformatic coding problems (Problems 3a-c).
    These all involve regex parsing in one way or another and are therefore a lot more interesting than the first two problems I've presented.
    I'm hoping that Anton will continue to knock out solutions, and that others will feel challenged enough to join him.
    djh

    Anton -
    I am way impressed - not just by your code and how fast you produced it, but also by the speed with which you grasped the STRIDE documentation and put it to very good use.
    Regarding the question you ask at the very end - this question goes to the heart of why protein tertiary structure (the actual 3-dimensional shape of one chain of a protein) is so hard to predict, and why governments, universities, and pharma are throwing so much money at it.
    If protein primary and secondary structure were many-to-one, prediction of protein tertiary strructure would be a lot lot simpler.  (For example, if "VVAY" and all "similar" primary structure subsequences mapped to the same secondary structure.)
    But the mapping is, unfortunately, many-to-many because the amino acids (AAs) in a primary structure chain always bond the same way - the COOH (carboxy) of one  AA bonds to the HN (amino) of the next one to produce C-N with the OH and H going away to make a water moleculre ... COOH - HN ---> C-N + H20.
    And as pointed out by Linus Pauling (the discoverer of protein secondary structure), the C-N bond can take two forms:
    a) one that is llkely to force the two amino acids to become HH (part of a helix)
    b) one that is likely to force the two amino acids to become EE (part of a "stand")
    You may be surprised to find out that even primary structure subsequences of six amino acids can wind up as different secondary structures - not always "H" vs "E", the variants might be
    E TT H
    H TT E
    EEE HH
    HH EEE
    etc.
    Anyway, thanks a lot for what you've done here.
    If you decide to stay involved a little longer, you will very soon be able to understand why there may be real promise in the approach to protein structure that is being taken here:
    http://strucclue.ornl.gov
    (This is why I want to get SAP interested in the vertical bioinformatic sector - you can see why an integrated IDE with a robust DB is so important.)
    BTW, the site mentions Dr. Arthur Lesk as a team member.  Arthur is considered one of the fathers of what is called "structural alignment" (as opposed to pure sequence alignment.)
    If you Google him, you'll see that he has written many many books on bioinformatics - all worth purchasing if you're going to become involved in this area.  Arthur was at Cambridge (MRC) until recently, when he reached mandatory EU retirement age and took a position at Penn State here in the US.
    Best
    djh

  • Coding problem with my website

    On my website, rockycapellaprods.com, I have a coding problem with the labeling of the videos as well as the videos playing on the website. Everything works great on the IWEB site, but as I loaded the information on the GoDaddy hosting site, several pages have a problem with the playing the videos and having several of the images moving onto the written areas. Do you have any solutions so the videos and the images stay on the website where I set them up?

    this would be a problem with style sheets or CSS and common with iFrames. If you have a fixed width for the body on your page template, you will have varying results of layout when you view the page.
    If you have your editor stretched to a certain width across your screen, you will likely be able to layout all your text blocks and objects into the places you want which may or may not ignore the "width" restrictions of the body. when you upload the site and open it in a browser, the layout could change because of the width restrictions in the HTML or CSS code and thus "wrap" to the next line.
    THe solution is to be familiar with static and fixed positioning of text and objects within your page. Be familiar with text that wraps around images, or images placed within a text box, etc. How your images and text react in relation to each other is all part of the code for the objects, text, and body parameters combined.
    I'm sorry there isnt a fast fix for this, and it would literally be an extended lesson posted here online to take you thru understanding the code, how it works, what its affects are, style sheets, template restrictions and so on. One thing you can do is stretch the browser window open more to see if your objects align themselves similar to what you saw in iWeb editor. if it does, your template is set to "percentage of page width" for the body of the page.
    Message was edited by: iRocket
    Message was edited by: iRocket

  • Coding Problem 6 Now Defined in Scripting Languages/Bioinformatics WIKI

    In the "Scripting Languages and Bioinformatics" WIKI, I have completed a new page here:
    https://wiki.sdn.sap.com/wiki/display/EmTech/Bio-InformaticBasicsPartII-AlignmentToolsforRelatingProteinGenestoProteinPrimaryStructures
    and also defined Coding Problem 6 at the end of this page.
    This problem involves scripting an interactive session with a web site and parsing what the web site returns at various points duing the session.
    Am looking foward to a script that solves this problem, if anyone feels like spending the time to do it.

    <?
    // sequence to search ---------------------------------------------
    $bquery      = "MTQIIKIDPLNPEIDKIKIAADVIRNGGTVAFPTETVYGLGANAFDG";
    $bquery     .= "NACLKIFQAKNRPVDNPLIVHIADFNQLFEVAKDIPDKVLEIAQIVW";
    $bquery     .= "PGPLTFVLKKTERVPKEVTAGLDTVAVRMPAHPIALQLIRESGVPIA";
    $bquery     .= "APSANLATRPSPTKAEDVIVDLNGRVDVIIDGGHTFFGVESTIINVT";
    $bquery     .= "VEPPVLLRPGPFTIEELKKLFGEIVIPEFAQGKKEAEIALAPGMKYK";
    $bquery     .= "HYAPNTRLLLVENRNIFKDVVSLLSKKYKVALLIPKELSKEFEGLQQ";
    $bquery     .= "IILGSDENLYEVARNLFDSFRELDKLNVDLGIMIGFPERGIGFAIMN";
    $bquery     .= "RARKASGFSIIKAISDVYKYVNI";
    // url for form1 --------------------------------------------------
    $url = "http://blast.ncbi.nlm.nih.gov:80/Blast.cgi";
    // parameters for form1 -------------------------------------------
    $bdb         = "protein";
    $bgeneticcode= "1";
    $bquery_from = "";
    $bquery_to   = "";
    $bjobtitle   = "ACW-" . time();
    $bdatabase   = "nr";
    $bblastprog  = "tblastn";
    $bpagetype   = "BlastSearch";
    $pf  = "";
    $pf .= "QUERY=" . $bquery;
    $pf .= "&db=" . $bdb;
    $pf .= "&QUERY_FROM=" . $bquery_from;
    $pf .= "&QUERY_TO=" . $bquery_to;
    $pf .= "&JOB_TITLE=" . $bjobtitle;
    $pf .= "&DATABASE=" . $bdatabase;
    $pf .= "&BLAST_PROGRAMS=" . $bblastprog;
    $pf .= "&PAGE_TYPE=" . $bpagetype;
    $pf .= "&GENETIC_CODE=1";
    $pf .= "&DBTYPE=";
    $pf .= "&EQ_MENU=";
    $pf .= "&EQ_TEXT=";
    $pf .= "&NEWWIN=";
    $pf .= "&MATCH_SCORES=";
    $pf .= "&MAX_NUM_SEQ=100";
    $pf .= "&EXPECT=10";
    $pf .= "&WORD_SIZE=3";
    $pf .= "&MATRIX_NAME=BLOSUM62";
    $pf .= "&GAPCOSTS=11 1";
    $pf .= "&COMPOSITION_BASED_STATISTICS=2";
    $pf .= "&REPEATS=";
    $pf .= "&FILTER=";
    $pf .= "&LCASE_MASK=";
    $pf .= "&TEMPLATE_LENGTH=";
    $pf .= "&TEMPLATE_TYPE=";
    $pf .= "&I_THRESH=0.005";
    $pf .= "&CLIENT=web";
    $pf .= "&SERVICE=plain";
    $pf .= "&CMD=request";
    $pf .= "&PAGE=Translations";
    $pf .= "&PROGRAM=tblastn";
    $pf .= "&MEGABLAST=";
    $pf .= "&RUN_PSIBLAST=";
    $pf .= "&SELECTED_PROG_TYPE=tblastn";
    $pf .= "&SAVED_SEARCH=true";
    $pf .= "&BLAST_SPEC=";
    $pf .= "&QUERY_BELIEVE_DEFLINE=";
    $pf .= "&DB_DIR_PREFIX=";
    $pf .= "&SHOW_OVERVIEW=true";
    $pf .= "&SHOW_LINKOUT=true";
    $pf .= "&GET_SEQUENCE=true";
    $pf .= "&FORMAT_OBJECT=Alignment";
    $pf .= "&FORMAT_TYPE=HTML";
    $pf .= "&ALIGNMENT_VIEW=Pairwise";
    $pf .= "&MASK_CHAR=2";
    $pf .= "&MASK_COLOR=1";
    $pf .= "&DESCRIPTIONS=100";
    $pf .= "&ALIGNMENTS=100";
    $pf .= "&NEW_VIEW=true";
    $pf .= "&OLD_BLAST=true";
    $pf .= "&NCBI_GI=false";
    $pf .= "&SHOW_CDS_FEATURE=false";
    $pf .= "&NUM_OVERVIEW=100";
    $pf .= "&FORMAT_EQ_TEXT=";
    $pf .= "&FORMAT_ORGANISM=";
    $pf .= "&EXPECT_LOW=";
    $pf .= "&EXPECT_HIGH=true";
    $pf .= "&QUERY_INDEX=0";
    // define the HTTP connection -----------------------------
    $ch = curl_init();
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch,CURLOPT_POSTFIELDS, $pf);
    curl_setopt($ch,CURLOPT_COOKIEJAR,
    dirname(__FILE__).'/cookie.txt');
    curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($ch, CURLOPT_HEADER , 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    // call it ------------------------------------------------
    $my_result = curl_exec($ch);
    // get the request ID; the query takes some time and this ID
    // allows to identify the original request
    $query = "/<tr><td>Request ID<\/td><td> <b>([0-9A-Z]*)<\/b><\/td><\/tr>/";
    preg_match($query, $my_result, $request_id);
    // query for the result page every 2 seconds...when the result
    // is ready, we recognize it by its signature
    $not_ready = true;
    $result_url = "http://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Get&VIEW_RESULTS=FromRes&RID=" . $request_id[1];
    while($not_ready){
      $temp_page = null;
      curl_setopt($ch,CURLOPT_URL,$result_url);
      curl_setopt($ch, CURLOPT_POST, 0);
      $my_result = curl_exec($ch);
      $query = "/This page will be automatically updated in <b>(\d*)<\/b> seconds/";
      preg_match($query, $my_result, $temp_page);
      if(isset($temp_page[1])) {  sleep(2); }
      else { $not_ready = false; }
    // parse the results page; split it into result fragments first --------
    $pat = "/";
    $pat .= "><input type=\"checkbox\" name=\"getSeqGi\"([^\n]*)\n";
    $pat .= "Length=\d*\n\n";
    $pat .= "[\w\s]*:\n";
    $pat .= "(\s*<a[^>]*>[^<]*<\/a>\n)*\n";
    $pat .= "([^\n]*\n){3}\n";
    $pat .= "(([^\n]*\n){3}\n[^n])*";
    $pat .= "/";
    preg_match_all($pat, $my_result, $fragments);
    // 'fine parse the result fragments and get some important parameters -----
    foreach($fragments[0] as $fragment){
      $query = "/<a href=\"http:\/\/(www\.ncbi\.nlm\.nih\.gov\/entrez\/query\.fcgi\?";
      $query .= "[^>]*)>([^<]*)<\/a><a[^>]*>[^<]*<\/a>\s*<a[^>]*><img[^>]*><\/a>([^\n]*)/";
      preg_match($query, $fragment, $u);
      $query  = "/\s*Score\s*=\s*(\d*) bits\s*\(\d*\),\s*Expect\s*=\s*([^,]*),";
      $query .= "[^\n]*\n\s*Identities\s*=\s*\d*\/\d*\s*\((\d*%)\)[^\n]*\n\s*Frame\s*=\s*([^\n]*)\n/";
      preg_match($query, $fragment, $u1);
      preg_match_all("/Sbjct\s*(\d*)\s*[A-Z\-]*\s*(\d*)\n/", $fragment, $positions);
      $fr["url"]        = $u[1];
      $fr["shname"]     = $u[2];
      $fr["name"]       = $u[3];
      $fr["score"]      = $u1[1];
      $fr["expect"]     = $u1[2];
      $fr["identities"] = $u1[3];
      $fr["frame"]      = $u1[4];
    // find out if we have to reverse the strand direction or not; adjust
    // lower and upper limit
      if ($fr["frame"] >= 0) {
        $fr["high"] =  $positions[2][count($positions)-1]; $fr["low"] = $positions[1][0]; $fr["reverse"] = ""; }
      else {
        $fr["high"] =  $positions[1][0]; $fr["low"] = $positions[2][count($positions)-1]; $fr["reverse"] = true;}
      $frx[] = $fr;
    // we call the final details form for the top ranked result
    // here we could loop over several results
    curl_setopt($ch,CURLOPT_URL,$frx[0]["url"]);
    curl_setopt($ch, CURLOPT_POST, 0);
    $my_result = curl_exec($ch);
    // parse the final details form to get the necessary parameters to execute
    // the final details form
    preg_match("/<input name=\"WebEnv\" type=\"hidden\" value=\"([^\"]*)\"/",
               $my_result, $u5);
    preg_match("/<input name=\"query_key\" type=\"hidden\" value=\"([^\"]*)\"/",
               $my_result, $u6);
    preg_match("/<input name=\"db\" type=\"hidden\" value=\"([^\"]*)\"/",
               $my_result, $u7);
    preg_match("/<input name=\"qty\" type=\"hidden\" value=\"([^\"]*)\"/",
               $my_result, $u8);
    preg_match("/<input name=\"c_start\" type=\"hidden\" value=\"([^\"]*)\"/",
               $my_result, $u9);
    preg_match(
      "/<select name=\"dopt\".*<option value=\"([^\"]*)\" selected=\"1\">/",
      $my_result, $u10);
    preg_match(
      "/<select name=\"dispmax\".*<option value=\"([^\"]*)\" selected=\"1\">/",
      $my_result, $u11);
    preg_match(
      "/<select name=\"sendto\".*<option value=\"([^\"]*)\" selected=\"1\">/",
      $my_result, $u12);
    preg_match(
      "/<input type=\"hidden\" id=\"([^\"]*)\" name=\"fmt_mask\".*value=\"([^\"]*)\"/",
      $my_result, $u13);
    preg_match(
      "/<input type=\"checkbox\" id=\"truncate\" name=\"truncate\" value=\"([^\"]*)\"\/>/",
      $my_result, $u14);
    // fill in the necessary parameters parsed out now and earlier
    $of  = "WebEnv=" . $u5[1];
    $of .= "&query_key=" . $u6[1];
    $of .= "&db=" . $u7[1];
    $of .= "&qty=" . $u8[1];
    $of .= "&c_start=" . $u9[1];
    $of .= "&dopt=" . $u10[1];
    $of .= "&dispmax=" . $u11[1];
    $of .= "&sendto=" . $u12[1];
    $of .= "&fmt_mask=" . $u13[1];
    $of .= "&truncate=" . $u14[1];
    $of .= "&less_feat=";
    $of .= "&from=" . $fr["low"];
    $of .= "&to=" . $fr["high"];
    $of .= "&strand=" . $fr["reverse"];
    $of .= "&extrafeatpresent=1";
    $of .= "&ef_SNP=1";
    $of .= "&ef_CDD=8";
    $of .= "&ef_MGC=16";
    $of .= "&ef_HPRD=32";
    $of .= "&ef_STS=64";
    $of .= "&ef_tRNA=128";
    $of .= "&ef_microRNA=256";
    $of .= "&ef_Exon=512";
    $of .= "&submit=Refresh";
    $ourl = "http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?" . $of;
    // execute the final details form
    curl_setopt($ch,CURLOPT_URL,$ourl);
    curl_setopt($ch, CURLOPT_POST, 0);
    curl_setopt($ch,CURLOPT_POSTFIELDS, $of);
    curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($ch, CURLOPT_HEADER , 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    $my_result = curl_exec($ch);
    // parse the result page and get the final ORIGIN snippet
    preg_match("/ORIGIN\s*\n\s*<a name=\"[^\"]*\"><\/a>\s*([^\/]*)\//", $my_result, $u99);
    // output the final result ----------------------------------
    echo "\n" . preg_replace("/\s{2,}/", "\n", preg_replace("/\d+\s/", "", $u99[1]));
    ?>
    Edited by: Anton Wenzelhuemer on Aug 6, 2008 8:08 PM (Re-Formatted)

  • HELP!!!  can't get my site uploaded to the host due to some coding problem.

    have publish to folder from my iweb. intended to upload files to other hosting company. Downloaded Cyberduck to FTP file for the uploading. But have a problem as the hosting staff says that my files are loaded correctly but doesn't show probably due to some coding needs to be done to index.html. I've no idea how to do coding and the staff could not assist me either. Can someone help me please?

    My thought was that this happens when you have some kind of naming conflict that interferes with the separate index.html page that iWeb creates on publishing.
    You need to keep the name of your site short, so name your site something like Site or perhaps TT for short. Rather than naming any of your pages index, name them Home, Welcome or whatever fits with your site. Don't use underscores in a name. If you have a longer page name, then just enter it with the spaces and iWeb will do the rest for you on publication.
    When you click on publish to a folder, iWeb will create one folder with your site name on it that contains all the folders and files for your site. It also creates a separate index.html file and you need to upload both of these via ftp.
    With Cyberduck, link to your space and click on action at the top and upload. Upload the whole of your site folder (don't upload the pages separately, or they will be in the incorrect order and may not be seen) and then your index.html page and then place these items into the public_html folder or it could be named www and your website should then be live.

  • WBS coding problem

    Dear all,
    I have created project mask: P-0000000-00-00 and my special characters are:
    PL SL ET Sp SP SP SP SP SP SP SP Edit ANo
    1 " / . : 1 ; - < = %
    Something is wrong with project's coding.
    I try to create new project with cj01. In the first screen I select project definition as "P-0000001". After I press "enter" system goes to the second screen and changes project definition to "P". Why?
    I had maintained validation and substitutions rules before and executed program RGUGBR00 with all checked boxes. I suspect that might cause problem.
    Please suggest how I can correct the problem

    Approach 1
    If you have deactivated validation / substitution rule related to the Project coding mask. Than once again run  the same progrogram with similar parameter. &  try.
    If you are  still getting any error / warning message  realted to validation / sustitution rule  than let us know.
    Ask ABAP via running which programme you can deactivae ABAP coding for the validation & sustituion rule.
    Approach 2
    Altenatively take help of ABAP Guy & use TXn GGB4 for the validation / sustitution anaysis.
    GGB4--> activate validation/sustation > Select PS radio button>click on validation> Project structure radio button> give the project no execute.
    If you are in testing system than only you use GGB4.
    Hope may get some sort of help  out of it.
    Regards
    Nitin
    Edited by: Nitin  Patoliya on Dec 2, 2008 8:50 PM

  • Coding problem in a user exit for unit conversion please see it once

    Hi experts,
                   i am having a problem in coding i wont to convert the MSEG-ERFME field that is quantity field into tonne when ever it is kg. In tcode j1i5 i got one user exit J_1i7_userexit_validate now inside this user exit i have to write this code that when ever the UOM(unit of measure)ERFME comes in KG it should be converted into TONNE, This code is to be written in the user exit and has to be followed forward in other values.
    Thanks
    sumeet Malhotra

    Hi Experts,
                Have any one used this Function module unit_conversion_simple please help Not getting any reply since tmmrow,I am not able to get the desired output wont to convert all KG inputs into Tonne.
    this is the code part
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
       EXPORTING
         INPUT                      = ERFMG  " QUANTITY
       NO_TYPE_CHECK              = 'X'
       ROUND_SIGN                 = ' '
        UNIT_IN                    = ERFME  " ORIGINAL UOM WHICH EXIST
        UNIT_OUT                   = 'TO'   " UOM REQUIRED
    IMPORTING
       ADD_CONST                  =
       DECIMALS                   =
       DENOMINATOR                = 1000
       NUMERATOR                  =
        OUTPUT                     =   RESULT "OUTPUT
    EXCEPTIONS
       CONVERSION_NOT_FOUND       = 1
       DIVISION_BY_ZERO           = 2
       INPUT_INVALID              = 3
       OUTPUT_INVALID             = 4
       OVERFLOW                   = 5
       TYPE_INVALID               = 6
       UNITS_MISSING              = 7
       UNIT_IN_NOT_FOUND          = 8
       UNIT_OUT_NOT_FOUND         = 9
       OTHERS                     = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Please help
    Thanks
    Edited by: sumeet malhotra on Feb 7, 2009 5:46 AM

  • Web Service Issue - Security or Coding problem? *HELP*

    Hello all - I am stuck on a particular problem, which I've posted under flash player but also will post here in the event that it's my issue, and not a security/player issue.
    I have built a video player in Flash/ AS3 which communicates with WSDL web services using the as3webservice code package from wellconsidered. The player makes a call at startup to check a user's progress in a series of videos, and updates that progress by talking to the web service as the videos are played back.
    Tested locally, it works flawlessly. As soon as the player is uploaded, however, the web service' hangs' - so no fault is produced, but it seems to just never connect. This is presumably because the SWF is on one server, the web service on another. I've tried uploading it to two different servers, both different than the web service server. I'm trying to avoid moving the web service to the same server that hosts the SWF.
    I've tried adding a crossdomain.xml file to the root and subdirectories of the server that hosts the web service:
    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM
    "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
        <site-control permitted-cross-domain-policies="master-only"/>
        <allow-access-from domain="*"/>
        <allow-http-request-headers-from domain="*" headers="*"/>
    </cross-domain-policy>
    I've also tried playing with the SWF publishing options (Local Access only vs. Network only options), but no solution seems to help. I know it's not just the web service i"m using, because public web services (such as the ones found on webservicex.net) don't connect either.
    I'm at the end of my rope, and am wondering if this is a Flash Player security issue, or something I need to reconsider from my side (such as using a different web services package).I am wondering if a crossdomain.xml does not help, what other possible areas do I need to look at? If there is an article someone could point me to, or a simliar situation they've been in, i'm iopen to all suggestions.
    Thanks so much...fg

    You can generally check what the player is doing from the browser by using firefox with the firebug plugin. For example you can see the crossdomain permission requests or other urlrequests and responses. This is a useful way to debug as it sometimes shows issues or at the very least means you can eliminate one potential cause of the issue if there are no obvious problems there.
    If you don't have firefox/firebug, then (if you can) post a url with the swf in it that exhibits the error and I or someone else can check it for you and report back.

  • Style coding problems in html version of report

    How come when I create a very ugly plain html report using OR 6i, the html loads very quickly in the browser, but when I add the style coding the WWW wizard creates the html chugs like a snail? Is there some way to get around it, like external css? I'm a novice at OR 6i so much help is appreciated!!
    Thanks,
    Dia

    can you please tell me which parameter should I set because
    I am running report from menu and I gave parameters like
    add_parameter(pl_id,'DesFORMAT',TEXT_PARAMETER,'HTMLCSS');
    IT DOES NOT WORK !! IT GIVES ME SAME OUT PUT AS PLAIN html with
    out any borders OR COLORS( basically With out STYLE SHEET
    FORMAT !!)
    hello, >i assume you are refering to the difference between DesFormat=HTML and DesFormat=HTMLCSS.>there should be no big
    difference between these two formats.>in reports6i all style
    related information is created on the fly and in-line. there is
    no reference to an external file available.>regards, >the oracle
    reports team

  • Wls 701 oracle jdriver for 901 coding problem

    We are using simplified chinese, after swith to bea jdriver, it messed up
    all the encoding. So we cannot display Chinese character correctly.
    We are using WLS 7.0.1.0, Oracle 9.0.1 on both Windows and Solaris 8
    environment, BEA supplied JDK 1.3.1_03.
    We have many diffrent problems with oracle drivers:
    1. We want to use XA driver to support distributed transaction, However:
    * bea jdriver xa messes up with encoding
    * when using oracle 901 driver, everything works fince except webservices.
    Workshop application access the ejb, then the workshp application sets
    isolation level, but oracle driver does not support it and gives error.
    2. When not using XA, oracle thin driver works fine. But we lost XA
    capability.
    Any work around?

    Please try to reset NLS_LANG paramet in your environement before starting
    server if you are using weblogic XA driver.
    Mitesh
    Ma Jie wrote:
    We are using simplified chinese, after swith to bea jdriver, it messed up
    all the encoding. So we cannot display Chinese character correctly.
    We are using WLS 7.0.1.0, Oracle 9.0.1 on both Windows and Solaris 8
    environment, BEA supplied JDK 1.3.1_03.
    We have many diffrent problems with oracle drivers:
    1. We want to use XA driver to support distributed transaction, However:
    * bea jdriver xa messes up with encoding
    * when using oracle 901 driver, everything works fince except webservices.
    Workshop application access the ejb, then the workshp application sets
    isolation level, but oracle driver does not support it and gives error.
    2. When not using XA, oracle thin driver works fine. But we lost XA
    capability.
    Any work around?

  • Authorization object coding -problem. Pls suggest.

    Hi experts
    I have created authorization fields and assigned in objects properly.
    My case is i am calling the transaction ZMAST which is create through table maintenance(ZMASTER) of the table ZMASTER.
    Now where to implement this coding part and how to do.
    Please explain me clearly the steps , the following coding part i put in dialog programming right now and can you tell me will this code work fine.
    If we can do in Table maintenance Events, do we need to write in standard program. pls suggest me on this.
    WHEN 'MAST'.
    AT SELECTION-SCREEN.
    AUTHORITY-CHECK OBJECT 'ZRAJ_TEST1'
    0 ID 'ACTVT' FIELD '03'.
    IF sy-subrc <> 0.
    MESSAGE 'No authorization' TYPE 'E'.
    ENDIF.
    CALL TRANSACTION 'ZMAST'.
    Thanks in advance.
    Regards
    Rajaram

    Hi,
    The coding can be done in the "Events" section of the table maintenance.
    Chk this link for further help on this:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc
    Best Regards,
    Anjali

  • URGENT:ASM coding problem

    The following code inputs a string frm the user and then displays it back. I need to compare the user-inputted string (whose address is saved in DS:DX) with a String "HI". If the strings match, then "Success!!!" should be printed else the control should return to the OS. I have run the code in the emulator 8086.
    the problem is that the comparison is not taking place,and the "success!!" is printed irrespective of the input string... kindly assist me...
    org 100h
    .data
    OurBuff db 00h, 00h
    FirstS db 13, 10, "Please Enter a String: $"
    SecondS db 13, 10, "Entered String was: $"
    Success db 13, 10, "Success!!$"
    .code
    mov ax, @DATA
    mov ds, ax
    mov dx, offset FirstS
    mov ah, 09h
    int 21h
    mov bx, offset OurBuff
    mov dx, bx
    mov byte [bx], 33
    mov ah, 0Ah
    int 21h
    mov dx, offset SecondS
    mov ah, 09h
    int 21h
    mov al, [bx+1]
    add al, 02h
    xor ah, ah
    mov si, ax
    mov byte [bx+si], '$'
    mov dx, offset OurBuff
    add dx, 02h
    mov ah, 09h
    int 21h
    mov ax, dx
    cmp ax, "HI"
    je print
    print:
    mov dx, offset Success
    mov ah, 09h
    int 21h
    jmp exit
    exit:
    ret
    Message was edited by: 10may.agn03

    mov ax, dx
    cmp ax, "HI"
    je print
    jmp exit
    print:
    mov dx, offset Success
    mov ah, 09h
    int 21h

  • Character coding problem in UIX application

    Hi,
    I've just created a simple UIX Struts application
    with an input field on the page.
    If I write in a character with a code greater than
    127 (e.g. 'á' (0xe1)), in the ActionForm I get its
    UTF-8 coded, 2 byte long variation: 0xc3 and 0xa1.
    I think I understand this: by the UIX documentation,
    UIX internally uses the UTF-8 encoding.
    But if I return to the form in any way, in the input
    field I see only the encoded version of 'á' but but
    not 'á'. By the UIX documentation this should be handled
    by UIX automatically.
    What should I do?
    The requst.getLocale().toString() gives back 'hu', and
    request.getCharacterEncoding() is null.
    Thanks in advance,
    Gábor

    It seems I found the solution.
    In the web.xml in the <filter> tag of ADFBindingFilter the encoding parameter value was windows-1250.
    I changed it to UTF-8 and in this way I don't need the mentioned pagebroker.
    <filter>
    <filter-name>ADFBindingFilter</filter-name>
    <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
    <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
    </init-param>
    </filter>
    Gábor

  • RS232 - RS485 coding problem

    hi....
    i cannot find out where i got this wrong. if the program is logically right...then probably the command format is wrong...thanks for any suggetion...
    import java.io.*;
    import java.util.*;
    import javax.comm.*;
    public class ICPTest
    static CommPortIdentifier portId;
    static String     command = "#000+07.000013E";
    static SerialPort     serialPort;
    static OutputStream outputStream;
    //static boolean     outputBufferEmptyFlag = false;
    public static void main(String[] args)
    try
    portId = CommPortIdentifier.getPortIdentifier("COM1");
    } catch (NoSuchPortException ne) {System.out.println(ne);}
    try
              serialPort = (SerialPort) portId.open("ICPTest", 20000);
    } catch (PortInUseException pe) {System.out.println(pe);}
    try
              outputStream = serialPort.getOutputStream();
    } catch (IOException ie) {System.out.println(ie);}
         try
              serialPort.setSerialPortParams(9600,
                                  SerialPort.DATABITS_8,
                                  SerialPort.STOPBITS_1,
                                  SerialPort.PARITY_NONE);
    } catch (UnsupportedCommOperationException ue) {System.out.println(ue);}
         try
              serialPort.notifyOnOutputEmpty(true);
    } catch (Exception e)
                   System.out.println("Error setting event notification");
                   System.out.println(e.toString());
                   System.exit(-1);
    System.out.println(
                   "Writing \""+command+"\" to "
                   +serialPort.getName());
    serialPort.setDTR(true);
    serialPort.setRTS(true);
    try
              outputStream.write(command.getBytes());
    } catch (IOException e) {System.out.println(e);}
    try
              Thread.sleep(20000);
         } catch (Exception e) {System.out.println(e);}
    serialPort.setRTS(false);
    serialPort.close();
    System.out.println("End of transmition.");
    }

    oh...ya...
    the problem is....the command cannot be sent to the convertor, i cannot see the volt changing in the convertor....it just want for the timeout and then finished.

  • Waiting to get any support for my filtrering coding problem

    Hi All
    i have post since long time a suggestion on aspnet.uservoice to create a tutorial to teach how we can filter the listview through many dropdownlists and i didnt get any answers even i have post some question on asp.net forum but it same nothing useful. I
    am really looking to send a private message to the Microsoft CEO and hopeful if i can know how i can send to him a message he may give may ask the developer to be more interesting with solving my problem as i am using c# 
    here is my post on uservoice:
    http://aspnet.uservoice.com/forums/228522-show-me-how-with-code/suggestions/6251064-listview-filtering
    and here i have upload a screen shot to explain more what i am looking for
    https://www.youtube.com/watch?v=wtGxymU_IHM&feature=youtu.be

    Hi msimo1,
    This forum is to discuss problems of C# development. Your question is not related to the topic of this forum.Thanks for your understanding.
    Best regards,
    kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • ? symbol in Keynote - Help Needed please !!!!

    Hi, New to Mac and even newer to keynote..... when i open a new slide there are ? symbols on the slide which appear also when i play the slides.... is this an error or not ? If its an error what does it mean and if not how do i remove them ????? Plea

  • Transferring characteristics to APO from ECC

    Hi, We need transferring characteristic to APO from ECC. Only one characteristic. We're enter name of characteristic to field "Additional characteristics", but in created IM chosen, all existing characteristics. What we need to do to transfer only on

  • GLJPanel Problem

    Hello there, I'm JavaFX newbe and I have a newbe problem :) I'm using NetBeans 6.5 to make JavaFX 1.0 applications under Vista Ultimate SP1. A simple code import javax.media.opengl.*; import javafx.stage.Stage; import javafx.scene.Scene; import javaf

  • URGENT: xml:dml commit="yes" does not work

    Hello! Im using XDK 9.0.1.1.0A with Tomcat 4.0 and Oracle 9.0.1.1.1 on NT. I have a problem with commiting an xsql:dml action. I tried to set the commit-attribute like <?xml version="1.0"?> <page connection="demo" xmlns:xsql="urn:oracle-xsql"> <xsql:

  • You cannot burn the disc because you do not have permission to do so...

    Just completed the upgrade from Tiger to Leopard yesterday, and I'm getting this error whenever some of the accounts on the system (that are managed accounts in the parental controls window) ry and burn CDs. I have verified that the account has permi