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.

Similar Messages

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

  • How to add F1 help for a field on ALV grid

    Hi All,
    When we execute a program, the output is displayed using ALV grid.
    on the ALV grid, if we press F1 on a field, it should popup the help document.
    How to add F1 help for a field on ALV grid.
    Thank you all in advance.

    fill field LVC_S_FCAT-ROLLNAME of your fieldcatalog in method SET_TABLE_FOR_FIRST_DISPLAY
    A.

  • 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

  • Add List box for one field in ALV GRID

    Hi All,
      I need to add drop down list box for one field in ALV Grid.
      If any body knows, please help.
    Thanks in advance.
    Regards
    Manglesh

    Hi,
    Here is the ex where i have used for date parameter in the sel screen
    type-pools: vrm.
    data: name type vrm_id,
          list type vrm_values,
          value like line of list.
    parameters :    p_date like p_date2
                                  as listbox visible length 15.
    at selection-screen output.
      name = 'P_DATE'.
      value-key = '1'.
      value-text = 'Today'.
      append value to list.
      value-key = '2'.
      value-text = 'Last 7 days'.
      append value to list.
      value-key = '3'.
      value-text = 'Last 30 days'.
      append value to list.
      value-key = '4'.
      value-text = 'Last 90 days'.
      append value to list.
      value-key = '5'.
      value-text = 'Last year'.
      append value to list.
    Call the ''VRM_SET_VALUES' to display the values in Listbox
      call function 'VRM_SET_VALUES'
        exporting
          id     = name
          values = list.
    at selection-screen.
      if sy-ucomm = 'CLI1'.
        sscrfields-ucomm = 'ONLI'(001).
      endif.
      if p_date = '1'.
        p_date11 =  sy-datum .
      elseif p_date = '2'.
        p_date11 = ( sy-datum - 7 ).
      elseif p_date = '3'.
        p_date11 = ( sy-datum - 30 ).
      elseif p_date = '4'.
        p_date11 = ( sy-datum - 90 ).
      elseif p_date = '5'.
        p_date11 = ( sy-datum - 365 ).
      endif.
    Hope this helps u..
    Please reward points if useful.
    Regards,
    Sreenivas

  • ANY FUNCTION MODULE TO ADD LEADING ZEROS FOR A CHARACTER FIELD

    THE CHARACTER FIELD IS OF LENGTH 40 AND IT HAS 5 NON NUMERIC CHARACTERS

    Hi ,
    Try this
    DATA : c4(40).
    data : P_FIELD(40) TYPE N.
    UNPACK P_FIELD to c40.
    <b>Reward Points if useful</b>
    Regards
    Saket Sharma

  • 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

  • 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

  • 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

  • (ABAP) Code in Transformation--TO ADD LEADING ZERO FOR VALUES 10

    Hi,
    I am calculacting years and months between 2 given dates by using a Function Module.
    The result of FM will be E_YEARS & E_MONTHS
    as per my requirment i need to present the output in YY.MM format for that reason i am doing the below calculaction
    l_res = years + months / 100.
    WRITE l_res TO RESULT.
    ENDIF.
    (Ex: Y-40 & M-9 the the output will be 40.09 from above calculaction)
    I want to include a condition in above logic if years<10 then i want to add 0 in front of it.
    Ex: Y-9,M-8 THEN the output should be 09.08 (YY.MM)
    pLEASE UPDATE ME WITH THE LOGIC
    tHANKS

    Hello,
    You can format the output like YY.MM
    See this [Formatting Options|http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e3d35c111d1829f0000e829fbfe/content.htm]
    You can also use USING EDIT MASK Statment
    Date format
    Thanks
    Chandran

  • How to add leading zeros to a packed variable

    Hi all,
    I have a to add leading zeros for a packed field.
    eg.
    Data : brgew like mara-brgew.
    brgew = '12.063'.
    but I have to display the field as '0000000000012.063'.
    How can we achieve this?
    Regards.

    Execute the code .
    REPORT zex13 .
    Data : brgew like mara-brgew.
    brgew = '12.063'.
    data:val(18) type c,
         in(13) type n ,
         dec(6) type c.
    data :  a type i ,
            b type i.
            a = TRUNC( brgew ).
            write:/ a .
    in = a.
    write:/ in.
            dec = frac( brgew ).
            write:/ dec.
            concatenate in  dec+2(4) into val separated by '.'.
            write:/ val.
    see if this works for u .
    regards,
    vijay

  • Leading Zeros for Decimal values

    Hi,
    In my requirement i need to add leading zeros for Decimal values.
    For Example.
    If the value is = 0.00 then my Target value should be = 000000000000.00
    Regards,
    Anil.

    Hi Anil,
    You have to use conversion exit ,
    Kindly go through this link below:
    Re: Conversion exit: numbers in database, two decimals on screen
    Hope it helps
    Regards
    Mansi

  • Suppress leading zeros for ALV column

    Hello,
    I have an ALV with a column mapped to a context attribute of type NUMC and would like to suppress the leading zeros being displayed.  My initial solution was to change the attribute to a char/string type and remove the zeros in my code, but then, the sort functionality no longer works correctly.  Any ideas if the ALV can use a 'hidden' field to do the sorting for a certain column... that way, I can display the number as a char/string without the zeros and when the user sorts the column, the ALV will use the hidden NUMC type field.
    Thanx for any directions...

    Hi,
    You can follow the following way which i implemnted for one of my application. Here i am setting this property for the context attrubute. May be this will work. But in ALV there is no separate method for this type of setting.
    **This method is used to display the Leading zeros for the Lot Number in Step-1
      DATA:
        node_do_not_change                  TYPE REF TO if_wd_context_node,
        node_d0130_sapmf05a                 TYPE REF TO if_wd_context_node,
        node_pstap                          TYPE REF TO if_wd_context_node,
        node_info                           TYPE REF TO if_wd_context_node_info,
        ls_fprops                           TYPE wdy_attribute_format_prop.
      node_do_not_change = wd_context->get_child_node( name = wd_this->wdctx_do_not_change ).
      node_d0130_sapmf05a = node_do_not_change->get_child_node( name = wd_this->wdctx_d0130_sapmf05a ).
      node_pstap = node_d0130_sapmf05a->get_child_node( name = wd_this->wdctx_pstap ).
      node_info = node_pstap->get_node_info( ).
      ls_fprops = node_info->get_attribute_format_props( 'VALUE' ).
      ls_fprops-null_as_blank = if_wd_context_node_info=>c_format_null_as_BLANK.
      node_info->set_attribute_format_props(
        name              = 'VALUE'
        format_properties = ls_fprops ).
    Warm Regards,
    Vijay

  • How to add a search help for a field in alv?

    HI!Everyone ,
    i want to add a search help created by myself for one field in alv,
    and i want to use this function "HELP_VALUES_GET_WITH_TABLE".
    can anyone help me ?
    thanks!

    HI,Vijay.
    My code like this :
          PERFORM build_fcat.
          PERFORM build_objects.
          PERFORM layo_build.
          PERFORM set_drdn_table .
          CALL METHOD alv_grid->set_table_for_first_display
            EXPORTING
             i_structure_name = 'STU_S'
              is_layout        = s_layo
            CHANGING
              it_outtab        = itab_out
            it_fieldcatalog  = i_fcat
            ."Period
          IF sy-subrc <> 0.
            EXIT.
          ENDIF.
    for example, there is a field 'UNAME' IN Structure 'STU_S',
    i want to add a search help for 'UNAME'.
    the 'UNAME'  is not users in SAP R/3 , i want to add some data by myself or from a table .

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

Maybe you are looking for

  • Problem with 68-pin cable

    How can I fix the cable SH68-68-EP to the connector block CB-68LP (there is a gap of 5 mm between screw and hole) and to the DAQ card 6024E (there is no hole at all; it seems to me that some clip is necessary there!).

  • How to disable confirmation message when submitting a pdf form

    How do I disable the confirmation mesage, so that the user does not get at message like " you form has been recieved"  each time data is submitted? The reason for my question, is that i have a pdf form that i'd like to fill out offline, store the set

  • Recovery using Full BCV backup & archive logs

    Hello DBA's , I have Last Sunday's Full BCV (Buisness Copy Volume) backup (i.e. ..... the tablespaces were taken into Backup mode then Sync the BCV, then split the BCV , take the backup of BCV and take the tabespaces in normal mode in short what we c

  • Where is 1.9 bios for KT4V ?

    Should be available whats up ? ?(

  • Printing Color Problems mac pro to epson r2400

    I have a Mac Pro upgraded from a G5 and I am having difficulty printing the colors properly to my Epson r2400. I downloaded the newest driver from epson 6.57 but it is no different and still have colors printing wrong. Looks good onscreen but nothing