What's a good way to handle this conversion to a QUAN field?

Good day everyone,
I developed an RFC that receives data from XI.  I assign this data to a BAPI, and one of the fields is a field with a data type of QUAN(length 13, decimals 3).  All works fine if XI passes me a numeric value in this field.
Here's the problem:  In running some test cases through XI and into the RFC, we ran a test case where the quantity field had a value of "test" (e.g. no numeric value).  Incredibly, XI transforms the text value of "test" into the value of 4534 and sends it to my RFC.  So my RFC thinks everything's fine when, in fact, that number was derived from a text field and is completely wrong.
What we need to do is change the field to something that will "kick out" in XI when it tries to call my RFC.  I thought I could change it to a type of NUMC, but that doesn't let me use decimals.  We've already sent out the file layout to vendors, so we expect them to include numeric values with decimal places if need be.
Is my best bet changing this to a character field with a length of 17, then checking to make sure it consists only of 0-9, a space, or a decimal?  I then need to assign it to the BAPI's field with the data type of QUAN(13,3) -- am I going to have issues trying to do this from a character field?  Do I need to worry whether or not they include a decimal (it might be implied -- in other words, they might just say quantity is "20" which becomes "20.000" to the BAPI).  Is there a nifty routine I can use to do all this easily?
Thanks everyone.  Points awarded as always for ALL helpful answers.

Ravi, that's kinda what I was thinking, but if it's true (i.e. a proper amount) can I just move the contents directly to my QUAN field?  Will SAP automatically do the conversion for me such that it ends up in the right place?  I've yet to have to worry about such conversions -- this is the first time I've had to deal with it -- and I want to make sure that the right value gets assigned, whether that value is "20", "54.1", "1000.25", or "986.500".

