Strange number conversion when using preparedStatement.setLong

Hello all,
I've been working with some code for a while now, and for the most part has been working just fine. As a unique identifier for by objects, I've been using an integer value (int), but have reached the point where I'd like to use a long value.
In creating the table, the type for ID is BIGINT (formerly INTEGER)
      s.executeUpdate("CREATE TABLE Birth_Registry" +
                      "(RUNID INTEGER, " +
                      "ID BIGINT, " +
                      "BIRTHPLACE INTEGER, " +
                      "SEX CHAR, " +
                      "FATHER_ID BIGINT, " +
                      "MOTHER_ID BIGINT, " +
                      "BIRTHDAY DATETIME, " +
                      "primary key(RUNID, ID))");and the preparedStatement looks like:
birthstmt = bcon.prepareStatement(
          "INSERT INTO Birth_Registry VALUES (?, ?, ?, ?, ?, ?, ?)");The actual insertion used to look like (where hom.getID returned an int):
          birthstmt.setInt(1, Core.getRunID());
          birthstmt.setInt(2, hom.getID());
          birthstmt.setInt(3, hom.getBirthplace());
           .  //(more code here filling in other sets)
          birthstmt.addBatch();II've since changed hom.getID to return a long and I now have (for the second line)
birthstmt.setLong(2, hom.getID());-------------
Here's the weird part - using ints, all my numbers convert normally. For example if I have ids 100-110, they show up in the database properly (and uniquely).This still works if I perform an explicit cast, converting the long result of hom.getID() to int (not good programming, but suffices to show a point)
birthstmt.setInt(2, (int) hom.getID())But if I use
birthstmt.setLong(2, hom.getID())I get values like 206158430210 and 210453387505 in the ID field, and duplicates also appear (violating my primary key constraint - which in this case is a good thing).
I'm using SQL Server 2005, Java 1.5_04b5 and have all the latest patches/updates etc. for both. I just can't figure out why changing to setLong leads to such a different number, and if there's something that I can do about it.
Thanks in advance for your help. My only request is for courteous replies - yes I work with Java, but it's not my profession, so I'm trying to do the best I can.

I'm assuming the method you are calling is
PreparedStatement.setLong(int parameterIndex, long x)
this
birthstmt.setLong(2, hom.getID())causes a cast as getID() returns an int?
try
birthstmt.setLong(2, new Integer(hom.getID()).longValue())no casting
Bamkin
Message was edited by:
bamkin-ov-lesta
Think I just read this question the wrong way round ... apologies. Please ignore
I have had problems with casting before and was quick to read this as the problem

