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.

Similar Messages

  • 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

  • Supressing 0 in NUMC data types

    Hello,
    I am trying to suppress leading zeros in a numc data type. I use the value in a BDC , and it then stores the leading zeros.
    Thanks

    USE FMs
    CONVERSION_EXIT_ALPHA_INPUT  OR
    CONVERSION_EXIT_ALPHA_OUTPUT
    to supress leading zeros.
    Reward if useful
    Narendra

  • Truncating leading zeros for the data

    hi ,
      I am doing a conversion project from oracle source system(DB2) to BI system. I have a situation here:
      I am extracting material numbers from source system(DB2) into a ZXXXX characteristic and in the transfer structure i checked the conversion as well and for infoobject ZXXXX, i am using ALPHA conversion. but the data i get is truncating material numbers. For example, 050302 is coming as 50302 and truncating leading zero. I am not sure what needs to be done here.
    Please advise..
    Thanks in advance...

    Hi J Dorson,
    This is the expected bahaviour if your InfoObject is configured to have ALPHA conversion. If the zero's in front of the material number is needed, then turn-off ALPHA conversion in your InfoObject (e.g. by removing the conversion exit).

  • Activation error while changing the data type of a field of a table

    hi friends,
    i am facing one problem while changing a data type of a field of a table.
    i just created one table(Yqm32) .i have assigned charcter data type to one field(ztotal_count) .now i want to change this charcter data type to numeric data type.
      while changing to NUMC data type activation error is comming as below.
    Table is not yet classified                           
    Field ZTOTAL_COUNT: Type change                       
      ALTER TABLE is not possible                         
    Structure change at field level (convert table YQM32) 
    Check on table YQM32 resulted in errors   
    Table YQM32 could not be activated                       
    (E- Structure change at field level (convert table YQM32)
    plz suggest.i need to change the data type from char to numc.
    Thanks & Regards

    Hi Pabitra......
    From the SE11 change the table as u wanted and then from menubar select
    UTILITIES--> DATABASE UTILITY
    It will open database utility
    there u select the Activate and adjust database button.
    then the database table will get adjusted.
    just try it once.........
    Suresh......

  • 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.

  • What is the table to config Data Types in BI modeling

    Hi Friends
    I got a problem while assigning data types to info objects, It has't got all data types in their fields, i have to assign NUMC data type  to assign EE ID
    and assign different Data Types to different IO, will you please explain me how to config data types?
    Thanks & Regards
    Srinivas

    Hi,
    If the data types provide by SAP doesn't meet your requirement then you need to create a custom domain by copying the existing one and assign it to the key figure.
    Go through the below document for step by step procedure:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/209b2916-1cca-2d10-b39e-90df259764ef?QuickLink=index&overridelayout=true
    Regards,
    Vijay

  • 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

  • How to Change the data type of infoobject from NUMC to CHAR

    Hi Experts,
    I have created an infoobject with data type as NUMC, i used in DSO as a key figure and i have loaded data up to PSA.
    Now i want to change the data type of this Info Object from NUMC to CHAR.
    Can anyone suggest me the solution for this issue.
    Regards,
    Venu Gopal.K

    Hi pavan/binu,
    I have not loaded data into DSO i just added IO in Key fields and i started editing this IO then im facing error like
    1.Master Data Table /BIC/PZCUSTOMER contains data: Characteristic ZCUSTOMER cannot be activated     
    2.SID Table /BIC/SZCUSTOMER contains data: Characteristic ZCUSTOMER cannot be activated
    Im also unable to edit the P & S tables in SE14.
    NOTE:I have data only in PSA and when im trying to load data to DSO Im facing these issues.

  • Explain about Data Types INT1, INT2, INT3, INT4 & NUMC

    could anyone explain about the data types and give examples.

    INT1: 1-byte integer between 0 and 255. The length is set to 3 places for this data type.
    INT2: 2-byte integer between -32767 and 32767. Fields of this type should only be used for length fields. These long fields are positioned immediately in front of a long field (type LCHR, LRAW). With INSERT or UPDATE on the long field, the database interface enters the length which was actually used in the length field. The length is set to 5 places for this data type.
    INT4: 4-byte integer between -2147483647 bis 2147483647. The length is set to 10 places for this data type.
    NUMC: Long character field in which only numbers can be entered. The length of this field is limited to a maximum of 255 places.
    Check this:
    http://help.sap.com/saphelp_nw70/helpdata/EN/cf/21f2e5446011d189700000e8322d00/frameset.htm
    Thanks...
    Shambhu

  • 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.

  • JCo getting truncated value from SAP when field data type is RAW

    We are trying to fetch data from a SAP-AII table by using JCo using the RFC RFC_READ_TABLE.
    We are getting incomplete data when the data type of the column is RAW in a particular table.A typical case is:
    Table Name: /AIN/DM_DEVCTR
    Field : CLIENT                Type: CLNT    Length:3      Value: 100                                                            (SAP Generated)
    Field:  DEVCTR_GUID    Type:RAW      Length:16    Value: 306F50F53805ED488DE9797AC86B5728     (SAP Generated)
    Filed:  DEVCTR_ID         Type:CHAR    Length:128   Value: KDEVICECONTROLLER                             (User input)
    For the fields CLIENT and DEVCTR_ID we get the entire value (including blank spaces) but for DEVCTR_GUID we get only 16 characters whereas SAP-AII stores a value that is 32 characters in length. How do we fetch the actual value instead of the truncated value?
    Sample code is attached.
              try {
                   mConnection = JCO.createClient("100", // SAP client
                             "User", // userid
                             "Password", // password
                             "EN", // language
                             "SAP", // host name
                             "00"); // system number
                   mConnection.connect();
                   if (mConnection == null) {
                        System.out.println("Connection to SAP Server failed.");
                   mRepository = new JCO.Repository("User", mConnection);
                   ftemplate = mRepository.getFunctionTemplate("RFC_READ_TABLE");
              } catch (Exception ex) {
                   ex.printStackTrace();
                   System.exit(1);
              JCO.Function function = ftemplate.getFunction();
              JCO.ParameterList importParamList = function.getImportParameterList();
              importParamList.setValue("/AIN/DM_DEVCTR", "QUERY_TABLE");
              importParamList.setValue(";", "DELIMITER");
              JCO.Table tableData = function.getTableParameterList().getTable("DATA");
              JCO.Table fields = function.getTableParameterList().getTable("FIELDS");
              mConnection.execute(function);
              if (tableData.getNumRows() > 0) {
                   do {
                        for (JCO.FieldIterator e = tableData.fields(); e
                                  .hasMoreElements();) {
                             JCO.Field field = e.nextField();
                             String str = field.getString();
                             String[] values = str.split(";");
                             for(int i = 0; i < values.length; i++){
                                  System.out.println(values<i>);
                   } while (tableData.nextRow());
              } else {
                   System.out.println("No results found");
              mConnection.disconnect();

    Hi Kaanu,
       You have to modify your java code.
    String val = new String( field.getByteArray());
    PS: Please reward points for helpful answer or problem resolved.

  • Info object as Data type as NUMC, master data doesnot store value as 0

    Hello All,
    I have an Info Object whose data type is NUMC.
    It has only text Master Data.
    Id and its description are the two fields of that Master data.
    Now when below data is feeded in to that infoobject through transformation which has 1 to 1 mapping.
    ID              Description
    0                Submiited
    1                 Approved
    2                  cancelled
    The data gets uploaded in text table but.
    0 ID values turns out to be "       "    blank.
    Which is wrong.
    Result in Text Master table:
    ID                Description
                        Submitted
    1                  Approved
    2                 Cancelled
    if the ID is 0 it should be populated as 0 for "submitted"
    No start routine our end routine is ther in the transformation.
    Kinldy help me to solve this issue.
    Points will be assigned

    Hi,
    When an InfoObject is created it'll have a blank record, in case of Numc it'll be as shown below:
    ID  Description
    0   Blank
    But this 0 gets displayed as blank as well.
    When you post transaction/master data you can post it as
    0 for Submitted
    1 for...
    2 for...
    When you do reporting on this & if you only select text display only it'll display "Submitted", which is required. But if you display ID & text or only ID. It'll display # instead of 0.
    See if you can replace this # with 0.
    Mean while i'll be trying to get this solution. I'll post soon if i get the solution.
    Regards,
    Iliyas

  • 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

  • JCO reading abap RAW data type (truncating?)

    Does anyone have experience reading an Abap RAW data type using JCO?  I am trying to read a GUID (via RFC_READ_TABLE) that is defined as RAW length 16.  When I view this field in SAP GUI, I see 32 characters.  However, when I read this field using JCO, I only see the first 16 characters. 
    The mapping documents state Abap RAW maps to a Java byte array.  I have tried that - no luck.  I have used the constructor of a string that takes a byte array - no luck.  I have made sure my character set is UTF-8 in case Unicode was a possibility.  I have turned on tracing to level 8 and only see 16 characters in the output.  I need the other 16 characters as all 32 characters are used as the primary key into other tables.
    I also posted this on the ABAP Java Development space.  I know the rule about not cross-posting, but I wasn't sure which was a better place to post something like this.  This my first post on here, so my apologies in advance.
    Larry

    Thanks for responding.  Unfortunately, the export parameter list is null. There are no export parameters.  However, there are tables.  I have tried:
    byte[] byteArray = funct.getTableParameterList().getTable("DATA").getByteArray(0);
    My SE16 query only returns one field: GUID.
    I only get 16 bytes back even though GUID is defined as raw length 32.
    Is there something I else I should try?  Do you see an error in my code?
    Thanks again,
    Larry

Maybe you are looking for

  • Regarding Payslip Report

    Dear Experts, I want to create a report which can able to display below fields. Emp No, Emp Name,Emp PF no,Branch,Designation,Start Date,End date, Basic,HRA,TA,DA,Total. Please provide me if u can have any functional specification for this report.Oth

  • Operating System Command in JDBC Sender

    Hello everybody, I'm trying to find some syntax to execute an operating system command on Windows Server 2003, but the commands don't seem to work I'm actually trying to generate a directory, now the problem is that I can't find syntax examples on ho

  • Dialog Mode windows

    Hy everyone, is it possible to set dialog mode in webdynpro's window for adapting to screen resolution. In gui you can set dialog mode for a dynpro, is it possible also for webdynpro ? Thank you !

  • Quicktime not launching; internet browser shutting down

    1. Everytime I try to open the application Quicktime it fails to launch and I immediately get the message: 'Application was closed unexpectatly. Report to Apple. etc' (Date/Time: 2007-06-11 16:12:09.281 +0200 OS Version: 10.4.8 (Build 8L127) Report V

  • How do I enable macros so that the pull-down menus in a document will work?

    I downloaded a document with pull-down menus in it. They don't work. It said I needed to "enable macros". How is that done?