Leading zeros in Numc field

Hi all,
        help me in  the issue . I am passing  value to a numc(3) field . lets take the value as '073' but it is showing as 073 in the output . How to acheive leading zero for the same in the output for a standard field.
Thanks in advance

data : num(3) TYPE C VALUE '073',
       val(3) type N.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = num
IMPORTING
OUTPUT = val .
write : val
No Eric FM CONVERSION_EXIT_ALPHA_INPUT also work. Try the above code.
/Edit: Ohh.. Go as per my earlier post.
Edited by: Mishra.Manas on May 5, 2010 1:39 PM

Similar Messages

  • How can i avoid leading zeros for a field in smartform?

    how can i avoid leading zeros for a field in smartform?

    Hi,
    Using the Symbols.
    &symbol(Z)&  Omit Leading Zeros  &symbol(S)&  Omit Leading Sign 
    &symbol(<)&  Display Leading Sign to the Left 
    &symbol(>)&  Display Leading Sign to the Right 
    &symbol(C)&  Compress Spaces 
    &symbol(.N)&  Display upto N decimal places 
    &symbol(T)&  Omit thousands separator 
    &symbol(R)&  Right justified 
    &symbol(I)&  Suppress output of the initial value 
    Regards,
    Shiva Kumar

  • How to add leading zeros to kunnr field

    Hi All,
    I need to add leading zeros to KUNNR field runtime.
    i.e for some customer it is displaying '2001084606'
    some customer's it si displaying '10434'.
    I want add leading zeros when customer length is
    not equal to ten '10'.
    plz kind let me know this is urgent.
    Regards
    Bhaskar

    Hi there,,
    Kunnr is using a dataelement with Char 10.
    You can do in this fashion to resolve your issue.
    len = strlen (itab-kunnr).
    len is having the lenght of the customer number.
    if len < 10..
       while len < 10.
          concatenate '0'  itab-kunnr into temp_text.
          add 1 to len.
       endwhile.
    endif.
    now finally you can assign temp_text to your itab-kunnr.
    hope this way you can resolve your issue.
    if found helpful,, don't forget to reward points.
    Thanks-
    Rahul.

  • Adding leading zeros in a field mapping

    Hi,
    I am getting account as a 5 char field in the input file. I need to map this to a 10 char field in XI and add leading zeros in case the value is all numeric. Is there any standard data type/ mapping that can achieve this or I need to write a UDF.
    Thanks,

    formatNum field will cause an exception if your input isnt all numeric...
    I'd go for UDF id your input isnt always numeric.
    Regards,
    Henrique.

  • Delete leading zeros for a field on the pdf form

    Hi,
    i know it is possible to delete leading zeros via abap coding in the interface.
    But is it also possible to this directly on the pdf form - scripting or a setting?
    Thank you
    Kind regards
    Manfred

    I believe you can set this up as a field display pattern (if you use LCD 8.1 or something like that).
    Or you can script that out. In formcalc you can easily process characater by character, test if that is zero and remove it.
    http://help.adobe.com/en_US/livecycle/es/FormCalc.pdf
    Otto

  • How to remove leading Zeroes in all fields in Payload

    Hi,
    How can I remove the leading Zeroes in every Filed I have in whole Payload Structure.there are around 10000 fields that have to be removed the leading Zeroes.any good idea please.
       <POSNR>000010</POSNR>
      <MATNR>000002465640</MATNR>
      <ARKTX>000012 KG D107</ARKTX>
      <MATKL>00030010000</MATKL>
      <WERKS>0000ORGC</WERKS>
      <LGORT>0000GC55</LGORT>
      <CHARG>000TEST</CHARG>
    like this mutliple segments and multiple Fields.so  I can take as whole payload with multiple fields should not have leading Zeroes.I can handle if they are 10 0r 20 fileds,but not like whole pay load/1000 fields right.
    thank you,
    Prem

    Hi
      You can have an additional XSLT mapping, to your existing one..
    use copy-of & apply-templates to copy the whole tree & make changes recursively.
    below is a sample code , the marked line is where you need to try your logic of trimming Zeros. (this code does upper case)
    add this below code in your interface mapping object, as XSLT mapping, which does the job (only try putting your logic)
    <xsl:stylesheet
                      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                      version="2.0">
                <xsl:output  method="xml"
                            indent="yes"
                            omit-xml-declaration="yes"/>
                <xsl:template  match="*">
                      <xsl:copy>
                            <xsl:copy-of  select="@*"/>
                            <xsl:apply-templates/>
                      </xsl:copy>
                </xsl:template>
                <xsl:template  match="text()">
                      <xsl:value-of  select="upper-case(.)"/>
                </xsl:template>
          </xsl:stylesheet>
    hope this fixes your issue
    Regards
    Vishnu

  • Need to add leading zeros to the field if field length is less than 6

    Actually the field length is 16.
    But for some manual entries it is comming as 4 chars.
    so if field length is less than 6 then it should be replaced by leading zeros.
    Moderator message: very basic, please (re)search yourself before asking, @all: please do not reply to basic questions, points removed.
    locked by: Thomas Zloch on Sep 9, 2010 11:43 AM

    Hi Ravi,
    Do it in 2 steps.
    1. check the length of your entry by strlen function and get the length.
    2. If the output is less than 6 call the FM CONVERSION_EXIT_ALPHA_INPUT to get leading zero
    Regards,
    anirban

  • Add leading zero for character field on ALV

    hi all , 
        i am currently making an ALV report. i have a field which is 'rassc' char(6) in the internal table which should be shown on the report.
    before i use function to show alv report , i saw the value of this field is '080' , but what i get on the report is '80'.  i want the leading zero . but i don't know how .
    plz guide me.
    regards
    Kevin

    hi,
    check this.
    DATA:
    var TYPE matnr.
    WRITE '80' TO var RIGHT-JUSTIFIED.
    TRANSLATE var USING ' 0'.
    WRITE: var.

  • Leading zero's for field Serial Number

    Hi All,
    I need to be able to have leading zero's for the serial number field (GERNR). I have found a few notes for the industry solution for A&D but does anyone know if there is a solution for normal ECC?
    Cheers
    Chris
    Edited by: Chris March on Sep 16, 2008 2:49 PM

    Hi Chris
    Did you manage to get a solution for this?
    Regards
    Anant

  • Leading Zero w/ variable field length...

    I'm creating a form in which I need a particular field to:
    - Accept/Display a leading zero (or multiple leading zeros);
    - Accept numbers numbers;
    - Have a maximum field length of six numerals, but with the ability to accept fewer;
    - Display an error message if the above criteria are not met.
    I have some code (see below), but don't know how to make the field length variable.
    var fmt = /^\d\d\d\d\d\d$/;
    if(event.value != "")
    if(!fmt.test(event.value))
    app.alert("Incorrect format, field must contain numbers only.");
    event.rc = false;
    Make sense...? Can anyone help...?
    Thank you.

    This drops the leading zero(s) and does not display the error message.
    Adjustments...?
    Thank you for your promp reply.

  • Leading zero on char field

    I have what would be a simple thing.  A need to have leading zero retained on a variable..that holds a month.
    I have a field that is 20090501 and I want to make it 20090401...  that is take 1 month off
    But problem is the calculation does not give leading zeros
    ... here is very cut down version of what I am doing
    DATA:  lv_Period(8) type c,
          lv_mm(2) type c.
    lv_mm = '05'.
    lv_mm = lv_mm - 1.   "becomes 4.    " how do I make it "04".
    concatenate '2009' lv_mm '01' into lv_Period.    " this becomes  2009401  and not 20090401

    DATA: lv_Period(8) type c,
    lv_mm(2) type c.
    lv_mm = '05'.
    lv_mm = lv_mm - 1. "becomes 4. " how do I make it "04".
    if lv_mm is LT  '10'.
    concatenate '2009' '0' lv_mm '01' into lv_Period. 
    else.
    concatenate '2009' lv_mm '01' into lv_Period. " this becomes 2009401 and not 20090401
    endif.

  • Padding leading zeros to char field

    Hi Gurus,
    user enter number in the field which is char 10, and if they enter any value which is lesser than 10 then i have to pad leading zeros to cusno.
    i am using following logic but its displaying error saying unable interpret 'v'.
    any hep in this regard really appreciated.
    data : cusno type char10 value 'PADA'.
    Data : l type i.
    data : v type c value '0'.
    l = STRLEN( cusno ).
    while l < 10.
    concatenate v into cusno.
    endwhile.

        Add Leading Zeroes
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
            EXPORTING
              input  = cusno
            IMPORTING
              output = cusno.
    This will add leading zeroes to cusno if its length is less than 10.

  • How to delete leading zeros for amount  fields

    Hi all,
    I have problem with the leading zeros, where I am populating nearly 30 amount fileds in my  statement.i want to delete leading zeros.
    I have tried with shift and pack.
    and I cannot call every time the function module *alpha_output or input.
    can anybody suggest me the better solution.
    Regards,
    Sre

    You could use a syntax like 
    SHIFT: w10a LEFT DELETING LEADING '0',
           w10b LEFT DELETING LEADING '0',
           w10c LEFT DELETING LEADING '0',
           w10d LEFT DELETING LEADING '0'.
    or using macros like
    DEFINE delzero.
      shift &1 left deleting leading '0'.
    END-OF-DEFINITION.
    delzero: w10a, w10b, w10c, w10d.
    Regards

  • System is showing 7 leading zeros in assignment field

    Hi,
      I have posted one document through F-29 and  in assignment field i have assigned cheque number which is a six digit number and then i run FF68 (Edit check deposit list), when i save that document system creates one accounting document but automatically  showing leading 7 zeros in cheque number.
    Thanks in advance.
    Regards

    data : num(3) TYPE C VALUE '073',
           val(3) type N.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = num
    IMPORTING
    OUTPUT = val .
    write : val
    No Eric FM CONVERSION_EXIT_ALPHA_INPUT also work. Try the above code.
    /Edit: Ohh.. Go as per my earlier post.
    Edited by: Mishra.Manas on May 5, 2010 1:39 PM

  • Adding leading zeros to a field in an Internal table

    HI Experts,
    I have an Internal table with 3 fileds
    and the second filed is of lengh 10,
    In this filed i get the data which is of 4 character
    I want the leading 6 0's to be added for that 2 field
    For Eg
    HI 1234      HELLO
    HI 1222      HELLO
    I need the Output as
    HI 0000001234 HELLO
    HI 0000001222 HELLO
    Thanks

    Hello,
    >
    Karthick raz wrote:
    > HI Experts,
    >
    > I have an Internal table with 3 fileds
    >
    > and the second filed is of lengh 10,
    >
    > In this filed i get the data which is of 4 character
    >
    > I want the leading 6 0's to be added for that 2 field
    >
    > For Eg
    > HI 1234      HELLO
    > HI 1222      HELLO
    >
    >
    > I need the Output as
    >
    > HI 0000001234 HELLO
    > HI 0000001222 HELLO
    >
    > Thanks
    Consider field2 is the second field that u have mentioned.
    data: temp(4) type c,
             field2 type n.
    temp = '1234'.
    write temp to field2 right justifield.
    Hope this helps.
    Thanks & Regards,
    Anand Patil

Maybe you are looking for

  • Can't open a folder?

    I can't open one of my folders! When I try Finder hides and my desktop refreshes itself. If I try to see what's in a folder in Word or something, the program "quits unexpectedly". What should I do? I ran antivirus software and it didn't come up with

  • How to pass data back to MS CRM online from Azure SB with two-way listener?

    Hi all, I have already setup the integration between MSCRM Online 2015 and Azure using two-way listener.  However, I am unable to retrieve the return string "Success" in MSCRM side, such as System Jobs.  Anyone has idea?  Thanks. https://technet.micr

  • Using Spaces with Shared Screen

    I am using a shared screen to access my two other computers, and I really would love to be able to use Spaces to do this. One keystroke and I'm full screen on my other computer, how cool would that be. I just can't seem to do it. Spaces asks for the

  • ISP Bandwidth Testing Issue

    We just commission an STM1 link to an upstream ISP, part of the bandwidth is meant for mobile data service of a customer. The customers complain of slow download while we still have 100Mbps of capacity available. The customer did an FTP test but the

  • Will iMessage say delivered when the message is being sent to a dead device

    My iPad was dead and someone messaged me and it said delivered, is it normal to say delivered even when the device it's sent to is dead?