Why is there a data type NUMC?

Hi ABAP masters,
working in database support for several years I've very often seen the problems that arise from the awkward data type NUMC.
A numeric type stored as characters.
What I always wondered is: what is this data type really good for?
The leading zero output display alone is hardly a valid reason to waste storage and complicate the usage of the data of that type.
I cannot imagine any use for this data type that wouldn't be better done by using integer types.
So, if you know what the reasoning behind this data type is, please let me know.
thanks and best regards,
Lars

NUMC data type can be used to maintain positive numbers with leading Zeros
Most of SAP's important numbers like Sales Order numbers, Customer numbers, Delivery documents,
Material numbers, Sales Org, Division, Company Codes, Distribution Channel are CHARs only
But if their Data is containing only digits, SAP Transactions will automatically add Leading zeros for them and store in the database as Raw data.
If those SAP numbers contains at least one non-digit character, then leading zeros will not be added.
Example: if 54 is assigned to BUKRS it will be stored in DB as 0054
               if 5A is assigned to BUKRS it will be stored in DB as 5A only
Leading zero concept is very useful for Date and Time calculations.
Month, Day, hours etc., must be declared as NUMC for better calculations
Example:
    PARAMETERS p_year TYPE I.          "instead of Integer we can use type N LENGTH 4 also here
    DATA  v_month TYPE N LENGTH 2.
    DATA  v_day     TYPE N LENGTH 2.
    DATA  v_year    TYPE N LENGTH 4.       then calculations will be easy
    DATA  FDATE   TYPE D.
    v_year = p_year.
    v_day  = 1.              "1st day of Month
    DO 12 TIMES.
        v_month = sy-index.           "Leading zero will be added automatically
        CONCATENATE v_year  v_month  v_day  INTO  FDATE.
        WRITE / FDATE.                "Every month 1st day of selected year
    ENDDO. 
Example:  Customer number contains uneven digits.  It should be converted to a 10 digit number
                 with "C" as 1st Character.  Logic will be
                 PARAMETERS custno TYPE I.               
                 DATA  v1                     TYPE  N  LENGTH  10.
                 DATA  str_custno         TYPE C LENGTH 11.
                 v1 = custno.       "customer number will be converted to 10 digit number
                 CONCATENATE 'C'  V1   INTO  str_custno.
please correct me, if I am wrong
Thanks and Regards
Nagababu Tubati

