ABAP HR leading zero's for PERNR

Hi,
I am working on a report where I have select statements. When the pernr is given with out leading zeros its not taking it.. I need to make the pernr with leading zeros like
if I hav pernr 35 its not getting data.. when i give 0000035 it gets.. so can i add the leading zeros to the pernr.
if 3737 then it should be 00003737..
how can i do this..
Thanks.

Hi Oscar,
Use CONVERSION_EXIT_ALPHA_INPUT Function module.
Please check this code...
DATA: lf_pernr LIKE pa0000-pernr.
MOVE '35' TO lf_pernr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input  = lf_pernr
  IMPORTING
    output = lf_pernr.
OUTPUT: 00000035
Best regards,
raam

Similar Messages

  • 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

  • Truncation of leading zero's for a numeric field

    How to truncate leading zeros for numeric key figure field. The field value shows 0.0000000000000000E+00. Why the value shows like this??? Plz explain.
    Draj S

    Hi,
    I guess the Infoobj is FLOATING POINT. So its displaying that way.

  • Download records to EXCEL file with  Leading Zero's for numbers

    Hi All,
    I am able to download the data to EXCEL file on the presentation server.
    There are few fields (Plant,SalesOrder Number ..with Leading Zero's) in the record.
    These values are downloaded with out Leading Zero's to excel( EX: 0000004122 as 4122).
    Please help me to download the data to EXCEL file with leading zero's.
    Thanks and Regards,
    KC

    >
    Krishna Chaitanya  G wrote:
    > The excel file which is to be downloaded..will be used by some other program..to upload the values to the sap.
    > It matters there....
    > KC
    HI KC,
    then no need to download the zeros,
    after uploading, loop at that uploaded internal table and use CONVERSION_EXIT_APLHA_INPUT and pass the vbeln(without zeros) to this FM, it will return the value with added zeros.
    hope this solves your query
    a small example
    Loop at itab into is.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    INPUT = is-vbeln "(  this is without zeros)
    IMPORTING
    OUTPUT = is-vbeln. "( this is with leading zeros)
    modify itab from is.
    endloop.
    Edited by: Soumyaprakash Mishra on Oct 6, 2009 2:16 AM

  • SQ01 ABAP Query - input field contains leading zeros

    Hi,
    I have a ABAP query where some of the values are stored with leading zeros in the table. This means that the user have to enter the leading zeros as well in the selection screen in SQ01 in order to get any output.
    What I would like to do is to restrict the input in the selection screen to allow only the digits without any leading zeros. For example, the user should not enter 000000000602590, but 602590. Also, the output should be without the leading zeros.
    Does anyone know how to do this in the InfoSet?
    Thanks in advance
    Br,
    Lars

    Hi Lars,
    The leading zeroes are appearing because your field is either a Numeric or Packed decimal.
    The leading zeroes can be suppressed if you  assign the packed to a Character field.
    You have option to change the datatype of the field in Infoset.
    Try converting it to equivalent character type.
    Let me know your findings.
    Thanks
    Ajay

  • Leading Zeros in bank Account for EBS

    Hi,
    We configured the bank account number with two leading zeros in the house bank.  Say for example i defined the bank account number as 0012345 Under house bank HSBC.
    When I receive the bank statement, the bank account number is coming with 12 digits i.e. will all leading zeros. say for example 000000012345.
    When i am loading the bank statement using the transaction FF_5, the system is giving the error Table "T012K does not have an entry with bank account number 12345".  The client is saying the length of account number is 7 digits and should be maintained as 0012345. However the EBS is not working with the leading zeros. How can we fix this issue?
    Regards
    Kotesh Padarti

    Hello!
    You can try to configure alternatice bank account in FI12. This is used in situations when the presentation of bank account in bank statement differs from that configured in main bank account field e.g. your house bank might provide you with the following layouts 000000012345 or 0012345USD etc. Therefore this functionality enables the system to recognize the bank account.
    Hope this will help you!
    Best Regards!

  • Leading zeroes dropped in Excel

    Hello folks
    I've got an issue with using downloading data onto an Excel file using the FM GUI_Download. The leading zeroes of the PERNR field get truncated when opening the file with MS Excel.
    However the zeroes are in place when the downloaded file is opened with notepad or any other text editor.
    Is there any solution to prevent Excel from dropping the leading zeroes.
    I'm currently using tab as the field separator, and have defined the PERNR field as TYPE C at the internal table used for populating and displaying the data.

    Hi,
    data:matnr(20) type c.
    concatenate text-001 g_t_ekpo-matnr into g_t_ekpo-matnr.
    text-001 is having '.
    I had declared the Matnr as type c so that it can accomodate that single quote.It is indeed downloading the matnr with preceeding zeroes into the excel but along with the single quote.Can't we get the preceeding zeroes into excel without the single quote into the excel.
    Thanks,
    Kiran.

  • L_s_range-low not taking leading zeros

    Getting a value of '01111' from a source.
    Want to add the leading zeros of '00001' to '01111' to become '0000101111' and assign that to l_s_range-low.
    Tried CONVERSION_ALPHA EXIT_INPUT but there are too many zeros added.
    Tried translate, shift , and type N, but not get the leading zeros to populated onto the selection criteria screen for the field.
    Trying to use the source value to convert it to a profit center with leading zeros.
    Regular ABAP seems to add the leading zeros when WRITE, but l_s_range-low is not taking the leading zeros and displaying it on the selection criteria screen.
    How to populate leading zeros values for l_s_range-low?

    VAL001 = '00001'
    VAL999 = '99999'
    LOOP AT itab1.
           VALUE1 = itab1-field.    -
    > field has '01234' always start with a zero.
           CONCATENATE  VAL001 VALUE1 INTO VALUE3.
            CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
              EXPORTING
                INPUT         = VALUE3
             IMPORTING
              OUTPUT        = VALUE3               .
           L_S_RANGE-LOW = VALUE3.
           CONCATENATE VAL999 VALUE1 INTO L_S_RANGE-HIGH .
           L_S_RANGE-SIGN = 'I'.
           L_S_RANGE-OPT  = 'BT'.
           APPEND l_s_range TO e_t_range.
        ENDLOOP.
    Created a variable for 0PROFIT_CTR.
    Profit Center is CHAR 10.
    when running the query, Selection criteria screen has omitted 0 and only display 1234 for the low.

  • Supressing Leading Zero's

    My database has a field that has a total of 30 characters.
    Depending on the data that was entered there could be a large number of leading zero's that is displayed within that field.  How do you supress the leading zero's for that field when the number of leading zero's could fluctuate?
    In addition to that, they are also using Bar Code Scanning on that same field.  How can you suppress the Leading zero information on the same field once it has been converted to Bar Code?

    I dont think cstr(val(x)) will work if the value is "001000000000000000005147002589" as val(x) will convert it to a number and due to the number of digits, CR will convert it to scientific notation, at least CR XI converts.
    One possible solution would be to loop through the digits and extract the data by eliminating the leading zeros.  For example:
    stringvar x := "001000000000000000005147002589";
    // Example, you don't need this in your formula
    numbervar i;
    for i := 1 to length(x) do
    if x<i> NOT EQUAL TO '0' then exit for
    // use the not equal sign (greater than and less than symbols)
    x[i to length(x)];
    You can use this formula for both display and bar code purposes by replacing X with the db field.
    Edited by: Sanjay Kodidine on Oct 21, 2009 4:50 AM

  • Leading zeros in SAP ME materials that come from SAP ERP

    Hello!
    When materials are transfered from the SAP ERP side via MII to SAP ME it can be observed that material numbers have leading zeros. For example a material number is created in SAP ME like 0000000123456 instead of 123456.
    I think this behaviour can be changed in the XLST transformations, which are part of SAPMEINT.
    Is this the usual way to fulfill the requirement "No leading zeros for SAP ME material numbers"?
    It can be observed that for example the shop orders don't have the leading zeros, when they are created in SAP ME.
    Of cause, when confirmations are sent back to SAP ERP the  corresponding XSLT transformation adds again these '0',
    it is somehow necessary for SAP ERP for the shop order lookup.
    I see one disadvantage when using modified XLST transformations.
    Each time a new version of SAPMEINT is deployed a check shoukld be made from our side, if there are changes in the original XSLT transformations.
    So what is the statement of direction from the SAPMEINT developers?
    Kr,
            Erich Lind

    We see the same problem for the leading zeros. There is no consistency in this case.
    Also the SAPMEINT Enhanced planned order report is triggering only for material with leading zeros. In this case you can't modify anything to prevent this. No XSLT modification possible there.
    Can we get any statement from SAP?!?

  • How to get leading zeroes in exponent of e-format

    In order to mimic an ancient file specification, am trying to write DBL numbers in e-format where the exponent is padded to two digits with leading zeroes.
    For example:  -1.15091E-03
    Is there a simple format code that does this or do I need to write something from scratch?
    LabVIEW Champion . Do more with less code and in less time .

    I am writing to a file.
    (Currently, I use the following workaround: format as %12.5e, then scan the substring after the "E", format it as %+03d, and recombine with the mantissa)
    LabVIEW Champion . Do more with less code and in less time .

  • How to remove leading zeros from variable

    hi,
       how to remove leading zeros from variable like it_vbap-matnr.
    value in it_vbap-matnr is 000000000000000358
    i want to remove leading zeros so that it become 358
    regards
    deepak

    You can use Function Module <b>'CONVERSION_EXIT_MATN1_OUTPUT'</b>
    This Function Module will eliminate leading Zeros.
    For each MATNR Value read form DB Table,u can eliminate Leading zeros and then modify ur Internal table.
    I think u will not get leading Zeros into utr Internal table when u read from VBAP.
    Bcoz MATNR in VBAP itself have Conversion routine.
    If u r getting leading zeros,U can use following Logic.
    tables:
      vbap.
    data:
       t_vbap like standard table of vbap.
    select matnr
    from vbap
    into corresponding fields of table t_vbap.
    loop at t_vbap into vbap.
      CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
          EXPORTING
            INPUT         =  vbap-matnr
          IMPORTING
            OUTPUT        =  vbap-matnr
      modify t_vbap from vbap transporting matnr.
    endloop.
    Hope this will work.....

  • Leading zeros with 24-hour clock?

    I have my system preferences set to 24-hour clock.
    How do I get the times to display with leading zeros?
    For example, 06:45 instead of 6:45?

    As I said before, you need to explore. I was able to add it in less than 30 seconds.
    Let me try to explain. It is easy to do, but more difficult to explain.
    Go to Sys Prefs/Int'l/Formats pane. Choose Custom in the Times area. Choose Medium in the Show drop down menu. (Medium seems to be the one used by OS X for the menu bar clock.) Here you can arrange the order of the different components as you like. Notice they have little arrows indicating drop down menus. Most of the optional formats offer a leading zero.
    Even though you have formatted it in the Int'l pane, you must choose for some of your formating to show in the Date & Time/Clock pane.
    Good Luck.

  • ** Please help urgently  ** Budget upload field with leading zeros

    We need to load a characteristic that has leading zeros.  For example 0000350.  When saving down to CSV, we lose the leading zeros (0000) so that only 350 is loaded into BW.  Saving the codes as 'text' in excel does not seem to help.
    We cannot therefore see the name for any of these codes when refreshing the workbook in BW.
    Could some please urgently tell us the correct method to save the file for loading into the BW infopackage, with all zeros intact ?
    Regards, Frederick

    Hi Frederick,
    Just some additional thoughts,
    assuming field A1 in Ecel contains 350 and you want to create a string with 8 digits, you could use formula '=text(A1;"00000000")' in an empty column and copy it back to column A. Then 00000350 should be provided in A1. This can be saved in a normal .csv file and be opened with a text editor (e.g. notepad) in order to check content.
    If you don't want to manipulate Excel data, transformation to a field with leading zeros can be easily be processed with a routine in transfer rules.
    Regards
    Joe

  • Leading zero problem!

    Hi !
    i have a numeric type variable i.e. 'w_xyz type n length 7'
    now i want to delete the leading zero's for this variable simultaneously want to retain the length of the field unaltered i.e.
    if  w_xyz = '0000987'  then i want
    w_xyz = '    987'.
    any help pls,
    Thanks in advance.
    Regards,
    Parwez.

    Hi,
    There is a simple way to achieve that : just use shift statement.
    SHIFT w_xyz LEFT DELETING LEADING '0'.
    Regards,
    Nicolas.

Maybe you are looking for