Regarding Leading Zeros.

Hello Friends,
How can I remove leading zeros in an Internal Table Value. I am writing a BDC for User Defined Transaction. Here BDCDATA-Fval contains length of 132 chars. When I append a value to BDCDATA, it is appending as right justified. when we try to populate a value in to Screen field(CURRENCY FIELD), it is taking first 10 chars(from leftside) which are Zeros(leading zeros). for that, I would like to remove leading zeros for internal table BDCDATA. How can I do it?
Thanks & Regards
Sathish Kumar

Hi Satish,
To remove leading zeros and leading blanks
Please use FM
CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal
CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
Hope this resolves your query.
Reward all the helpful answers.
Regards

Similar Messages

  • Regarding the Elimination of leading Zeroes .

    Hi Experts,
    Iam new to XI.
    Iam doing a File to Idoc scenario (PO Response) ,
    I want to remove the leading zeroes from one of the field from file and map it to the corresponding Idoc field.
    Is there any Standard functions to do this ? If not , Can anyone pls post the code for UDF to execute this Logic.
    waiting for ur response.
    Thanks in Advance.
    Regards
    Krupa.

    say ur inptu to the udf is <b>inputVal</b> use the below code in UDF:
    String output = <b>inputVal</b>.replaceFirst("^0+","");
    return output;
    or also
    int Seq = Integer.parseInt(<b>inputVal</b>)

  • Adding leading zeros in abap objects.

    Can anyone explain me
    1. How to add leading zeros to a field in abap objects.
    For eg:
    data: dmb(6) type c value '123456',
    actually the output value of c should have leading zeros added to it for length 16.
    i.e '0000000000123456' . If the length of dmb is less than 16 then leading zeros should be added to that value to make it 16 as length.
    Please tell me how to do it in ABAP Objects.

    Hi Camila
    Try to use the statement
    DATA: ALPHABET(15) VALUE '     ABCDEFGHIJ',
          M1(4)        VALUE 'ABCD',
          M2(6)        VALUE 'BJJCA '.
    SHIFT ALPHABET LEFT DELETING LEADING M1.
    The field
    ALPHABET
    remains unchanged.
    SHIFT ALPHABET LEFT DELETING LEADING SPACE.
    The field ALPHABET now has the following contents:
    'ABCDEFGHIJ     '.
    SHIFT ALPHABET RIGHT DELETING TRAILING M2.
    <b>ALPHABET</b> now has the following contents:
    '      ABCDEFGHI'.
    <u><b>IN CHARACTER MODE</b></u>
    <b>Effect</b>
    This is the default setting (see above), and the addition is therefore optional.
    <b>Note
    Performance:</b>
    For performance reasons, you should avoid using SHIFT in WHILE loops.
    The runtime required to shift a field with length 10 by one character to the right or left requires about 5 msn (standardized microseconds). A cyclical shift requires around 7 msn. The runtime for the ...
    LEFT DELETING LEADING
    ... variant is around 3.5 msn, for ...
    RIGHT DELETING TRAILING
    ... around 4.5 msn.
    Reward all helpfull answers
    Regards
    Pavan

  • Remove the leading Zero from the Query output in SAP BW ?

    Hi
    Experts,
    Vendor Number loaded  as   (0000010076) from R/3 to SAP BW.
    How to remove  Prefix  of Zero for  the Vendor Number(0000010076)  from Quey outpt.
    Regards.
    ASIT

    Hi,
    Please check out this thread.
    Remove leading zeros
    Also check if there is any conversion routine used for that particular infoobject.
    If ALPHA conversion is selected for your infoobject then it will automatically take away the leading zeros at query level.
    Regards,
    AL
    Edited by: AL1112 on Sep 16, 2011 9:15 AM

  • How can we put the leading zeros for the extract file.

    hello experts..
           Iam extracting values from one ztable in this for one filed length will be 2, for this field i need leading zero s at the time of extract... please help me....

    Hi,
    Declare the field as NUMC data type, automatically you will get the leading zeroes.
    Regards,
    Subramanian

  • How can I remove the leading zeros on jpg files?

    I'm looking for a way to remove the leading zeros on over 1000 jpg files, without changing the remaining digits in the file name. Is there some automated "batch" script?
    i.e going from 003405607.jpg  to  3405607.jpg

    You could write an AppleScript. but it will be easier to get and use a third-party file renaming utility. I use the freeware NameChanger which works quite well.
    https://www.macupdate.com/app/mac/21516/namechanger
    Regards.

  • How to delete leading zeros in sap script

    Hi
    In sapscript iam facing an issue with num4 field.
    Iam using this field to display Serial.No
    it is displaying '1' as 0001 i want to display here 1 with out leading zeros.
    If there any solution let me know

    Hi,
    Try below code
    data: w_vbeln type vbak-vbeln,
    w_char(10).
    w_vbeln = '000012345'.
    write w_vbeln to w_char no-zero.
    or
    The function Module 'CONVERSION_EXIT_ALPHA_OUTPUT' is used to remove the leading zeros in a field.
    the following is a sample code which i have used for 'Commitment item' in my report. replace the field with your required field.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
    EXPORTING
    INPUT = IT_FMIT1-RFIPEX
    IMPORTING
    OUTPUT = IT_FMIT1-RFIPEX.
    Regards,
    Chandru

  • CRM 7.0 Leading zeros on material in sales documents delta replication

    Hi
    During initial load of sales documents from ECC to CRM the item is replicated with leading zeros.
    The consequences is that CRM do not find the product and the crm order gets an error message that the product is not maintianed in product master.
    So my question is; how to replicate the order without leading zeros for items?
    BR
    Johan

    Hello Johan,
    You need to check txn:OMSL in ERP and you need to make sure that settings are in sync with CRM customizing path settings.
    SPRO>IMG>Cross-Applicaiton Component>SAP Product>Basic Settings-->Define O/P Format..
    Especially you need to check for the lexicographical flag.
    If this flag is set, then 0123 is different from 123.
    Hope this helps!
    Best Regards,
    Shanthala Kudva.

  • Variable substitution: (delete leading zeros from file name)

    Hi All,
    I am configuring an IDOC to FILE (fcc scenario) with a requirement of using the IDOC number in the output file name. 
    Using variable substitution, I manged to get the IDOC number from incoming Idoc-control record but it comes in its entitre length with a few leading zeroes like '00000001234'.
    So my output file name looks like 'Output_000000001234.txt'  . I want it to be like 'Output_1234.txt'.
    Is it possible to achieve it ?
    Thanks
    Shirin

    Hi Shirin,
    First supress the leading zeros of IDOC number by using the following code:
    Create a user defined funciton zerosuppress and take the cache as value and take one argument input. Then put the code below:
    //write your code here
    String output = input.replaceFirst("^0+","");
    return output;
    Then use variable substitution for generating ur IDOC number in the out put file name.
    Regards,
    Vinod.

  • ABAP-based web service returns numeric values with leading zeros

    Hi SOA experts,
    I have created a web service out of an ABAP function module. Beside other values, this service returns a list of document numbers. All of these numeric values are returned by the web service with leading zeros, but we do want these values w/o leading zeros.
    Any ideas how I can tell the web service to not print any leading zeros?
    Thanks in advance for your help!
    Kind regards, Matthias
    PS: The according function module does not print any leading zeros for the numeric values

    hi,
    just a guess: I'd try to use I instead of NUMC for the document numbers.
    NUMC is no number but a character string with numeric characters only. only some display routines in SAP know that this string of numerals represents a number and omit leading zeroes.
    my 2 cents,
    anton

  • Leading zeros

    Hi Gurus
    how do i remove leading zeros before filed i have tried the ALPHA Converstion it did not work please help i m new in BI explain tthe whole procedure if we have to use any abap routine/
    thanks

    Hi,
    You code in Bw 3.5 should look like this
    data: tmp_"your field" like TRAN_STRUCTURE-"your field"
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
         EXPORTING
              INPUT  = TRAN_STRUCTURE-"your field"
              IMPORTING
              OUTPUT = tmp_"your field"
    Translate tmp_"your field" to upper case. //If this is a character
      RESULT = tmp_"your field".
    and in BI7 I think TRAN_STRUCTURE becomes SOURCE_FIELDS.
    Regards,
    Nikhil

  • Leading zeros from data downloads

    Hello!
    While downloading data from the ABAP tables, Excel removes the leading zeros automatically but in some SAP tables (NAST for example), those leading zeros are necessary to find the required associated data. Is there any way to prevent Excel from removing these zeros?
    Thanks a lot!

    Hi,
    There are two ways to solve it.
    1) select complete columns in the Excel sheet and then assign the number format as ' TEXT ' in the sheet.Then u ll be able to see the leading zero's
    2) If u donot want to wrk in Excel the way i have mentioned,then in the abap program just use the FM
    "CONVERSION_EXIT_ALPHA_INPUT" over that field before uploading in  a table.
    By mistake i have told u the wrong way.the first way is for copying the data from text file to excel file and preserving the leading zeros.
    regards
    kanishak
    Edited by: Kanishak Gupta on May 6, 2009 5:36 AM

  • Leading zeros-master data

    Hi All,
    We have a characteristic 'Material'(custom defined master data infoObject) of length
    10,Conversion routine:ALPHA, datatype :CHAR,& output length:10.
    Requirement is Material number should be displayed as 10 digit number(characters ) in Bex
    report.
    but for some of the materials,we  don't have 10 digits for example we have a material
    123(this 123 should be seen as 0000000123 in Query output).
    When i am displaying infocube contents or master data contents i could see 123 as
    0000000123. but with F4,it shows 123 as 123  and in Query output also as '123'
    1.actually How data will be stored in infocube and master data tables? (either 123 or
    0000000123)
    2. one soution to display matarial as 10 char in report is  with  transfer/update routine by
    adding leading zeros.
    Is there any other way to achieve this without using routine ?kendly let me know.
    correct me if my above asumption is wrong.
    thanks

    Hi Murali,
    the Alpha Conversion ist used to convert data between an internal and an external view. The internal view is how the data is physically stored in the database. The external is i.e. how the data is displayed in reports.
    At some point the Alpha Conversion (if defined for the characteristic) is automatically used - you can not change it. This means that in this cases you can only see the external format. The BEx Reporting is one place and the F4 help another.
    In some places within the BW system (no enduser view) you have the option to see the data in the internal format. One of these places ist the cube content. There you have a flag "Do not use any conversion". If this flag is activated you will see the data in the internal format. But this is NOT the format a user will see in reporting.
    In your case the internal format is the value "0000000123" and the external "123".
    Hope that helps
    Regards
    Adios

  • How to delete decimal point and adding leading zeros....

    Hi,
    I have one requirement in the report   i.e.
            <b>Present Value    :</b>  44567.98
            <b>Expected Value  :</b> 0000004456798
    In the present Value how will I remove that decimal point and how to add those six ing zeros. I tried with CONVERSION_EXIT....but it is not giving. Help me...
    Thanks in advance.
    Regards,
    Kumar.

    Hi,
    Use SPLIT and COMCATENATE fnctions.
    Eg:  split l_v at '.' into l_v1 l_v2
            concatenate l_v1 l_v2 into l_v.
    For adding leading zeros
    Use FM CONVERSION_EXIT_ALPHA_INPUT.
    Eg:
    data: tknum type vttk-tknum value '99156'.
    call function 'CONVERSION_EXIT_ALPHA_INPUT'
         exporting
              input  = tknum
         importing
              output = tknum.
    Sri
    Message was edited by:
            Sri Tayi

  • Displaying leading zeros in ALV

    Hi experts,
      I have a field of length 12 char. I want to display the field in grid.
    My requirement is if the field is below 6 char(such as 101) i want to display as 000101 .I added logic for adding zeros up to six char but the leading zeros are supressed in my grid.
    I want as 000101 but it is showing as 101.
    I am using REUSE_ALV_FIELDCATALOG_MERGE for building the field catalog.
    How to solve this.
    Thanks & regards,
    karthik.

    Hi,
    you must work with a mask for your field like this:
      repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                i_program_name     = repid
                i_internal_tabname = 'MY_TABLE'
                i_inclname         = repid
           CHANGING
                ct_fieldcat        = field_catal.
      Modify field for leading 000
      LOOP AT field_catal INTO w_fieldcat_alv.
        CASE w_fieldcat_alv-fieldname.
          WHEN 'NUM_FELD'.                                    "<-- this is your field
            w_fieldcat_alv-edit_mask   = '000000'.
            MODIFY field_catal FROM w_fieldcat_alv.
        ENDCASE.
      ENDLOOP.

Maybe you are looking for