Similar Messages

  • Why should we create data type

    Hi all,
    I have a basic question!
    why do we create data type and then wrap it as message type?
    why dont we directly create a message type and use that ?
    please give the answers. Thanks in Advance.

    Hi Seshu,
    Please go through below links, you get answer
    message type and datatype
    Difference between Data type and Message type - Process Integration - SCN Wiki
    Regards,
    Krupa

  • Info Object: Change of Data Type (NUMC to CHAR)

    We have a scenario wherein one of the Info objects is defined currently as NUMC. Due to the change in the Source system, the info object is now defined with data type as CHAR. The info object in consideration is the "Cost element".
    As the current info object contains data, it will not be possible to change the data type from NUM to CHAR.
    Is there any pre-defined way of doing this data type change without loss of data (in the info object as well as the info cube(s) where the info object is used)?
    Regards
    Bala

    Hi Balakrishana,
       Try this:
    Insted of changing the definition of infoobject(NUMC to CHAR), why cant you change the data itself from CHAR to NUMC...?? If length is same.
       You can write a simple routine in transfer rules and you can convert.
    Hope it Helps
    Srini

  • Why is there no Data button on slide up menu.

    Probably the wrong place to post this question but why didn't Apple add a Data button on the slide up menu on the new iPhone ios software?
    I use this more than Flight Mode and I am sure there are others out there who use Data more than Flight Mode. Not everyone has unlimited data with their mobile contract.
    I would be interested to hear if anyone else thinks this and if Apple will be adding this at a later date.

    Suggest such to Apple:
    http://www.apple.com/feedback/iphone.html

  • Why is there no data on my new MacBook Pro after using Migration Assistant?

    Last night I launched Migration Assistent between my MacBook to my MacBook Pro.  It said it would take 12 hours so I left it over night.  When it finished this morning it said that some files were not able to be transferred.  But there is absolutely nothing on my new MacBook Pro.  Why is that?
    My TimeMachine backup disk has a cable that won't work with the new MacBook Pro so what other choice do I have to transfer data?

    epicsnow wrote:
    Last night I launched Migration Assistent between my MacBook to my MacBook Pro.  It said it would take 12 hours so I left it over night.  When it finished this morning it said that some files were not able to be transferred.  But there is absolutely nothing on my new MacBook Pro.  Why is that?
    See Problems after using Migration Assistant

  • Why is there no unsigned type is java?

    Just wondering? Why no unsigned int or unsigned long? I have often used these in the past but java requires me to do some clever stuff to get over the limitation.

    i found this on the net somewhere. it doesn't mention anything about java but it does seem to fit the typical "don't include anything that can be confusing or misunderstood" mold that java utilizes:
    "One problem is that unsigned types tend to decrease your
    ability to detect common programming errors. Another is that
    they often increase the likelihood that clients of your classes
    will use the classes incorrectly.
    Consider first error detection. Suppose a programmer defines
    an Array object as follows:
    int f(); // f and g are functions that return
    int g(); // ints; what they do is unimportant
    Array<double> a(f()-g()); // array size is f()-g()
    There�s nothing wrong with this definition for a, except for the
    possibility that the programmer writing it made an error. Instead
    of the size of the array being f()-g(), perhaps it
    should have been g()-f(). Or maybe it should have been
    f()+g(). Or possibly it should have been f()-g()+1; off-byone
    errors are certainly common enough. Heck, it�s even possible
    that f()-g() is correct, but f() or g() is returning a
    bad value. Any of these scenarios could lead to the Array
    constructor being passed a size that was less than zero. As
    the author of the Array class, there�s no way you can keep
    clients from making mistakes such as these, but you can do
    the next best thing: you can detect such errors and act on
    them.
    Well, actually, maybe you can�t. You can�t if you declared Array�s
    constructor to take an unsigned value, because if a
    negative number is passed to a function as an unsigned, the
    number seen by the function isn�t negative at all. Instead, it�s
    a very large positive number. As a result, you�d have no way
    within the Array constructor of distinguishing between a
    large, but valid, positive size value and a large, but invalid,
    positive size value arising from passing in a negative number.
    Hence, you�d be unable to detect programming errors that result
    in negative array sizes being requested. Because such errors
    are not uncommon, this makes your class easy to use
    incorrectly."

  • Data Type NUMC from R3 to BW

    Hi Expertts,
    The datatype NUMC holding a value 00000 in R3 becomes
    SPACE or NULL by the time it reaches to PSA.  Is there
    a way to prevent this from happening.  I want the value
    intact when and the same when it reaches the PSA up to
    the cube.
    Thanks for your reply.
    Best regards,
    Rose

    hi Rose,
    try to use 'domain' in r/3 without 'convers. routine' = ALHPA if it's your customized extraction.
    you can double click the field used in r/3 and then double click 'domain'.
    or check if remove ALPHA from conversion routine in bw infoobject used to map to that field.
    hope this helps.

  • Why is there a "Data Conflict in Midi File"

    Data Conflict In Midi File (1 of 8 tracks accepted)
    I get this message when attempting to load up [any] midi files into logic. More often than not, I get the first 8 bars of one instrument and that's it.
    Can anyone help?
    ken

    Oh, don't get me wrong. I've used Logic for 10 years now and love it to bits. I'm sure its something with my setup. But it was working for me in version 7. I can't think of anything I've changed in my config except for updating my Pro Tools and the digi driver along with it, as well as using Tiger.
    Its just that it runs brilliantly now except for a few minor glitches, like my ARP s not running as they should (that I certainly can live with and fix in post). The midi function is a little annoying though. Oh and importing an exported midi file back into logic will work (also cross platform will work).
    here's my setup
    iBook G4
    Machine Model: PowerBook6,5
    CPU Type: PowerPC G4 (1.1)
    Number Of CPUs: 1
    CPU Speed: 1.2 GHz
    L2 Cache (per CPU): 512 KB
    Memory: 1.25 GB
    Bus Speed: 133 MHz
    Tiger 10.4, Logic 7.1.1, Pro Tools 6.9.2
    As I said, it worked fine for me with versions 7.1 and 7.0.
    If anyone can try to import Steely Dan's "Do it Again" from midi database .com. Let me know if it works! I'll be grateful for any tricks or tips.
    ken

  • Data type NUMC

    Expets,
    Ineed to create Info Object with numc[30,2]. can i take numc with lenght 32 or 33. does that be in a correct format.does Dot appear when i take numc.
    because if i take it as a KF numc have lenght 8.
    Thanks

    Dear KV,
    If you dont want you can hide the decimal places.
    Double click on that Key Fig > Change > Additional Properties tab > Decimal Places = 0.
    Observe the other options too.
    You can hide the decimal values at the reporting level too.
    Regards,
    Ramkumar.

  • Why is there no WSDL type support for Web Api?

    So I am just getting started with .Net WebApi and one thing that I am noticing straight away is that there is no Contract defining how the Api looks and should be consumed (Request/Responses from each Action), this is usually in the form of a WSDL for WCF/Soap.
    It seems to me like this is something that would be very valuable and make life a lot easier for consumers of your Api.
    Is there a reason there isn't one? Is there a programming paradime or principle that I am unaware of? Is there a way I could create one?

    SOAP, REST AND PEOPLE'S CREATIVITY
    SOAP needs a description document like WSDL because each resource can be consumed with different messages, there are no definition on the protocol about constraints to the possible names/messages that you can manipulate a resource.
    For example, in SOAP your web service that allow clients manipulate an user can expose the operation that create an user in many different messages, like:
    addUser
    createUser
    insertUser
    Of course, these are just few sample messages, because I've see a lot of funny web services method names. There are really creative people out there.
    In other hand, if you are exposing your underlying system using web api that really respect the REST principles, the client just need to know that you have a resource named Users, because there is 99% of chance that you can create an user in this way
    POST /Users
    And this occurs for each operation you want to expose using SOAP or a web api REST.
    Despite being SOAP a protocol, which restricts what you can or can not do, and be REST a style architecture, which leaves many open points of how to do things. There are efforts to define conventions of how to expose and consume REST web apis.
    DESCRIBING A WEB API REST
    In the field of how to describe a web api REST I can cite
    Swagger. It is not a attempt to create a WSDL like to web api REST, but it is a good attempt to create an open standard for describing web apis REST.
    Swagger is a specification and complete framework implementation for describing, producing, consuming, and visualizing RESTful web services.
    I use Swagger a lot and really love it, mainly because
    Swagger UI that allow you generate a nice live console and documentation for your web api.
    There are many implementations of Swagger for most of languages: C#, Java, Python, Ruby, etc.
    If you are using ASP .NET Web API, there a some projects to auto generate the Swagger specification, like
    Swagger.NET
    GENERATING CLIENTS TO A WEB API REST
    Because the constraints of REST, like the limited set of verbs (GET, POST, PUT, DELETE, etc) is not so difficuty to generate a client library to a web api REST.
    Projects like
    WebApiProxy can easily generate clients do C# and Javascript.
    CONVENTIONS FOR WEB API REST
    To keep our lifes as developers easier is good define some conventions of how our web api REST will behave, the best effort I know in this field is the very good
    Apigee - Web Api Design ebook. The e-book is not an attempt to create a bible or a mantra about how to design your api, but rather a collection of conventions observed in large web REST apis, like Twitter, Facebook, Linkedin, Google, etc.

  • BOOLEAN  data type in oracle is it there?

    is there any data type in oracle which stores BOOLEAN data?

    >
    There are inevitably problems with three-valued logic. To be consistent with the 3VL world of SQL one would expect a 3 value logical type (not strictly a "boolean" type at all). The standard chose not to do that and opted for just TRUE and FALSE with NULL as a sort of substitute for the third value. That in itself creates some logical conundrums but it's probably impossible to come up with any system that makes sense of SQL's 3VL. Probably that's why most DBMS vendors leave it out.
    >
    No problem. Just define it as NOT NULL and you will have traditional 2VL Boolean algebra.

  • How to supress Zero in NUMC data type which contains some values as Char.

    Hello Friends,
    Some custom fields have been added in table BUT000 ,
    out of which one field has data type as NUMC..
    When i see some of the entries in the that field, it has values like '0000000000000000ENT'.
    I want to supress Leading zeros of that.
    i tried using
    1 ) FM CONVERSION_EXIT_ALPHA_OUTPUT &
              CONVERSION_EXIT_ALPHA_INPUT .
    2 ) Also tried coding  like this:
    data:var1 type ZBU_00LV36AT,           "this field has data type NUMC of length 40
           var2(40) type N.
    var1 ='00000000ENTRY'.
    VAR2 = VAR1.
    SHIFT VAR2 LEFT DELETING LEADING '0'.
    Nothing works ...gives output as blank.
    Is there any solution for it....
    Any valuable asnwer will be rewarded...
    Regards,
    Mayank

    Hi Marcin,
    I have tried i think problem it solved with your solution.
    Let me try for some more cases if it works fine i will get back to forum.
    Regards,
    Mayank

  • How to set focus on field having data type other than character(eg. NUMC)

    Hello all,
    I have developed one screen having table control inside. In table control suppose if numeric type field is blank(eg. Employee number of data type NUMC), system should throw error message and should put cursor focus on that perticular filed. In the same table control for fields of data type 'CHAR',  I have done this using 'SET CURSOR FIELD' .
    Please, suggest me how to set cursor focus on the fileds of data type other that character(eg. NUMC)

    Have you tried it?  SET CURSOR FIELD ... works fine for type 'N' fields in a table control.  The restriction is 'character-type' and 'flat'.  Type 'N' (or NUMC-like) fields are both.

  • Truncate leasding zeros of NUmc data type

    i want to download the value po item no which is of
    length 10 of data type numc
    number_int(10) type Numc in the data base.
    in the output the value displayed for the line item
    one is 0000000001
    But i want to get only the value 1 . leading zeros should
    be truncated.
    I tried using condense and write to by using a temporaray
    va_poitemno type char10.
    its not working
    Please suggest to do this .
    How to do that

    Hi,
    Either we can do it by Coding  or using Function module:
    DATA : i(10) TYPE n VALUE 0000000001.
    SHIFT i LEFT DELETING LEADING '0'.
    Or
    DATA: matnr type mara-matnr value '000000000000000068',
              lv_matnr type mara-matnr.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
        input             =   matnr
    IMPORTING
       OUTPUT        =   lv_matnr
      WRITE: lv_matnr.
    This will surely work.
    Plz reward if useful.
    Thanks,
    Dhanashri.

  • Issue with Info Object Transport after changing Data Type

    Hi Experts,
    We have a DSO which is running past 5 years. And recently(3 days back) we added new fields into that DSO. Delta loaded for last three days and new info object (Say XXX) data populated into DSO.
    Now the problem is, We identified that, info object data type is not correct. We used data type NUMC  instead of CHAR.So Character information is missing for that field.
    Example:
    Data from ECC: ABC123
    Data Loaded to DSO: 123 (Missed character ABC)
    So we deleted data from DSO and changed the info object data type in Development system.
    And also I have deleted only last three days delta records from DSO and transported my info object to Production. But its giving error as: Info object contains data in DSO".
    But that info object field is empty in DSO. I have already deleted last three days delta.
    Do I need to Delete all 5 years data from DSO to change the data type of recently added new info object ?
    Please give me your solutions and ideas to solve this issue.
    Thank you,
    Best Regards,
    Santhosh

    Hi Raman,
    Thank you for your answer.
    When I changed the data type of info object in Dev, I deleted the content of DSO. And same thing transported to QA as well. Before importing changed info object, I just deleted the content of DSO from QA. So transport done successfully QA.
    But in Production we have a history of past 5 years. So I cant delete all contents of DSO.
    So just deleted only the delta request's which contains data for that info object(3 days back, we moved that info object(NUMC data type) to production,So last 3 days delta only loaded for that info object). And tried to transport it. But it was failed. I am sure we need to drop all data from DSO, if I am interested to go with same info object.
    I have some comments on your first approach,
    1. If we delete info objects from Dev DSO and transport to Production will give transport failure, Why because, my previous transports errors clearly saying that info object contains data in DSO . So it wont allow to remove that info object from DSO.
    2.We are using same info object technical name in BO Data federator also. So if we change add new info objects again we need to make changes with BO as well. I am thinking this point as my last option if i cant find any other solution.
    Thank you.
    Best Regards.

Maybe you are looking for