Similar Messages

  • Wrong number of parameters exception when using PreparedStatement

    Hi,
    I'm getting Wrong number of parameters exception when using a prepared statement. It's very weird. The code is:
    sqlstmt="update blah1 set blah2=? where blah3=?";
    myps = Conn.prepareStatement(sqlstmt);
    myps.setString(1, p1);
    myps.setInt(2, p2);
    myps.executeUpdate(sqlstmt);
    The error is:
    SQLException: [IBM][CLI Driver] CLI0100E Wrong number of parameters. SQLSTATE=07001:07001
    Could someone please help? Thanks
    Mahdad

    Hi and thanks for the reply.
    Actually this is the try block...
    The variable's defintions are correct.
    PreparedStatement myps;
    try {
    sqlstmt="update blah1 set blah2=? where blah3=?";
    myps = Conn.prepareStatement(sqlstmt);
    myps.setString(1, blah4);
    myps.setInt(2, blah5);
    myps.executeUpdate(sqlstmt);
    catch (SQLException e) {
    System.out.println("SQLException: " + e.getMessage() + ":" + e.getSQLState());
    blah6++;

  • E71 stopped displaying number list when using cont...

    Hi All,
    I hope someone out there can help me.  I have an E71 that just stopped displaying the number list when I contact search from the home screen.  Here's what happens.
    I'm at the home screen.  I type in a Contact name, say "John."
    A list of names appears for "John."  I select the "John" I want and press the green call button.
    The list of names disappears and I see the home screen again.
    If I press a number on the keypad, then the list of numbers appears.
    This just started happening.  I reset the factory settings for the phone and the problem went away for about 4 phone calls.  Then it reappeared. So I reset to factory settings again.  The same thing happened.
    It's really strange.  Can anyone help me get rid of the bug?  I've been using this phone for 18 months now with no problems like this.
    Firmware Version is: 410.21.010

    Bump

  • Working around unchecked conversions when using reflection

    I think I've convinced myself that there's no way around this issue when using reflection and Generics, but here's the issue:
    Suppose I've got a method that uses reflection to compare an arbitrary property in
    an arbitrary pair of beans (of the same class).
    public static <T> int compare(T bean0, T bean1, String prop) throws Exception {
         Method m = bean0.getClass().getMethod(
                   "get" + prop.substring(0,1).toUpperCase() +
                   prop.substring(1));
         Object o0 = m.invoke(bean0);
         Object o1 = m.invoke(bean1);
         if (o0 instanceof Comparable &&
             o1 instanceof Comparable &&
             (o1.getClass().isAssignableFrom(o0.getClass()) ||
              o0.getClass().isAssignableFrom(o1.getClass()))) {
              return ((Comparable)o0).compareTo(o1); // compiler warning
         } else {
              return o0.toString().compareTo(o1.toString());
    }There's no way that, in general, when using reflection to invoke methods, that you can coerce the types to avoid compile-time type safety warnings. I think the above code is guarranteed not to throw a runtime ClassCastException, but there's no way to write the code so that the compiler can guarrantee it. At least that's what I think. Am I wrong?

    Ok it looks like you're dealing with a classloader issue. when you call that method, it is the equivelant of calling
    Class.forName("Box", true, this.getClass().getClassLoader())The exception is thrown when your class's classloader cannot find the class box. try putting 'null' there
    Class.forName("Box", true, null)and it will request the bootstrap classloader to load the class. just make sure you have permission :
    If the loader is null, and a security manager is present, and the caller's class loader is not null, then this method calls the security manager's checkPermission method with a RuntimePermission("getClassLoader") permission to ensure it's ok to access the bootstrap class loader. (copied from the API)

  • Invalid number error when using case when

    I have table called NATIONAL_RARE_ECOSYSTEMS which has 1 column called TEST_COLUMN (data type: varchar2):
    TEST_COLUMN
    rare ecosystem
    rare
    0
    0
    (null)
    (null)
    what I want is a query which will add a column called NRE_SCORE which will give each row instance a score of 0 if it null.
    If it is 0 then score should be 0.
    If the row contains any text then score should be 1
    I have written the query:
    SELECT
    (CASE WHEN test_column is null THEN 0
    WHEN test_column = 0 THEN 0
    WHEN test_column > 0 THEN 1
    END) AS NRE_SCORE
    FROM NATIONAL_RARE_ECOSYSTEMS;
    I get the error message:
    ORA-01722: invalid number
    01722. 00000 - "invalid number"
    I think this is because on the 2nd and 3rd line I'm trying to do arithmetic on a column which is varchar2 which I know I cant do.
    How do I write a query which says: if the row contains text then give score of 1?
    I'm using oracle 11g.

    Hi,
    993451 wrote:
    I have table called NATIONAL_RARE_ECOSYSTEMS which has 1 column called TEST_COLUMN (data type: varchar2):
    TEST_COLUMN
    rare ecosystem
    rare
    0
    0
    (null)
    (null)
    what I want is a query which will add a column called NRE_SCORE which will give each row instance a score of 0 if it null.
    If it is 0 then score should be 0.
    If the row contains any text then score should be 1Any text other than '0', you mean. I assume it doesn't matter if that text happens to be all digits, such as '9876', or something with no digits, such as 'rare'.
    I have written the query:
    SELECT
    (CASE WHEN test_column is null THEN 0
    WHEN test_column = 0 THEN 0
    WHEN test_column > 0 THEN 1
    END) AS NRE_SCORE
    FROM NATIONAL_RARE_ECOSYSTEMS;
    I get the error message:
    ORA-01722: invalid number
    01722. 00000 - "invalid number"
    I think this is because on the 2nd and 3rd line I'm trying to do arithmetic on a column which is varchar2 which I know I cant do.You're actually not doing any arithmetic, but you are comparing your VARCHAR2 column to a NUMBER, so it tries to convert the string to a NUMBER, and that's why you get the ORA-01722 error.
    >
    How do I write a query which says: if the row contains text then give score of 1?
    I'm using oracle 11g.Here's one way:
    SELECT       CASE
               WHEN  NVL (test_column, '0') = '0'
               THEN  0
               ELSE  1
           END          AS nre_score
    ,       ...          -- you must want other columns, too
    FROM       national_rare_ecosystems
    ;Since you don't really care about the numeric value, don't use NUMBERs anywhere; stick with VARCHAR2s, such as '0'.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Point out where the query above is getting the wrong results, and explain, using specific examples, how you get those results from the sample data in those palces.
    See the forum FAQ {message:id=9360002}

  • Strange C++ error when using newer Sun Studio compiler

    My company has just set up a new build machine for our product. We have gone from
    this version: CC: Sun C++ 5.7 Patch 117830-11 2007/04/04
    to this one: CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25
    we have also upgraded the OS (solaris/sparc). I think the new one has gcc but the old one doesn't (we don't use it).
    and now I am getting this error:
    "/opt/SUNWspro/prod/include/CC/./new", line 32: Error, badextlnk: operator new(unsigned) was declared before with a different language.
    "/opt/SUNWspro/prod/include/CC/./new", line 35: Error, badextlnk: operator delete(void*) was declared before with a different language.
    "/opt/SUNWspro/prod/include/CC/./new", line 37: Error, badextlnk: operator new[](unsigned) was declared before with a different language.
    "/opt/SUNWspro/prod/include/CC/./new", line 40: Error, badextlnk: operator delete[](void*) was declared before with a different language.
    "/opt/SUNWspro/prod/include/CC/./new", line 53: Error, badollnk: Only one of a set of overloaded functions can be extern "C".
    "/opt/SUNWspro/prod/include/CC/./new", line 54: Error, badollnk: Only one of a set of overloaded functions can be extern "C".
    "/opt/SUNWspro/prod/include/CC/./new", line 55: Error, badollnk: Only one of a set of overloaded functions can be extern "C".
    "/opt/SUNWspro/prod/include/CC/./new", line 56: Error, badollnk: Only one of a set of overloaded functions can be extern "C".
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 106: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 169: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 185: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 198: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 202: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 206: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 217: Error, badollnk: Only one of a set of overloaded functions can be extern "C".
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 225: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 239: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 249: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 264: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    "/opt/SUNWspro/prod/include/CC/Cstd/rw/iterator", line 275: Error, temnotexternc: Template declarations cannot have extern "C" linkage.
    I have no idea what could be causing this. I can find one link to it on this forum: http://forums.sun.com/thread.jspa?messageID=9488983 . But the only answer to that query says it is the same as another bug which appears entirely different, not to mention being very old (while talking about an imminent fix), and being related to a different OS and (I think) a different version of sun studio (express vs. normal?).
    Any ideas? Could it be related to having gcc/g++ on the machine?

    Hi,
    I am also facing the same error while upgrading the Sun compiler description as below
    when I am compiling the cxx file on the system with compiler version (CC: Sun C++ 5.9 SunOS_sparc 2007/05/03) , I am facing the following error:-
    /opt/SUNWspro/bin/CC -dy -misalign -xcode=abs64 -xarch=v9 -D__EXTENSIONS__ -Dsun4_R5=1 -I. -Isun4_R5_v -I/home/as185259/ash_iadraid/ash_get_10/IA/PORT/include -I/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v -I/app/oracle/product/10.2.0/client_1/sqllib/public -I/app/oracle/product/10.2.0/client_1/precomp/public -I/opt/informix/include -DSVR4 -O -g p -pta -c MContext.cxx -o sun4_R5_v/MContext.o || \
    (rm -f sun4_R5_v.d; false)CC: Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs
    "/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v/ssmalloc.h", line 97: Error: Only one of a set of overloaded functions can be extern "C".
    "/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v/ssmalloc.h", line 99: Error: Only one of a set of overloaded functions can be extern "C".
    "/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v/ssmalloc.h", line 101: Error: Only one of a set of overloaded functions can be extern "C".
    "/home/as185259/ash_iadraid/ash_get_10/IA/WV/WV5.3.6-ncr0302/build/include/sun4_R5_v/ssmalloc.h", line 102: Error: Only one of a set of overloaded functions can be extern "C".
    4 Error(s) detected.
    The same file with the same compilation command is getting compiled with compiler version CC: Sun WorkShop 6 update 2 C+ 5.3 2001/05/15 .
    Can anyone suggest what should be the resolution:-
    The code for the ssmalloc.h file is as under:-
    #ifndef SSMALLOC_H
    #define SSMALLOCH
    #include <stddef.h>
    #if defined(__sparcv9)
    namespace ssmalloc {
    #endif
    #if defined(__cplusplus)
    extern "C" {
    #endif
    The type for the malloc routine depends on
    the compiler and library that you are using.
    #if defined(hpux) || defined(sun4_R5) || defined(__GNUC_) || defined(_OS2_)
    typedef void MALLOC_PTR;
    #else
    typedef char *MALLOC_PTR;
    #endif
    #if defined(_GNUG_)
    typedef size_t MALLOC_SIZE;
    #else
    typedef unsigned MALLOC_SIZE;
    #endif
    #if defined(sun4) && ! defined(_GNUG_)
    # define FREE_RETURNS int
    # define FREE_RETURN return 0
    #else
    # define FREE_RETURNS void
    # define FREE_RETURN return
    #endif
    // User-callable routines.
    // Note: memalign and valloc are broken in that they do not aling
    // memory on documented boundaries, and thus do not behave as described
    // on the "malloc" manual page. They simply call malloc.
    MALLOC_PTR malloc (MALLOC_SIZE size);
    FREE_RETURNS free (MALLOC_PTR data);
    MALLOC_PTR realloc (MALLOC_PTR data, MALLOC_SIZE size);
    MALLOC_PTR calloc (size_t nelem, size_t elsz);
    MALLOC_PTR valloc (unsigned size);
    MALLOC_PTR memalign (unsigned alignment, unsigned size);
    // This memory allocator supports memory allocation inside signal
    // handlers. For correct operation, the following functions must be
    // called upon entering and exiting signal handlers that allocate
    // memory.
    void ssmalloc_enter_signal_level();
    void ssmalloc_exit_signal_level();
    // Set this variable to not 0 (possibly in the debugger) if you want
    // to get malloc to check memory data structures very carefully as it
    // goes. This may be handy if you are trying to detect a memory
    // trasher.
    // It also causes ssmalloc to abort the program instead of returning
    // zero if memory runs out.
    extern int check_memory_very_carefully;
    #if defined(__cplusplus)
    #endif
    #if defined(__sparcv9)
    } // namespace ssmalloc {
    #endif
    #endif / SSMALLOCH */
    The Machine is
    root@ldg1-> uname -a
    SunOS ldg1 5.10 Generic_138888-03 sun4v sparc SUNW,Sun-Blade-T6320
    Thanks
    Vijay

  • Strange class error when using java

    I've been attempting to use java.awt.robot to simulate a key press when a button is clicked however I'm getting a couple of errors that I can't figure out but I'm not so good when it comes to scripts. When the button "LetterButton" is pressed it should simulate a keypress, ideally to the desktop/operating sytem but the errors I'm getting are:-
    1071: Syntax error: expected a definition keyword (such as function) after attribute public, not static.
    1084: Syntax error: expecting rightbrace before leftbrace.
    1131: Class must not be nested.
    Here's the code:-
    <?xml version="1.0" encoding="utf-8"?><mx:WindowedApplicationxmlns:mx="
    http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
    <![CDATA[
    import java.awt.Robot; 
    import java.awt.event.KeyEvent; 
    public class Main { 
    public static void main(String[] argv) throws Exception { 
    Robot robot =
    new Robot(); 
    robot.keyPress(KeyEvent.VK_A);
    robot.keyRelease(KeyEvent.VK_A);
    ]]>
    </mx:Script>
    <mx:VBox x="359" y="262" horizontalCenter="0" verticalCenter="0">
    <mx:Button id="LetterButton" label="Button" click=""/>
    <mx:TextInput id="txt"/>
    </mx:VBox></mx:WindowedApplication>

    Sounds tricky. I may ask them to look for an alternative way of doing it as Java really isn't my thing, I'm merely just a flex beginner at the moment.
    The reason I've been looking for this is that my app will be installed on a digital tv that also has a system connected to it using a Linux operating system so the user can switch between watching digital tv and the application seamlessly and at the moment a Linux professional who I'm working with has the Digital TV bound to the F12 key which is bound to a handheld remote control (being a tv there is no keyboard, just an 'air mouse' and the remote control).
    So my client and my Linux guy have asked me to come up with a way of getting the app to communicate with the desktop/operating system. I have seen flex apps in the past where a user can drag and drop videos on their desktop into an air application from which they will be played so I thought it would be possible to interact with the exteral OS/Desktop from within an AIR app by using just flex but it doesn't seem so easy through my research.
    Thanks for your help though.

  • Invalid number error when using external table

    Hello.
    I have a problem with creating an external table with number field.
    My txt file looks like:
    11111|text text|03718
    22222|text text text|04208
    33333|text|04215
    I try to create external table like:
    create table table_ex (
    id varchar2(5),
    name varchar2(100),
    old_id number(5))
    organization external (Type oracle_loader default directory dir
    access parameters(
    RECORDS DELIMITED BY NEWLINE
    fields terminated by '|'
    (id, name, old_id))
    location ('file.txt'));
    When i create the table and run select i get this in log file:
    Field Definitions for table TABLE_EX
    Record format DELIMITED BY NEWLINE
    Data in file has same endianness as the platform
    Rows with all null fields are accepted
    Fields in Data Source:
    ID CHAR (255)
    Terminated by "|"
    Trim whitespace same as SQL Loader
    NAME CHAR (255)
    Terminated by "|"
    Trim whitespace same as SQL Loader
    OLD_ID CHAR (255)
    Terminated by "|"
    Trim whitespace same as SQL Loader
    error processing column OLD_ID in row 1 for datafile
    /dir/file.txt
    ORA-01722: invalid number
    Whats the problem?
    Any idea?
    Thanks
    Message was edited by:
    DejanH

    Try this:
    create table table_ex
    id varchar2(5),
    name varchar2(100),
    old_id number
    organization external
    (Type oracle_loader default directory dir access parameters
    ( RECORDS DELIMITED BY NEWLINE fields terminated by '|'
    (id CHAR(5),
    name CHAR(100),
    old_id CHAR(5)
    location ('file.txt')
    I have removed the length of Number field and added length in characters later
    Aalap Sharma :)
    Message was edited by:
    Aalap Sharma

  • Strange UI bug when using People view/face recognition

    I've started playing with the face recognition in LR6/CC and have encountered an odd display bug when viewing the groups of 'named people':
    The thumbnail for each named person includes a count of how many images (or perhaps that should be faces) are attributed to their specific name. However, once the number of images for a person exceeds 100, LR only displays the first two digits in the thumbnail and drops off the third one, e.g. 254 is displayed as 25. If you hover over the thumbnail, the full count (e.g. 254) is displayed so long as the mouse cursor is kept on the thumbnail. Interestingly, once the number of images attributed to a named person exceeds 1000, it does the same thing, only it adds an extra digit (so 1400 becomes 140).
    I'm running this on Win7.
    Anyone else seeing this?
    M

    I guess I was primarily "testing the water" to see if the problem was specific to my configuration in some way, but you make a fair point John.
    Here's my (possible) bug report: LIGHTROOM Facial recognition: thumbnails not displaying full number
    M

  • Strange Grid Pattern when Using Smart Filter

    I added a smart filter to my image in Photoshop CS5 and performed a Highlights and Shadows adjustment, and there's now a faint diamond-shaped grid pattern over the entire image. This shows through all adjustment layers but disappears when I turn off the adjustment layer.
    This occurs on both of my two monitors, and it happens at every scale that I view the image at, including 100% actual pixels.
    I'm using a Mac Pro Quad-Core Intel Xeon 2.8 GHz, with 10GB RAM and a NVIDIA GeForce 8800 GT video card. Running the latest Mac OS X, 10.6.3 and the latest Photoshop, CS% 12.0 x64.
    Any clues?
    -=-Joe

    Ok thx, got the file and tested it.
    First of all: Yes, I see the pattern, so it is obviously independent from both Hardware and operating system, I tested on Windows 7 / CS5X.
    I can approve what c.pfaffenbichler found. Obviously we were wrong with our yesterdays findings that the transparency is not transparent. Instead, it is. It is barely visible, but testing it myself it seems to be "real" transparency, but at a very very low level, 1% max. I put a solid color behind that Smartobject.If you turn that layer visible, the grid disappears. To make sure that it realy is the bottom layer that shines through and not some kind of weird "new bug fixing other bug" thing, I put 2 layers behind the Smartobject, one pure black, one pure white. As you should expect, the image turns slightly (!) darker if you turn the black layer visible compared to the "only white layer visible" status.
    So obviously shadow/highlights really seems to affect the transparency of smartobjects. Sometimes. Sweet. Will this be fixed?

  • Slience number keys when using them as text

    So I just got my 8830 Sprint phone.  I had gotten the wheel to not make any noise. However, when it's on vibrate, and I press a letter that's also a number, it makes a noise, does anyone know how to slience that as well?

    IIRC, the flows are displayed in the order that they were created.

  • Tecnical problem field KOMVD-kbetr strange number conversion... why?????!!

    Good morning i'm using the standerd program RVADOR01 to print the order confirme.
    i have to do some modifications at the sapscript, i have also show the customer discount.
    I don't understand why in va02 the customer discount (KOMVD-kbetr ) is filled for excample with "20,000-" but when ii's readed the field in the program it read "200,00-"  but the user have inserted in va02 "20,000-"!!  How i print correctly the field?
    Help me thanks!

    kwert contains "KWERT     P     7               44.00-" i have to print the percentage of discount that is contained in the field "KBETR     P     6            200.00-". the sapscript when is called the element 'ITEM_LINE_PRICE_QUANTITY' contains "200.00-" but in the sapscript will be printed '20,000-', i debuged it.
    i report below the code:
          FORM ITEM_PRICE_PRINT                                         *
          Printout of the item prices                                   *
    FORM ITEM_PRICE_PRINT.
      LOOP AT TKOMVD.
        KOMVD = TKOMVD.
        IF SY-TABIX = 1 AND
         ( KOMVD-KOAID = CHARB OR
           KOMVD-KSCHL = SPACE ).
          CALL FUNCTION 'WRITE_FORM'
               EXPORTING
                    ELEMENT = 'ITEM_LINE_PRICE_QUANTITY'.
        ELSE.
          IF KOMVD-KNTYP NE 'f'.
            CALL FUNCTION 'WRITE_FORM'
                 EXPORTING
                      ELEMENT = 'ITEM_LINE_PRICE_TEXT'.
          ELSE.
            CALL FUNCTION 'WRITE_FORM'
                 EXPORTING
                      ELEMENT = 'ITEM_LINE_REBATE_IN_KIND'.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.
    And below the sapscript (MAIN WINDOW):
    /E           ITEM_LINE_PRICE_TEXT
    IP           ,,&KOMVD-VTEXT(17)&,,,,,,&KOMVD-KBETR(I12)&,,&KOMVD-KOEIN& ,,
    =           &KOMVD-KPEIN(I)&,,&KOMVD-KMEIN&,,&KOMVD-KWERT(I14)&
    The problem is that i want to print it in custom fields, in the element "ITEM_LINE" but the same value is not converted!  the custom field is declared like KOMVD-KBETR....
    thanks all experts

  • [Q]: Error number 37 when use 'SERIAL/PARALELL port write' VI !!!

    Hi,
    I want to write data to the parralel port, so I use
    the 'serial port write' VI wich can be use to write
    data to the parallel port using port number :
    0 = COM1, 1 = COM2, ect... 10 = LPT1,
    11 = LPT2. (I use 10 -> LPT1).
    But I always have the same error : Number 37
    which mean 'Device not found'. I have tested my
    VI on three different PC (Windows 98 and NT4)
    and I have always the same error.
    My PC (Windows 98) is well configure so I don't
    know where is the problem.
    Can somebody help me.
    Thanks.
    Best regards.
    FARGET Vincent
    [email protected]

    Vincent Farget wrote:
    > Hi,
    >
    > I want to write data to the parralel port, so I use
    > the 'serial port write' VI wich can be use to write
    > data to the parallel port using port number :
    > 0 = COM1, 1 = COM2, ect... 10 = LPT1,
    > 11 = LPT2. (I use 10 -> LPT1).
    >
    > But I always have the same error : Number 37
    > which mean 'Device not found'. I have tested my
    > VI on three different PC (Windows 98 and NT4)
    > and I have always the same error.
    >
    > My PC (Windows 98) is well configure so I don't
    > know where is the problem.
    > Can somebody help me.
    >
    > Thanks.
    > Best regards.
    > FARGET Vincent
    > [email protected]
    I have finally found and use the 'Out Port' function
    which is in the advanced/memory functions.
    FARGET Vincent
    [email protected]

  • Number ranges when using SLC

    Hello,
    This is our system landscape
    We are using SRM 7.0 in the Classic Scenario with Supplier Lifecycle Management (SLC)
    MDG is used for the approval workflow for all vendor creations and changes. It is set up as an add-on to ECC.
    The current design for vendor master records in ECC does not include business partner configuration for vendors.
    It also doesn’t include CVI.
    Only the traditional ECC vendor master is supposed to be used.
    Scenario
    1.    A potential supplier is created in SLC, and he firstly only exists in SLC as he passes through the qualification process.
    2.    After some qualifications are approved the potential supplier can be used for bidding and is distributed to SRM.
    3.    Once the qualification process is completed the supplier is distributed to MDG to pass through the approval process.
    4.    After the approval in MDG the vendor is distributed to ECC and SRM, so it can be used on Shopping Carts, in Account Payable etc.
    Questions
    1.    How can we achieve that the number of a vendor is the same in all systems i.e.
    BP of the vendor in SLC (at least for Buy-side) = vendor number in ECC = BP of vendor in SRM?
    Do we have to set up the business partner functionality or CVI in ECC/MDG to achieve that? (which would be huge amount of rework for us)
    Or is there a way to do it without setting up business partners/CVI in ECC/MDG? (our preferred option)
    2.    If we use business partners/CVI in ECC/MDG do we need the following:
    BP of the vendor in SLC (at least for Buy-side) = vendor number in ECC = BP of vendor in SRM = BP in ECC?
    The blue part is want we want to achieve for easy usability.
    The red part is our question: it that a technical necessity to achieve to achieve the blue part?
    Or can the BP number is ECC be something compeltey different?
    Thanks for  your help.
    Cheers
    Ulli

    Arturo, Nancy,
    In case you still need to solve this issue. I have come across this problem in the past and solved it by using an excel function in the cell called TEXT(text, format) which lets you format anything you give in the parameter text. So let's say you want a number with comma for decimal (with three decimals) and dots for thousands then you would use something like this:
    Text(B2,"#0.0,000")
    Hope this is still useful for you guys...
    cheers,
    xtian

  • Strange Kernel Panic when using FibreChannel Storage through AFP

    Hello all,
    we are using a simple setup:
    PowerMac G4 1Ghz with a FibreChannel Card and a connected 16 Bay S-ATA Case. The FibreChannel Case has two Raid 5 configured a single HFS+ Volumes created on each Raid set.
    These two Volumes are accessed by 3 Clients through AFP. Sometimes there happens to occur a kernel panic:
    panic(cpu 0 caller 0x0022CD5C): hfsvnopbwrite: about to write corrupt node!
    This looks like some B-Tree error, basically Filesystem related.
    Does anyone have a clue what that might be?

    Well form the comemnt sin the code it would appear to have something to do with the endianess:
    <pre style="width: 85%; padding: 5px;">
    2539 * Intercept B-Tree node writes to unswap them if necessary.
    2540 */
    2541 int
    2542 hfsvnopbwrite(struct vnopbwriteargs *ap)
    2543 {
    2544 int retval = 0;
    2545 register struct buf *bp = ap->a_bp;
    2546 register struct vnode *vp = buf_vnode(bp);
    2547 BlockDescriptor block;
    2548
    2549 /* Trap B-Tree writes */
    2550 if ((VTOC(vp)->c_fileid == kHFSExtentsFileID) ||
    2551 (VTOC(vp)->c_fileid == kHFSCatalogFileID) ||
    2552 (VTOC(vp)->c_fileid == kHFSAttributesFileID)) {
    2553
    2554 /*
    2555 * Swap and validate the node if it is in native byte order.
    2556 * This is always be true on big endian, so we always validate
    2557 * before writing here. On little endian, the node typically has
    2558 * been swapped and validatated when it was written to the journal,
    2559 * so we won't do anything here.
    2560 */
    2561 if (((UInt16 *)((char *)buf_dataptr(bp) + buf_count(bp) - 2))[0] == 0x000e) {
    2562 /* Prepare the block pointer */
    2563 block.blockHeader = bp;
    2564 block.buffer = (char *)buf_dataptr(bp);
    2565 block.blockNum = buf_lblkno(bp);
    2566 /* not found in cache ==> came from disk */
    2567 block.blockReadFromDisk = (buf_fromcache(bp) == 0);
    2568 block.blockSize = buf_count(bp);
    2569
    2570 /* Endian un-swap B-Tree node */
    2571 retval = hfsswapBTNode (&block, vp, kSwapBTNodeHostToBig);
    2572 if (retval)
    2573 panic("hfsvnopbwrite: about to write corrupt node!\n");
    2574 }
    2575 }
    2576
    2577 /* This buffer shouldn't be locked anymore but if it is clear it */
    2578 if ((buf_flags(bp) & B_LOCKED)) {
    2579 // XXXdbg
    2580 if (VTOHFS(vp)->jnl) {
    2581 panic("hfs: CLEARING the lock bit on bp 0x%x\n", bp);
    2582 }
    2583 buf_clearflags(bp, B_LOCKED);
    2584 }
    2585 retval = vn_bwrite (ap);
    2586
    2587 return (retval);
    2588 }
    2589
    </pre>
    G4 Quick Silver 2001 800 Mhz   Mac OS X (10.4.7)  

Maybe you are looking for

  • Conversion of spool to pdf format in landscape mode

    Hi All, I have a requirement where I need to print the output from a spool request in SAP to a pdf page . The page has to be in landscape format.  Is it possible to create a pdf page which is always in landscape format? I am using FM convert abapspoo

  • Sending mail to a contact group with a numeric name

    Hello! I have a problem when sending mail to a contact group. The contact group is named "1234", and in Mail the autocompletion of the address is not performed successfully. However, if I rename the group to "A1234" then it all works. Sounds like a b

  • Adobe Document Service Configuration Issue

    Hi All, Actually we have installed SAP ADS 7.4 ON SAP NetWeaver 7.4 JAVA STACK HUB SYSTEM. I did the configuration as per the SAP Standard documents. The ABAP connection in ADS is working but ADS configuration in an ABAP environment is not working. W

  • Is it possible to pull off this typography effect in Motion?

    I came across this some time ago and have always wondered if it's possbile to at least simulate parts of it in Motion. http://www.romancortes.com/ficheros/dancing-typography.html Basically, I'm wondering what would be the best way to constrain a repl

  • In CO11 Procedure to change document date

    Hi Experts,                    I make production order confirmation through CO11 & GI / GR is done automatically. There is no option to change Document Date against GR/GI. Whenever i post entry in back date i can chage posting date but as there is no