Similar Messages

  • What's the best way to handle this?

    I'm not sure what APIs/setup to use for this situation:
    A company wants to store data projects they do for clients. Each year, the data fields are set (as a result of gov't requirements) and they won't change for any client project for that year. however, the fields required can (and usually do) change every year. So things they require this year, might not be needed the next year and new fields might be introduced.
    While there are likely to be many common fields from year to year, there's no way to guarantee which ones will remain consistent. They also want to be able to do searches on the data and fields, for projects within a year and across years.
    What's the best framework/API/configuration to handle this? EJB? Simple JDBC? If so, how should the database be handled? Won't it have to constantly create new fields in a table? Or is there another way to handle this?
    What's the best way from a "clean architecture" standpoint?

    dang, I really have to start over? I finally got all this stuff working again.  well, hopefully it won't be as big a pain this time since the data won't be coming from a different machine.   After completing the Migration Assistant process, I had to reinput a bunch of serial numbers for apps, reinstall print and mouse drivers, etc...  I've finally got the new machine up and running smoothly and now I gotta start over? Sigh.
    I was hoping that either I could rename the current account after deleting the other one, or just move everything from one account to the other and then delete the 'RJM' account.
    ok, so it sounds like here are the steps I need to take:
    - make another full cloned backup of this current machine in Super Duper
    - reboot this machine using the advice in the first post, wipe everything clean and reinstall the OS
    - create a new account like 'user1' and re-do software update (which is like 2.5 gig worth of stuff) and takes like an hour even on a high speed connection
    - then re-do the migration assistant process to the properly named account
    - then delete the 'user1' account
    does that sound right?

  • What's a good way to do this?

    I'm an old C programmer learning Java. As an exercise, I'm writing a
    fairly simple astronomy program, and one of the things it needs to do is
    to convert between two different coordinate systems, (altitude, azimuth)
    and (hour angle, declination).
    As it happens, it's possible to write a single conversion function that
    works in both directions. In C, the prototype might look like
    void convert( double latitude, double fromX, double fromY,
    double toX, double toY );
    and I could call this two different ways.
    convert( lat, alt, az, &ha, &dec );
    convert( lat, hr, dec, &alt, &az );
    Is there an elegant way to implement this in Java? Everything I can
    think of feels kinda kludgy and slow (convert() can easily be called
    millions of times).
    I know I could represent the coordinate pairs as double[] and have
    public static void convert( double lat, double[] from, double[] to )
    but I'm not real happy with that. I'd have to use double[] in the rest
    of the program, which would mean things like
    star[ i ].EqCoord[ 0 ]
    star[ i ].AACoord[ 1 ]
    instead of the more concise and self-documenting
    star[ i ].ha
    star[ i ].az
    Or I could wrap the calls to convert() with something like
    double[] result = new double[ 2 ];
    convert( lat, star[ i ].alt, star[ i ].az, result );
    star[ i ].ha = result[ 0 ];
    star[ i ].dec = result[ 1 ];

    Thanks kglad! I think I'm getting the logic looking at a
    number of examples.
    Would I head in this direction?
    onClipEvent (load) {
    moveTo(ball_mc._x,ball_mc._y);
    _root.onEnterFrame = function(){
    lineTo(ball_mc._x, ball_mc._y);
    lineStyle(3, 0xee3355, 100);
    Or this direction:
    onClipEvent (load) {
    /* x & y co-ordinate for the movieclip code.*/
    x1 = _parent.ball_mc._x;
    y1 = _parent.ball_mc._y;
    moveTo(x1,y1);
    lineStyle(3, 0xee3355, 100);
    onClipEvent (enterFrame) {
    lineTo(_parent.code._x, _parent.code._y);

  • OutOfMemoryError - good way to handle this error?

    Hello.
    I am pulling in images into an array, and every now and then I will get an error stating:
    OutOfMemoryError
    I posted earlier concerning how to examine whether an image can be garbage collected or not, and I got some useful replies.
    But, I was wondering if there were any tips on how to handle this error.

    In general you cannot handle this error as it is possible that your
    error handling code with cause the error again. In reality you
    can catch it somewhere where you know a large chunk of memory has been
    freed.
    matfud

  • Hey! so i am traveling out of the country. I am extremely confused, if I turn on air plane mode and enable wifi, can i send iMessage without ANY extra charges for being international? Also, what are other good ways to do this and not be charged?

    I really need help! also, if there is any other way i can just use wifi without being charged AT ALL would be great

    iOS: Understanding airplane mode

  • What's the best way to handle the growth of the mdm.tblTransaction table?

    Can anyone suggest a good way to handle the growth of the mdm.tblTransaction table? This table logs all the MDS transactions and the history of the data residing in it is required for auditing purposes. Hence we can't delete this data. I'm looking for options
    on how we can maitain this table ongoing. It is going to perform badly eventually. We currently have 15 Million transactions in this table.
    What options can we look at?

    In the vnext sql server, MDS will support cleaning based on log retention policy.
    In the sql2014/sql2012, you have to clean up the table manually.
    An sample sproc that can be reused is attached below.
    ==============================================================================
    Copyright (c) Microsoft Corporation. All Rights Reserved.
    ==============================================================================
    SELECT * FROM mdm.tbl_7_TR where LastChgDTM < '2014-10-22';
    EXEC mdm.udpLogCLeanup 7, '2014-10-22';
    SELECT * FROM mdm.tbl_7_TR where LastChgDTM < '2014-10-22';
    CREATE PROCEDURE mdm.udpTransactionsCleanup
    @Model_ID INT,
    @CleanupOlderThanDate DATE
    WITH EXECUTE AS N'mds_schema_user' -- Execute as a user that has permission to select on [tblUserGroupAssignment], [tblBRBusinessRule], [udfSecurityUserBusinessRuleList]
    AS BEGIN
    SET NOCOUNT ON
    DECLARE
    @SQL NVARCHAR(MAX)
    --Annotation table names
    ,@TransactionTableName sysname
    ,@AnnotationTableName sysname;
    SET @TransactionTableName = 'tblTransaction';
    SET @AnnotationTableName = 'tblTransactionAnnotation';
    BEGIN TRY
    --Delete all Annotations on transactions being deleted issues
    SET @SQL = N'
    DELETE [mdm].' + QUOTENAME(@AnnotationTableName) + N'
    FROM [mdm].' + QUOTENAME(@AnnotationTableName) + N' as tannt
    JOIN [mdm].'+ QUOTENAME(@TransactionTableName) + N' as txn ON tannt.Transaction_ID = txn.ID
    JOIN [mdm].[tblModelVersion] as tmv ON txn.Version_ID = tmv.ID
    WHERE tmv.Model_ID= @Model_ID AND txn.LastChgDTM <= @CleanupOlderThanDate
    EXEC sp_executesql @SQL, N'@Model_ID INT, @CleanupOlderThanDate DATE', @Model_ID, @CleanupOlderThanDate;
    --Delete all transactions older than the specified date
    SET @SQL = N'
    DELETE [mdm].' + QUOTENAME(@TransactionTableName) + N'
    FROM [mdm].' + QUOTENAME(@TransactionTableName) + N' txn
    JOIN [mdm].[tblModelVersion] tmv ON (txn.Version_ID = tmv.ID)
    WHERE tmv.Model_ID = @Model_ID AND txn.LastChgDTM <= @CleanupOlderThanDate
    EXEC sp_executesql @SQL, N'@Model_ID INT, @CleanupOlderThanDate DATE', @Model_ID, @CleanupOlderThanDate;
    RETURN(0);
    END TRY
    --Compensate as necessary
    BEGIN CATCH
    -- Get error info
    DECLARE
    @ErrorMessage NVARCHAR(4000),
    @ErrorSeverity INT,
    @ErrorState INT;
    EXEC mdm.udpGetErrorInfo
    @ErrorMessage = @ErrorMessage OUTPUT,
    @ErrorSeverity = @ErrorSeverity OUTPUT,
    @ErrorState = @ErrorState OUTPUT;
    RAISERROR(@ErrorMessage, @ErrorSeverity, @ErrorState);
    --On error, return NULL results
    --SELECT @Return_ID = NULL;
    RETURN(1);
    END CATCH;
    SET NOCOUNT OFF
    END --proc
    GO

  • What are the good ways to send a big file( 20MB-100MB) file to my friend?

    what are the good ways to send a big file( 20MB-100MB) file to my friend?
    Thanks in advance

    if this is with the internet, iChat is probly your best bet,
    but if you just want a transfer,
    plug a firewire into both of your computers, shutdown one of them, hold "T" and press the power button, the restarted computer should pop up as an external drive on the second computer.

  • What's a good way to manage custom schema for DS  5.1?

    What's a good way to manage custom schema?
    Custom Schema for Object Class and Attributes
    The reason I ask this is because there might be a need in the future where I need to export those custome schema into different branded directory server. I just want to make this as painless as possible.
    Right now, I thought of 2 options
    1) Create my own LDIF file with my custom attributes and object classes, so if one day I need to export to another directory server, I can just copy that custom created LDIF file over. (Will this work?)
    2) Create a JAVA application using JNDI. What this Java App. will do is read through a XML file and create those object classes and attributes on-the-fly. (of course, the XML structure will be predefined by me, so that my Java App. will be able to parse through it correctly. Will this work?)
    Anymore suggestion? I would want to hear more advices and suggestions.
    Also, I assume that will work even with replication. All I need to update is the master server, and the slaves will replicate automatically.
    Thank you very much! :)

    Demo: I'm using the nul character to represent the end of the word, so that the data structure can represent that "hell" and "hello" are both in the vocabulary:
    import java.util.*;
    class Node {
        private SortedMap<Character, Node> children = new TreeMap<Character, Node>();
        //0 <= index <= word.length()
        private void add(String word, int index) {
            if (index == word.length()) {
                children.put(Character.valueOf('\u0000'), null);
            } else {
                char ch = word.charAt(index);
                Node child = children.get(ch);
                if (child == null) {
                    children.put(ch, child = new Node());
                child.add(word, index+1);
        public void add(String word) {
            if (word == null || word.length()==0)
                throw new IllegalArgumentException();
            add(word, 0);
        public String toString() {
            return children.toString();
    public class Example {
        public static void main(String[] args) throws Exception {
            Node root = new Node();
            root.add("hello");
            root.add("how");
            root.add("who");
            root.add("hell");
            System.out.println(root.toString());
    }

  • What's a good way to do a thread dump into a separate file

    What is a good way to do a thread dump automatically into a separate file.
    Example. I run a script to do the thread dump, but unfortunetly, it goes into my stdout log file with the rest of my weblogic errors.
    Any ideas? I want it in a separate file when I run my script?

    Do a Google search on "Drobo S" "benchmark."  I don't have a Drobo S, only the regular Drobo.  But here's a guy who tested one on Windows:
    http://mansurovs.com/drobo-s-review-usb-3-0-2nd-generation
    This one has it a bit faster:
    http://the-gadgeteer.com/2011/12/31/drobo-s-storage-array-review/
    Do read up on a few reviews of it, and be absolutely clear that interface speed (i.e. eSATA versus Firewire versus Thunderbolt) is NOT the same as the performance of the system.  The Drobo cannot keep up with any interfaces... at least the Drobo and the Drobo S cannot.
    I am not using the FS model which is a NAS.  I am using the plain old "Drobo" which is slower than the Drobo S, but that's not to say that the Drobo S is fast, because it is not.
    The Drobo in theory is really attractive: Dead simple to manage, can mix and match drive sizes, offers you some data protection, etc.  However do note that protected storage is not, in and of itself, a backup.  You need other backups besides just the data on the Drobo.  And, because it's so slow, it's really not a great fit for photo storage.  See this review from a guy who used to think the Drobo was great for that and then appended his review:
    http://www.stuckincustoms.com/drobo-review/
    To be as clear as possible, IMO the BEST backup strategy with something like Aperture (so long as your managed Aperture library is of a manageable size, like < 800 GB), is to get a few small portable Firewire 800 drives and keep vaults on each one.  They are great because they are easy to use, to have with you, are bus powered, and you WILL offsite them.

  • I have two videos and I would like to use parts of both videos with one audio track what is the best way to edit this?, I have two videos and I would like to use parts of both videos with one audio track what is the best way to edit this?

    In Final Cut Express I have two videos I'd like to merge parts of each video into a final film.  What is the best way to do this in FCE?

    Hi
    I use a slightly different way than Alchroma.
    Same
    • One video on track 1 and the other on Video.track 2
    • Resize to 25% and move one to the left and the other to the right
    Diff
    • I don't use the blade tool
    • I use the Pen tool and change the transparency - then I get fast or slow transitions in same stroke and easy to fine-tune later if needed. (But this can be done with the Roll-tool if Blade is used - so it might be as easy)
    Final
    • Resize to 100% and Center
    Video is done
    Audio - very close to this by changing the level so that best audio will dominate
    • Pen tool here too
    But that's me - the Alchroma way is as good as this or may be better for some
    Yours Bengt W

  • What's the best way to handle new versions of software?

    So we have an Application setup for Adobe Reader (just using Reader as a general example) which is part of our Task Sequence.  When Adobe releases a new version of Reader, what's the best way to handle getting the new version into our SCCM setup.
    I know I can create a new application and do it all over and select the new file, but can I simply replace the files that the application is pointing to and then somehow tell it to update the DPs with the new files?  I'd rather not have to create new
    applications every time if I don't have to.
    Thanks.

    I think continue the way you are doing right now by creating a new application each time there is a version change. Its a clean way to do and this helps with Application life cycle mgmt aswell where you keep track of versions across the environments and
    eventually retire an application. Specially where no changes are made without a change control. This is completely process specific and may not be applicable.
    i do agree with above posted comments about using supercedence option.
    However most of the apps comes with upgrade capabilities from previous versions. So you can upgrade existing version with new one if you do not wish to use supercedence. 
    Thanks 

  • What is a good way to load 80 million documents in DocumentDB?

    I am having problems loading a large set of data.  We want to load 80 million documents.  We are trying to do testing for an IOT solution that will end up having a lot of data in it.  I followed the instructions to use a stored procedure to
    do a bulk load provided by Ryan CrawCour on the Microsoft Site:
    https://code.msdn.microsoft.com/windowsazure/Azure-DocumentDB-NET-Code-6b3da8af
    But it throws exceptions when we load 2,000 - 5,000 documents.  Our documents are only about 80 characters.
    Error: One or more errors occurred., Message: Exception: Microsoft.Azure.Documen
    ts.RequestRateTooLargeException, message: {"Errors":["Request rate is large"]},
    What is a good way to load large datasets?  ( Load backups, migrate data, ... )  Or is DocumentDB just a wrong choice when you have millions of rows to load?
    Thanks

    Hi,
    I had been working on this from around one month and I am happy to say that my code works. Was able to upload around 0.5 million documents in 20 min. 
    The configuration was Document DB with S3 , I scaled out for 16 collection for sharding, I think you need to shard out more. This will depend on how much each document takes.
    So the Calculation goes like if each document is lets say on an average 2Kb of Size and you have 80 million documents that will come out to be 160GB
    That means you will need more than 16 collections to store as at Max 1 collection can have 10GB of Data. So to be on the safer side I would say lets go for 3 times the storage so 48 collections . If all of them are at S3 than you have 2500 RUs spread across
    48 collections and I am sure if you do insertion now you will not get Request Rate too large exception.
    I have come up with this code hopefully it will help you as well.
    https://social.msdn.microsoft.com/Forums/azure/en-US/d036afe2-78ec-45ee-8b0d-297f0f5320fe/azure-documentdb-bulk-insert-using-stored-procedure.
    For Sharding you can have look at
    https://msdn.microsoft.com/en-us/library/dn589797.aspx?f=255&MSPPError=-2147217396.

  • What is the good way to charge the battery

    I don't know if this topic been answered before.
    I want to know what is the good way to charge the battery on Macbook pro? Should I start charging battery when it's 50% or 20% or 10% left? and Is it good to leave the charge plug in after it fully charged?
    thanks guys

    Everything you need to know about your battery is explained here:
    http://discussions.apple.com/thread.jspa?threadID=1764220

  • What is the best way to handle input parameter

    When writing sub-vi's, what is the best way to handle input parameter range checking? On the front panel I can choose to have numeric values coerced to be within range, but this does not affect constants or controls wired to the vi when used as a sub-vi. I can build range checking into the vi, but this can result in a cluttered looking vi. Do you have any suggestions.

    As you discovered, the Range and Coercion properties of controls do not work when used in sub-vis.
    Your best option is to go ahead and build your range checking into your sub-vis. If it�s something you will be doing a lot, just make your range checking a sub-vi and drop it where needed. This will keep the clutter to a minimum. You may end up with more than one range checking VI if you need different functionality, but this will still make less clutter and easier re-use.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • What is the right way to handle events?

    What is the right way to handle events? If I start doing stuff in the AWT event thread (particulaly things that create their own events) should I be starting a new thread?
    A link to a good book or reference source will do
    thanks in advance

    http://java.sun.com/docs/books/tutorial/uiswing/events/

Maybe you are looking for