Help in the code

hello experts,
I am uploading the data. For one field I am getting the value like 1341. So i have to equate this values to the first 4 charecters of LFA1-BAHNS
I have to get the LFA1-LIFNR where the value 1341 matches to the first 4 chars of  LFA1-BAHNS and update the corrsponding field.
Its urgent plz
Thanks & Regards,
Naveen

Hello Nitesha,
offset will not work in select query ..
Try to use below logic :
tables : lfa1.
data v_data(5) type c.
data i_lfa1 like lfa1 occurs 0 with header line.
start-of-selection.
refresh i_lfa1.
clear v_data.
concatenate itab-fld3 '%' into v_data.
select  * from lfa1 into table i_lfa1
               where  BAHNS like  v_data.
loop at i_lfa1.
if i_lfa1-bahns+(4) = itab-fld3.
update table .
exit.
endif.
endloop.              
Thanks
Seshu

Similar Messages

  • Can you help with the code to publish Flash to my own domain.

    Thank you for your help, I publish the my site to my own domain, I do not use .Mac, I tested your code and ity works well on .Mac, can you help with the code to publish to my own domain.
    Thank you again

    You appear to have just collected a variety of code snippets and thrown them together, including a section of AS2 code ( gage.onRelease = function() {... )
    The suggestion I offered yesterday still stands.  You should find a tutorial regarding AS3 and the atan2 function.  Beyond that, what you show suggests this is a school assignment.  You should seek help from your fellow students and instructor if that is the case.

  • Multiple Users Login ( Help With The Code ) Please.

    Hi all. Please help me...
    I'm using www.wix.com to create my websites.
    but since Wix.com don't able us to have member system conecet to database, i use Flash SWF As3 files...
    Please can anyone help me with the Code?
    Username=1    /Password= 1    /Url= www.1.com
    Username=2    /Password= 2    /Url= www.2.com
    Username=2    /Password= 2    /Url= www.2.com
    *If user name 1 or 2 or 3 correct. Show massage ex: Welcome back, if not correct " Bad login"
    *When login, it will open the url but in new page after the old one closed.
    + There is anyway to add " Password recovaring box too"?
    but not connected to datdabase as i said?
    Please help me, please! i areadly have code but it don't work for more than one user.
    Thank u soooo much!!
    Loai

    Here's the code i have already,,
    but i don't know how to add more than one user + when login it open new window ( popup ) i want it to open in the same window...
    Please help.
    stop();
    //hide the password
    //pass_txt.displayAsPassword = true;
    //adding event listener to the login button
    login_mc.addEventListener(MouseEvent.CLICK, loginUser);
    function loginUser(e:MouseEvent):void{
    //if both username and password are correct let the user logged in
    if(name_txt.text == "1" && pass_txt.text == "1"){
    navigateToURL( new URLRequest( "http://www.wix.com/designersgroup/tutorials/9-1" ), "_blank" );
    display_txt.text = "Going to secure area";
    else if(name_txt.text != "1" && pass_txt.text != "1"){
    display_txt.text = "Login failed!";
    if(name_txt.text == "2" && pass_txt.text == "2"){
    navigateToURL( new URLRequest( "http://www.wix.com/designersgroup/tutorials/9-2" ), "_blank" );
    display_txt.text = "Going to secure area";
    else if(name_txt.text != "2" && pass_txt.text != "2"){
    display_txt.text = "Login failed!";

  • James help with the code

    ok, i tried putting the code right after the first <body and it still came down there in the same spot... the only thing that seemed to change was adding <center>to the beginning even then it was down..... if you can view source on my page www.gameinfocenter.com the h ome page ma b you mite know exactly where to put it....

    The only thing you can do by simple pasting is to have the banner centered at the bottom of the screen.
    For any other location, you will have to do a little bit more work to specify exactly where on the page you want the banner to show up. Here's a write up that I did a while back. It's pretty straightforward...
    Adding HTML to iWeb pages

  • Plz help in the code

    I want to increase the number reduce the number specified in the textbox2 
    Dim ip1 As Integer = TextBox1.Text
    Dim ip2 As Integer = TextBox2.Text
    'Dim ip3 As Integer = TextBox1.Text
    'Dim ip4 As Integer = TextBox2.Text
    For i = ip1 To ip2
    ListBox1.Items.Add(i)
    next

    I don't know what "scan ip range" means. Also I haven't worked with IP addresses in a long time.
    So if you mean you want to get all IP addresses between 1.5.7.6 and 1.0.0.1 then do the match for that. Get the integer from 1.0.0.1 then get the integer for 1.5.7.6. Reduce the integer for 1.5.7.6 by one and get the IP address for that integer and so on
    until that integer equals the integer for 1.0.0.1. Unless that is not what you mean. And whatever "ip range" you come up with may contain invalid IP addresses since broadcast and network addresses may be included in the mix for all I know.
    La vida loca
    I want an example bro
    You want because that is simpler than learning through research.
    Also I am not your Bro. And I live in the desert now so I no longer hang out at the beach or windsurf so the word bro is unecessary as most people do not use it unless you are around a certain crowd which talks like they're hip or something. So don't call
    me bro.
    Here is an example.
    A ListBox can not apparently display all of the results without becoming unstable which I will not attempt to explain what occurs. You can try a ListBox if you want.
    Although with the previous code I provided you should have had the willpower and thoughtfulness to research on your own on how to use it rather than saying you want anybody else (specifically bro) to write the code for you. Which by doing so shows no effort
    on your part to learn. As if rather than writing code you are only capable of copying and pasting code and can not learn how code works in order to use it to perform what you want to do. So either you are attempting to program outside of your skillset range
    meaning you need to increase your scope of knowledge in various areas or perhaps you don't have the capability to program if you are unwilling to increase your scope of knowledge to raise your skillset to where it needs to be for what you want to program for.
    Also because of the time it takes this code to run for the two IP addresses you provided it would be a good idea to use threading to offload various code into a separate thread as this freezes the UI until the code ends after displaying the result.
    I will not do this for you.
    Option Strict On
    Imports System.Net
    Imports System.IO
    Imports System.Text
    Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Me.Location = New Point(CInt((Screen.PrimaryScreen.WorkingArea.Width / 2) - (Me.Width / 2)), CInt((Screen.PrimaryScreen.WorkingArea.Height / 2) - (Me.Height / 2)))
    Label1.Text = "Waiting"
    Label2.Text = "Waiting"
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    If ParseIP(TextBox1.Text) = True Then
    If ParseIP(TextBox1.Text) = True Then
    Label1.Text = "Waiting"
    Label2.Text = "Waiting"
    Dim SB As New StringBuilder
    Dim TBox1IPLong As Long = ConvertIPToLong(TextBox1.Text)
    Dim TBox2IPLong As Long = ConvertIPToLong(TextBox2.Text)
    If TBox1IPLong > TBox2IPLong Then
    Label1.Text = "Nr IP Addresses is " & (TBox1IPLong - TBox2IPLong).ToString & "."
    Label2.Text = "IP scan results for ip address" & _
    vbCrLf & TextBox1.Text & " to " & TextBox2.Text & "."
    TBox1IPLong -= 1
    Do Until TBox1IPLong = TBox2IPLong
    SB.Append(ConvertLongToIP(TBox1IPLong) & vbCrLf)
    TBox1IPLong -= 1
    Loop
    Else
    Label1.Text = "Nr IP Addresses is " & (TBox2IPLong - TBox1IPLong).ToString & "."
    Label2.Text = "IP scan results for ip address" & _
    vbCrLf & TextBox2.Text & " to " & TextBox1.Text & "."
    TBox2IPLong -= 1
    Do Until TBox2IPLong = TBox1IPLong
    SB.Append(ConvertLongToIP(TBox2IPLong) & vbCrLf)
    TBox2IPLong -= 1
    Loop
    End If
    RichTextBox1.Text = SB.ToString
    Else
    MessageBox.Show("TextBox2 contains invalid IP address. Try again.")
    Exit Sub
    End If
    Else
    MessageBox.Show("TextBox1 contains invalid IP address. Try again.")
    Exit Sub
    End If
    End Sub
    Private Function ParseIP(Item As String) As Boolean
    Dim TestIP As IPAddress
    Dim Result As Boolean = IPAddress.TryParse(Item, TestIP)
    Return Result
    End Function
    Private Function ConvertIPToLong(Item As String) As Long
    Dim BinaryOctet As String = ""
    Dim CompleteBinary As String = ""
    Dim ItemSplit() As String = Item.Split("."c)
    For i = 0 To ItemSplit.Count - 1
    BinaryOctet = Convert.ToString(CLng(ItemSplit(i)), 2)
    If BinaryOctet.Count < 8 Then
    Do Until BinaryOctet.Count = 8
    BinaryOctet = BinaryOctet.Insert(0, "0")
    Loop
    End If
    CompleteBinary &= BinaryOctet
    Next
    Dim Result As Long = Convert.ToInt64(CompleteBinary, 2)
    Return Result
    End Function
    Private Function ConvertLongToIP(Info As Long) As String
    Dim Temp As String = Convert.ToString(Info, 2)
    If Temp.Count <> 32 Then
    Do Until Temp.Count = 32
    Temp = Temp.Insert(0, "0")
    Loop
    End If
    Dim Result As String = CStr(CInt(Convert.ToInt32(Temp.Substring(0, 8), 2))) & "." & _
    CStr(CInt(Convert.ToInt32(Temp.Substring(8, 8), 2))) & "." & _
    CStr(CInt(Convert.ToInt32(Temp.Substring(16, 8), 2))) & "." & _
    CStr(CInt(Convert.ToInt32(Temp.Substring(24, 8), 2)))
    Return Result
    End Function
    End Class
    La vida loca

  • Need help improve the code

    I have this file but I need to improve the code on some method. The methods are addNode, deleteNode, saveNode, findLader and are they anyway for me to iliminate the findsmallest method?
    here is the code
    import java.io.*;
    import java.util.LinkedList;
    import java.util.Stack;
    import javax.swing.*;
    public class Graph {
    private LinkedList graph;
    private BufferedReader inputFile;
    public Graph() {
    graph = new LinkedList();
    // read the words from the given file
    // create a GraphNode
    // Add the node to the graph
    public void createGraph(String fileName) throws IOException {
    inputFile = new BufferedReader(
    new InputStreamReader(new FileInputStream("word.txt")));
    // Convert the linkedlist to an array 'a'
    // sort the array 'a'
    // create a string from all elements in 'a'
    // return the string
    public String printGraph() {
    String output = new String();
    // will contain String objects
    // ... do some work with the list, adding, removing String objects
    String[] a = new String[graph.size()];
    graph.toArray(a);
    // now stringArray contains all the element from linkedList
    quickSort(a, 0, a.size() - 1);
    for(int i=0;i<a.length;++i)
    output = output + new String(a.toString())+"\n";
    return output;
    private static void quickSort(Comparable[] theArray,
    int first, int last) {
    // Sorts the items in an array into ascending order.
    // Precondition: theArray[first..last] is an array.
    // Postcondition: theArray[first..last] is sorted.
    // Calls: partition.
    int pivotIndex;
    if (first < last) {
    // create the partition: S1, Pivot, S2
    pivotIndex = partition(theArray, first, last);
    // sort regions S1 and S2
    quickSort(theArray, first, pivotIndex-1);
    quickSort(theArray, pivotIndex+1, last);
    } // end if
    } // end quickSort
    private static int partition(Comparable[] theArray,
    int first, int last) {
    // Partitions an array for quicksort.
    // Precondition: theArray[first..last] is an array;
    // first <= last.
    // Postcondition: Returns the index of the pivot element of
    // theArray[first..last]. Upon completion of the method,
    // this will be the index value lastS1 such that
    // S1 = theArray[first..lastS1-1] < pivot
    // theArray[lastS1] == pivot
    // S2 = theArray[lastS1+1..last] >= pivot
    // Calls: choosePivot.
    // tempItem is used to swap elements in the array
    Comparable tempItem;
    // place pivot in theArray[first]
    //choosePivot(theArray, first, last);
    Comparable pivot = theArray[first]; // reference pivot
    // initially, everything but pivot is in unknown
    int lastS1 = first; // index of last item in S1
    // move one item at a time until unknown region is empty
    for (int firstUnknown = first + 1; firstUnknown <= last;
    ++firstUnknown) {
    // Invariant: theArray[first+1..lastS1] < pivot
    // theArray[lastS1+1..firstUnknown-1] >= pivot
    // move item from unknown to proper region
    if (theArray[firstUnknown].compareTo(pivot) < 0) {
    // item from unknown belongs in S1
    ++lastS1;
    tempItem = theArray[firstUnknown];
    theArray[firstUnknown] = theArray[lastS1];
    theArray[lastS1] = tempItem;
    } // end if
    // else item from unknown belongs in S2
    } // end for
    // place pivot in proper position and mark its location
    tempItem = theArray[first];
    theArray[first] = theArray[lastS1];
    theArray[lastS1] = tempItem;
    return lastS1;
    } // end partition
    // Given a new word, add it to the graph
    public void addNode(String word) {
    GraphNode node = new GraphNode(word);
    if(graph.contains(node)){
    JOptionPane.showMessageDialog(null,"Duplicate Word, operation terminated");
    for(int i=0; i<graph.size(); ++i) {
    if(isAnEdge((String)(((GraphNode)graph.get(i)).getVertex()),(String)(node.getVertex()))) {
    EdgeNode e1 = new EdgeNode((String)node.getVertex(),1);
    EdgeNode e2 = new EdgeNode((String)((GraphNode)graph.get(i)).getVertex(),1);
    node.addEdge(e2);
    ((GraphNode)graph.get(i)).addEdge(e1);
    graph.add(node);
    public boolean deleteNode(String word) {
    GraphNode node = new GraphNode(word);
    EdgeNode n = new EdgeNode(word,1);
    if(!graph.contains(node)) {
    return false;
    else {
    for(int i=0; i<graph.size();++i) {
    ((GraphNode)graph.get(i)).getEdgeList().remove(n);
    graph.remove(node);
    return true;
    public void save(String fileName) {
    try {
    PrintWriter output = new PrintWriter(new FileWriter("word.txt"));
    for(int i=0; i< graph.size();++i) {
    output.println(((GraphNode)graph.get(i)).getVertex());
    output.close();
    catch (IOException e) {
    // given two word, find the ladder (using dijkstra's algorithm
    // create a string for the ladder and return it
    public String findLadder(String start,String end) {
    String ladder = new String();
    GraphNode sv = new GraphNode(start);
    GraphNode ev = new GraphNode(end);
    if(!graph.contains(sv)) {
    JOptionPane.showMessageDialog(null,start + " not in graph");
    return null;
    if(!graph.contains(ev)) {
    JOptionPane.showMessageDialog(null,end + " not in graph");
    return null;
    LinkedList distance = new LinkedList(((GraphNode)graph.get(graph.indexOf(sv))).getEdgeList());
    LinkedList visited = new LinkedList();
    visited.add(start);
    LinkedList path = new LinkedList();
    path.add(new PathNode(start,"****"));
    for(int i=0; i<distance.size();++i) {
    PathNode p = new PathNode((String)((EdgeNode)distance.get(i)).getKey(),start);
    path.add(p);
    while(!visited.contains(end)) {
    EdgeNode min = findSmallest(distance,visited);
    String v = (String)min.getVertex();
    if(v.equals("****"))
    return null;
    visited.add(v);
    // for(int i=0;i<graph.size();++i) {
    // String u = (String)(((GraphNode)(graph.get(i))).getVertex());
    GraphNode temp1 = new GraphNode(v);
    int index = graph.indexOf(temp1);
    LinkedList l = new LinkedList(((GraphNode)graph.get(index)).getEdgeList());
    for(int i=0;i<l.size();++i)
    String u = (String)(((EdgeNode)(l.get(i))).getVertex());
    if(!visited.contains(u)) {
    int du=999, dv=999, avu=999;
    dv = min.getCost();
    EdgeNode edge = new EdgeNode(u,1);
    if(distance.contains(edge)) {
    du = ((EdgeNode)(distance.get(distance.indexOf(edge)))).getCost();
    GraphNode temp = new GraphNode(v);
    GraphNode node = ((GraphNode)(graph.get(graph.indexOf(temp))));
    LinkedList edges = node.getEdgeList();
    if(edges.contains(edge)) {
    avu = ((EdgeNode)(edges.get(edges.indexOf(new EdgeNode(u,1))))).getCost();
    if( du > dv+avu) {
    if(du == 999) {
    distance.add(new EdgeNode(u,dv+avu));
    path.add(new PathNode(u,v));
    else {
    ((EdgeNode)(distance.get(distance.indexOf(u)))).setCost(dv+avu);
    ((PathNode)(path.get(path.indexOf(u)))).setEnd(v);
    if(!path.contains(new PathNode(end,"")))
    return null;
    LinkedList pathList = new LinkedList();
    for(int i=0;i<path.size();++i) {
    PathNode n = (PathNode)path.get(path.indexOf(new PathNode(end,"****")));
    if(n.getEnd().compareTo("****") != 0) {
    pathList.addFirst(end);
    n = (PathNode)path.get(path.indexOf(new PathNode(n.getEnd(),"****")));
    end = n.getStart();
    pathList.addFirst(start);
    for(int i=0;i<pathList.size()-1;++i) {
    ladder = ladder + ((String)(pathList.get(i))) + " --> ";
    ladder = ladder + ((String)(pathList.get(pathList.size()-1)));
    return ladder;
    private EdgeNode findSmallest(LinkedList distance, LinkedList visited) {
    EdgeNode min = new EdgeNode("****",999);
    for(int i=0;i<distance.size();++i) {
    String node = (String)(((EdgeNode)distance.get(i)).getVertex());
    if(!visited.contains(node)) {
    if(((EdgeNode)distance.get(i)).getCost()<min.getCost()) {
    min = (EdgeNode)distance.get(i);
    return min;
    // class that represents nodes inserted into path set
    private class PathNode {
    protected String sv;
    protected String ev;
    public PathNode(String s,String e) {
    sv = s;
    ev = e;
    public String getEnd() {
    return ev;
    public String getStart() {
    return sv;
    public void setEnd(String n) {
    ev = n;
    public boolean equals(Object o) {
    return this.sv.equals(((PathNode)o).sv);
    public String toString() {
    return "("+sv+":"+ev+")";
    thank you

    let me fix my misstake which was point out by some one in here and thank you ofr do so because I'm new at this.
    I have this file but I need to improve the code on some method. The methods are addNode, deleteNode, saveNode, findLader and are they anyway for me to iliminate the findsmallest method?
    here is the code
    import java.io.*;
    import java.util.LinkedList;
    import java.util.Stack;
    import javax.swing.*;
    public class Graph {
    private LinkedList graph;
    private BufferedReader inputFile;
    public Graph() {
    graph = new LinkedList();
    // read the words from the given file
    // create a GraphNode
    // Add the node to the graph
    public void createGraph(String fileName) throws IOException {
    inputFile = new BufferedReader(
    new InputStreamReader(new FileInputStream("word.txt")));
    // Convert the linkedlist to an array 'a'
    // sort the array 'a'
    // create a string from all elements in 'a'
    // return the string
    public String printGraph() {
    String output = new String();
    // will contain String objects
    // ... do some work with the list, adding, removing String objects
    String[] a = new String[graph.size()];
    graph.toArray(a);
    // now stringArray contains all the element from linkedList
    quickSort(a, 0, a.size() - 1);
    for(int i=0;i<a.length;++i)
    output = output + new String(a.toString())+"\n";
    return output;
    private static void quickSort(Comparable[] theArray,
    int first, int last) {
    // Sorts the items in an array into ascending order.
    // Precondition: theArray[first..last] is an array.
    // Postcondition: theArray[first..last] is sorted.
    // Calls: partition.
    int pivotIndex;
    if (first < last) {
    // create the partition: S1, Pivot, S2
    pivotIndex = partition(theArray, first, last);
    // sort regions S1 and S2
    quickSort(theArray, first, pivotIndex-1);
    quickSort(theArray, pivotIndex+1, last);
    } // end if
    } // end quickSort
    private static int partition(Comparable[] theArray,
    int first, int last) {
    // Partitions an array for quicksort.
    // Precondition: theArray[first..last] is an array;
    // first <= last.
    // Postcondition: Returns the index of the pivot element of
    // theArray[first..last]. Upon completion of the method,
    // this will be the index value lastS1 such that
    // S1 = theArray[first..lastS1-1] < pivot
    // theArray[lastS1] == pivot
    // S2 = theArray[lastS1+1..last] >= pivot
    // Calls: choosePivot.
    // tempItem is used to swap elements in the array
    Comparable tempItem;
    // place pivot in theArray[first]
    //choosePivot(theArray, first, last);
    Comparable pivot = theArray[first]; // reference pivot
    // initially, everything but pivot is in unknown
    int lastS1 = first; // index of last item in S1
    // move one item at a time until unknown region is empty
    for (int firstUnknown = first + 1; firstUnknown <= last;
    ++firstUnknown) {
    // Invariant: theArray[first+1..lastS1] < pivot
    // theArray[lastS1+1..firstUnknown-1] >= pivot
    // move item from unknown to proper region
    if (theArray[firstUnknown].compareTo(pivot) < 0) {
    // item from unknown belongs in S1
    ++lastS1;
    tempItem = theArray[firstUnknown];
    theArray[firstUnknown] = theArray[lastS1];
    theArray[lastS1] = tempItem;
    } // end if
    // else item from unknown belongs in S2
    } // end for
    // place pivot in proper position and mark its location
    tempItem = theArray[first];
    theArray[first] = theArray[lastS1];
    theArray[lastS1] = tempItem;
    return lastS1;
    } // end partition
    // Given a new word, add it to the graph
    public void addNode(String word) {
    GraphNode node = new GraphNode(word);
    if(graph.contains(node)){
    JOptionPane.showMessageDialog(null,"Duplicate Word, operation terminated");
    for(int i=0; i<graph.size(); ++i) {
    if(isAnEdge((String)(((GraphNode)graph.get(i)).getVertex()),(String)(node.getVertex()))) {
    EdgeNode e1 = new EdgeNode((String)node.getVertex(),1);
    EdgeNode e2 = new EdgeNode((String)((GraphNode)graph.get(i)).getVertex(),1);
    node.addEdge(e2);
    ((GraphNode)graph.get(i)).addEdge(e1);
    graph.add(node);
    public boolean deleteNode(String word) {
    GraphNode node = new GraphNode(word);
    EdgeNode n = new EdgeNode(word,1);
    if(!graph.contains(node)) {
    return false;
    else {
    for(int i=0; i<graph.size();++i) {
    ((GraphNode)graph.get(i)).getEdgeList().remove(n);
    graph.remove(node);
    return true;
    public void save(String fileName) {
    try {
    PrintWriter output = new PrintWriter(new FileWriter("word.txt"));
    for(int i=0; i< graph.size();++i) {
    output.println(((GraphNode)graph.get(i)).getVertex());
    output.close();
    catch (IOException e) {
    // given two word, find the ladder (using dijkstra's algorithm
    // create a string for the ladder and return it
    public String findLadder(String start,String end) {
    String ladder = new String();
    GraphNode sv = new GraphNode(start);
    GraphNode ev = new GraphNode(end);
    if(!graph.contains(sv)) {
    JOptionPane.showMessageDialog(null,start + " not in graph");
    return null;
    if(!graph.contains(ev)) {
    JOptionPane.showMessageDialog(null,end + " not in graph");
    return null;
    LinkedList distance = new LinkedList(((GraphNode)graph.get(graph.indexOf(sv))).getEdgeList());
    LinkedList visited = new LinkedList();
    visited.add(start);
    LinkedList path = new LinkedList();
    path.add(new PathNode(start,"****"));
    for(int i=0; i<distance.size();++i) {
    PathNode p = new PathNode((String)((EdgeNode)distance.get(i)).getKey(),start);
    path.add(p);
    while(!visited.contains(end)) {
    EdgeNode min = findSmallest(distance,visited);
    String v = (String)min.getVertex();
    if(v.equals("****"))
    return null;
    visited.add(v);
    // for(int i=0;i<graph.size();++i) {
    // String u = (String)(((GraphNode)(graph.get(i))).getVertex());
    GraphNode temp1 = new GraphNode(v);
    int index = graph.indexOf(temp1);
    LinkedList l = new LinkedList(((GraphNode)graph.get(index)).getEdgeList());
    for(int i=0;i<l.size();++i)
    String u = (String)(((EdgeNode)(l.get(i))).getVertex());
    if(!visited.contains(u)) {
    int du=999, dv=999, avu=999;
    dv = min.getCost();
    EdgeNode edge = new EdgeNode(u,1);
    if(distance.contains(edge)) {
    du = ((EdgeNode)(distance.get(distance.indexOf(edge)))).getCost();
    GraphNode temp = new GraphNode(v);
    GraphNode node = ((GraphNode)(graph.get(graph.indexOf(temp))));
    LinkedList edges = node.getEdgeList();
    if(edges.contains(edge)) {
    avu = ((EdgeNode)(edges.get(edges.indexOf(new EdgeNode(u,1))))).getCost();
    if( du > dv+avu) {
    if(du == 999) {
    distance.add(new EdgeNode(u,dv+avu));
    path.add(new PathNode(u,v));
    else {
    ((EdgeNode)(distance.get(distance.indexOf(u)))).setCost(dv+avu);
    ((PathNode)(path.get(path.indexOf(u)))).setEnd(v);
    if(!path.contains(new PathNode(end,"")))
    return null;
    LinkedList pathList = new LinkedList();
    for(int i=0;i<path.size();++i) {
    PathNode n = (PathNode)path.get(path.indexOf(new PathNode(end,"****")));
    if(n.getEnd().compareTo("****") != 0) {
    pathList.addFirst(end);
    n = (PathNode)path.get(path.indexOf(new PathNode(n.getEnd(),"****")));
    end = n.getStart();
    pathList.addFirst(start);
    for(int i=0;i<pathList.size()-1;++i) {
    ladder = ladder + ((String)(pathList.get(i))) + " --> ";
    ladder = ladder + ((String)(pathList.get(pathList.size()-1)));
    return ladder;
    private EdgeNode findSmallest(LinkedList distance, LinkedList visited) {
    EdgeNode min = new EdgeNode("****",999);
    for(int i=0;i<distance.size();++i) {
    String node = (String)(((EdgeNode)distance.get(i)).getVertex());
    if(!visited.contains(node)) {
    if(((EdgeNode)distance.get(i)).getCost()<min.getCost()) {
    min = (EdgeNode)distance.get(i);
    return min;
    // class that represents nodes inserted into path set
    private class PathNode {
    protected String sv;
    protected String ev;
    public PathNode(String s,String e) {
    sv = s;
    ev = e;
    public String getEnd() {
    return ev;
    public String getStart() {
    return sv;
    public void setEnd(String n) {
    ev = n;
    public boolean equals(Object o) {
    return this.sv.equals(((PathNode)o).sv);
    public String toString() {
    return "("+sv+":"+ev+")";
    }thank you

  • Ajax - Multiple Values - Help with the code

    Hi all,
    My code is probably wrong, though, I don't know where the problem is. I'm not that good with programming and copied the example from oracle.com and modified it... I hope you guys can help me. Here is what I have:
    A select list: P4_DOBJ1_NR (The user selects something from DOBJ_NR from the table dataobject)
    A display as text item: P4_NAMSP1
    Another display as text item: P4_DOBJ_NAME1
    Here my code:
    HTML Header Setting for my select list-attribut:
    onchange="javascript:getDOBJ1Info(this);"
    The HTML header from my page:
    <script type="text/javascript">
    function getDOBJ1Info(filter)
    var xml = null;
    var get = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=GETDOBJ1Info',0);
    get.add('GOBJ1NO', filter.value);
    ret = get.get('XML');
    if(ret)
    var oneItems = ret.getElementsByTagName("NAMSP");
    if (oneItems)
    var onedisplay = document.getElementById("P4_NAMSP1");
    onedisplay.innerHTML = oneItems[0].getAttribute("VALUE");
    var twoItems = ret.getElementsByTagName("DOBJ_NAME");
    if (twoItems)
    var twodisplay = document.getElementById("P4_DOBJ_NAME1");
    twodisplay.innerHTML = twoItems[0].getAttribute("VALUE");
    get = null;
    </script>
    An application item, called: GOBJ1NO
    And the Application Process:
    DECLARE
    vONE VARCHAR2(100);
    vTWO VARCHAR2(100);
    BEGIN
    owa_util.mime_header('text/xml', FALSE );
    htp.p('Cache-Control: no-cache');
    htp.p('Pragma: no-cache');
    owa_util.http_header_close;
    htp.prn('<DATA>');
    SELECT NAMSP, DOBJ_NAME INTO vONE, vTWO FROM DATAOBJECT WHERE DOBJ_NR = :GOBJ1NO;
    htp.prn('<ONE VALUE="' || vONE || '"></ONE>');
    htp.prn('<TWO VALUE="' || vTWO || '"></TWO>');
    htp.prn('</DATA>');
    EXCEPTION WHEN OTHERS THEN
    htp.prn('<ONE VALUE="Error"></ONE>');
    htp.prn('<TWO VALUE="Error"></TWO>');
    END;

    Your process returns a XML document with structure
    <DATA>
       <ONE> value one </ONE>
       <TWO> value two </TWO>
    </DATA>but you are trying to retrieve element named "NAMSP"
    so try to chang it to :
    var oneItems = ret.getElementsByTagName("ONE");You will find fantastic examples on Denes Kubicek web site:
    Try this url:
    http://apex.oracle.com/pls/otn/f?p=31517:106:1074750275898234::NO
    HTH
    Thomas

  • Need help with the code...

    The program should accept two inputs from user in form of military time for example (1245). Then it should calculate and display the difference.
    For some reason it displays 0's...
    Please help.
    Thanks.
    public class TimeInterval
    private int firstHour;
    private int firstMin;
    private int secondHour;
    private int secondMin;
    //Constructor
    public TimeInterval(String first, String second)
    String h1 = first.substring(0,1);
    int h2 = Integer.parseInt(h1);
    firstHour = h2;
    //firstHour = Integer.parseInt(first.substring(0,1));
    String m1 = second.substring(2,3);
    int m2 = Integer.parseInt(m1);
    firstMin = m2;
    //firstMin = Integer.parseInt(second.substring(2,3));
    String hh1 = first.substring(0,1);
    int hh2 = Integer.parseInt(hh1);
    secondHour = hh2;
    //secondHour = Integer.parseInt(first.substring(0,1));
    String mm1 = second.substring(2,3);
    int mm2 = Integer.parseInt(mm1);
    secondMin = mm2;
    //secondMin = Integer.parseInt(second.substring(2,3));
    //Methods
    public int getHours()
    int HourDifference = secondHour - firstHour;
    return HourDifference;
    public int getMinutes()
    int MinutesDifference = secondMin - firstMin;
    return MinutesDifference;
    import java.util.Scanner;
    public class TimeIntervalTest
    public static void main(String[] args)
    Scanner scanner = new Scanner(System.in);
    System.out.print("Enter the First time now:");
    String hr = scanner.next();
    System.out.print("Enter the Second time now:");
    String mn = scanner.next();
    System.out.println(hr);
    System.out.println(mn);
    TimeInterval timeDifference = new TimeInterval(hr, mn);
    System.out.println(timeDifference.getHours());
    System.out.println(timeDifference.getMinutes());
    }

    I can't say I understand your code, but for a starter, I think you are misunderstanding method substring:
    public class StringExample {
        public static void main(String[] args) {
            String first = "2345";
            String h1 = first.substring(0,1);
            System.out.println(h1);
    }

  • Urgent-Need help with the code.

    Hi gurus,
    I am trying to write a code where i am populating the ZZorg1,ZZorg2 and ZZorg3 in VBRP tableto 2LIS_13_VDITM.
    WHEN '2LIS_13_VDITM'.
    DATA: X_T_DATA Like MC13VD0ITM.
       Loop at C_T_DATA into X_T_DATA.
          Select Single ZZSORG1 into X_T_DATA-ZZSORG1
                        ZZSORG2 into X_T_DATA-ZZSORG2
                        ZZSORG3 into X_T_DATA-ZZSORG3
          FROM VBRP
          WHERE VBELN = X_T_DATA-VBELN
          AND   POSNR = X_T_DATA-POSNR.
        MODIFY C_T_DATA from X_T_DATA.
        ENDLOOP.
    I am getting the following error when running a error check.
    "ZZSORG2 INTO X_T_DATA-ZZSORG2" is not expected.Can anybody let me know what i am doing wrong as i new to ABAP.          
    Thanks in advance
    Resolved it,thanks
    Message was edited by:
            sap novice

    Resolved it

  • Help with the code

    Hi all,
    i have records like in internal table itab
    id      amount
    101  1  1.00
    101  2  2.00
    102  1  1.00
    102  2  2.50
    102  3  3.00
    103  2  1.50
    i want the output like like this internal table itab1
    101  3.00
    102  6.50
    103  1.50
      clear : wa_zoritem ,price.
    total= 0.00
    loop at itab into wa_itab.
    on change of wa_itab1-id.
    clear total.
    total= total + wa_itab1-amount.
    wa_itab1-id   = wa_itab_copy-id.
    wa_itab1-total= wa_itab_copy-total.
    append wa_itab1 to itab1.
    endon.
    *MODIFY TABLE i_FINAL FROM wa_FINAL
                     TRANSPORTING COST.
    *MODIFY  wa_final to i_final.
    wa_itab_copy = wa_itab.
    clear : wa_itab.
    endloop.
    This works fine when i have multiple records
    but this doesn't work when i have the follwwing record in itab
    id      amount
    101  1  1.00
    Thanks

    hi,
    *suppose the data is avialble in the internal table ITAB.
    [code]
    sort ITAB by ID amount.
    delete adjacent duplicates from ITAB comparing ID.
    *Now thw ITAB conatins only the records.
    *101 3.00
    *102 6.50
    *103 1.50[/code]
    Regards
    Reshma

  • Need help in the code for updating a record ( conditional update)

    all set
    Edited by: 871431 on Jul 9, 2011 6:30 PM

    871431 wrote:
    Hi
    I am looking to update a table which contains approved & unapproved records, for that date & fund combination it should allow only one unapproved record.
    what I did is check if the record is U if the incoming value is Unapproved for that fund & date combination raise error, but if I need to update that Unapproved record it raises error....so I need to update that record, and raise error if trying to insert another unapproved record.
    Hope I am clear....Not clear for me
    Help needed plsPlease realize & understand that everyone here speaks SQL
    please post DDL for table
    please provide sample/test data & then explain using actual test data what the results should be & why

  • I need help with motion control. I am programming in Visual Basic. I will need help with what parts I need to purchase from NI, along with help on the code.

    I am using a Papst servo motor and I need to know where to start and what to purchase to get this motor to spin. I am using visual basic and in my program I calculate the direction and RPM's needed from the motor. It will spin anywhere from 1 to 10000 RPM's. It seems rather easy, but I have no idea on how to spin the motor at the specific RPM, and stop it with a command stop in the program. Please help.

    We really should know a little more about your intended uses for this system, but assuming you want to do relatively simple (or even not so simple!) motion, you'll need a few components...
    A motion controller, such as the PCI-7342, can take your VB commands and turn them into the commands needed to "run" the motor. Next you'll need a drive, such as the MID-7342. This includes the servo amplifier that actually powers the motor. It also has connections to "pass through" the encoder signals from the motor back to the motion controller.
    The above-named pieces assume one or two axes of motion. You'll also need a cable to connect the two (can't remember the model right now). You can use MAX to configure the motion controller, and there are just a few VB calls you
    'll need to make using NI-Motion functions to define the motion and get it going.
    Hope this helps!

  • Can u plz help me with the code to add BWART field to the DS:2LIS_04_P_COMP

    I want to add BWART field from AUFM table to the DS:2LIS_04_P_COMP.
    The AUFM table has key fields as :MBLNR,MJAHR and ZEILE.Can someone plz help with the code to put in the existing function module.I see that both 2LIS_04_P_COMP and AUFM have common field AUFNR process order.
    Plz help ASAP.

    I want to add BWART field from AUFM table to the DS:2LIS_04_P_COMP.
    The AUFM table has key fields as :MBLNR,MJAHR and ZEILE.Can someone plz help with the code to put in the existing function module.I see that both 2LIS_04_P_COMP and AUFM have common field AUFNR process order.
    Plz help ASAP.

  • Help with html code - inserting video into Muse

    I am seeking help writing the code to insert a video into Muse. I uploaded video into my Business Catalyst hosting. I need it to autoplay, loop and not show any controls or frames.
    When I host video on Vimeo or YouTube, I see markings on the video that is why I am trying to just host in the same place that the files are stored for my website. If there is a way to host on youtube with out any markings showing up on the video I would be open to that too.
    I don't want to see any play button or time bar.
    Thanks in advance!!

    Hello,
    Just as an FYI - we also have an HTML5 video tool over at MuseThemes.com that achieves this, but works on mobile devices as well. The link above looks like it uses Flash, which isn't common anymore since the release of HTML5 based video.
    Simply drag the widget out onto your canvas, and link up your videos / set options like loop, controls visible, etc. It's quite a flexible widget, and there's a complete training video included so you don't get stuck
    Check out the widget here
    Just wanted to provide another alternative that could be helpful. Cheers!
    Steve Harris
    MuseThemes.com

  • In synk, when I click "add device" instead of opening a window to enter the codes, it opens another firefox window and takes me to the help page for synk. [SOLVED]

    I got a new laptop today and after downloading firefox I tried to use the synk feature and it says I have to add device on my old computer. In following the directions I never get to the screen to enter the codes from my new computer onto the old one. When I click add device on the old computer it takes me to the help page on the web with the same directions that took me there in the first place! So, how am I supposed to synk my new computer if I can't add device on the old or simply log in to my synk account on the new?

    Ok, I figured it out, I clicked "i don't have device available" and it let me log in to my account.

Maybe you are looking for