How to add prefix zero to all matnr fields in itab

Hi,
  I ve a internal table with following fields
  Matnr                                                  bwkey                            
  6                                                        678                                 
  67                                                      rty     
  678                                                    78k                                
  How to add prefix zero to all tha matnr fields.
  like
matnr                                     bwkey
00000000000000006                678
00000000000000067                rty
00000000000000678                78k
Thanks in advance

Hi,
commonly used conversion routine is ALPHA.
It is conversion used to insert leading zero for document number.
For example, in sales order (VBAK-VBELN length 10),
when we key in order no, for example we key in '4302',
conversion routine input will automatically add leading zero,
so it will become '0000004302', this is real value stored in table VBAK.
On conversion routine output, it will delete leading zero
function CONVERSION_EXIT_ALPHA_INPUT, this will add leading zeros to a character based field of any length.
Ex:
data: lv_c(10) type c value '123'.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
          exporting
                  input = lv_c
          importing
                 output = lv_c.
write:/ lv_c.
Regards.

Similar Messages

  • How to add prefix to standard PO sequence.

    Hi all,
    Requirement is how to add prefix to Purchase order number auto generated sequence.

    The only options you have for po numbering is automatic and manual.
    What you are looking for is not available out of the box.
    You can always write a customization to achieve it.
    Here are couple of options for the customization. You will have to explore them a little bit to identify any pitfalls.
    1) A before-insert trigger on po_headers_all that appends the suffix to the PO#
    2) A when-new-record-instance personalization to generate the new PO# with suffix.
    Hope this helps
    Sandeep Gandhi
    Independent Consultant

  • 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

  • How to add 'Confidential' watermark to all the pages in portal

    Hi
    How to add 'Confidential' watermark to all the pages in portal.We have ESS/MSS business packages installed 60.1, 60.2.
    ECC5, EP SP16 is the environment.
    Help will be appreciated
    Thanks
    Sharath

    Hi Sharath,
    What about using the theme editor to add a background to either the page or the iView tray?
    Daniel

  • How to add two zeros end of field

    how to add two zeros end of field?

    Hi srinu,
    If it's a number field, then just multiply by 100.
    If it's a string, then just use CONCATENATE and add the '00' to your existing string.
    Hope this helps.
    SL

  • How to add tick marks to all sides of graph

    Hi,
    I'm trying to format a graph in numbers and would like to know how to add tick marks to all axies on the graph, ie. top, bottom, left & right.
    I can get tick marks on the bottom and left axis, but can't seem to find a way to add them to the others.\
    Thanks,
    Oscar

    Hi Oscar,
    Numbers 2.3, but this will work in Numbers 3.0.1 with different Inspector choices.
    When in doubt, cheat! This will give a second Y axis. It is a 2-Axis Chart (the bottom one in this screen shot of Chart Types):
    Column C (Value 2) has dummy values copied from Column B (Value 1).
    Now hide the Column graph by selecting it and changing the fill to None. (Inspector > Graphic > Fill > None).
    Set gridlines, tick marks, hide Legend as you wish.
    To add a second X axis at the top, Chart Inspector won't do that. Insert Shapes and Text Boxes?
    Regards,
    Ian.

  • How do we know what are all the fields  updated in a screen?

    Hi all,
             If i am making modifications in row details of sales order screen .for eg, <b>i am changing the quantity or price for a row</b> 
             I want to write log file for the updated fields for that particular sales order.
             <b> How do we know what are all the fields are updated ?</b>     
             If we can use SBOTransaction_Notification procedure.How to write code inside that.
             Please provide code example for that.I have downloaded the sample.But i donot know how to use 'Add code to here ' part.
             Please help me to solve this.Hope  your  reply soon
    Regards,
    V.Rangarajan

    Hi, V.Rangarajan!
    When the field in the matrix is filled with some value and the user moves to another field, the et_LOST_FOCUS event occurs. So, i think you can try to handle ItemEvents and use such code (for example):
    if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_LOST_FOCUS && pVal.ItemUID == "38" && pVal.BeforeAction == false && pVal.FormType == 139)
    string ChangedColumnID = pVal.ColUID;
    int ChangedRowNumber = pVal.Row;
    and write the values to your log.
    "38" - is the matrix ID in the Orders form
    "139" - is the Orders form
    Also you can access to the value, that user had put into the field.
    Hope this helps!

  • How to add a search help to a field  Bank Type in Transaction FK02

    Dear All,
         How to add a search help to a field  Bank Type in Transaction FK02.
         Is there any possibilty of using  exit or searc help or domain to solve this problem.
            Thanks in Advance..
    Thanks,
    Lakhsmi.

    Hi, Tamas,
    I found the reason. The function Z_WEBRFC_READ_DATA_SH had a string concatenation error.
    CONCATENATE '{"results":[{"key": "shlpname", "value": "' l_shlp '"},"key": "fieldname", "value": "' l_field '"}]}' INTO htmldoc-line.
    The correct code is like:
    CONCATENATE '{"results":[{"key": "shlpname", "value": "' l_shlp '"},{"key": "fieldname", "value": "' l_field '"}]}' INTO htmldoc-line.
    Another question is, I can't get any words in Chinese from WebRFC. It returns error when I try it. How can I configure it?
    Xin

  • How to add a search help for a field in Screen Personas?

       I just started learning to use a Screen Personas, and I want to know how to add a search help for a field.
       I found a property in the help document named "IsLookupSupported". Is it the key?  But I saw it was gray in the field I created, and its value is "false". I could not change it.

    Hi, Tamas,
    I found the reason. The function Z_WEBRFC_READ_DATA_SH had a string concatenation error.
    CONCATENATE '{"results":[{"key": "shlpname", "value": "' l_shlp '"},"key": "fieldname", "value": "' l_field '"}]}' INTO htmldoc-line.
    The correct code is like:
    CONCATENATE '{"results":[{"key": "shlpname", "value": "' l_shlp '"},{"key": "fieldname", "value": "' l_field '"}]}' INTO htmldoc-line.
    Another question is, I can't get any words in Chinese from WebRFC. It returns error when I try it. How can I configure it?
    Xin

  • How to add 2 days to a date field?

    How to add 2 days to a date field if a Saturday was selected on a different date field?
    Thanks

    I am attempting to add a date field and then have a another field add an amount to a box if the date is less than 30 days. Later I want to update the form to have the today's date is less than 10 days.
    Early Registration Fee is $10.00 if posted by February 25, 2008
    Late Registration Fee is $20.00 if posted by March 17, 2008
    It seems simple, but, when you get to be 71 years old, it seems difficult. Any help will be appreciated.
    Here is a link to the form I'm working on:
    http://www.aworldwide.com/Gideon/Convention_Registration.pdf
    I am using a trial version of Adobe Acrobat 8.
    Thanks,
    Andy Anderson

  • How to add a user defined HTTP header field?

    Hi, everyone!
    I want to add a user defined HTTP header field to a HTTP
    response header.
    I use the following statements in testHeader.jsp
    response.addHeader("myheader", "123");
    response.sendRedirect("middleHeader.jsp");
    in middleHeader.jsp,
    out.print(request.getHeader("myheader"));
    But the output in middleHeader.jsp is null!
    How to add a user defined HTTP header field to a HTTP
    response header? Are there some sample codes?
    Cheers,
    George

    the send redirect actually creates a new request (through the client) and thus a new response
    thus the headers you set in the response are gone for the next request/response
    You can try servletDispatcher.forward

  • How to add * wild card to a specific field on the selection-screen.

    Hello,
    How to add a * WIld card to a field in selection screen.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS : S_STCTS FOR G_STCTS OBLIGATORY,      "NUMBER SCHEME
                     S_AT20A FOR G_ATTR20A,    "SUBSTANCE ID
    SELECTION-SCREEN END OF BLOCK B1.
    I need to add Wild card functionality to Number scheme field S_STCTS on selection-screen.
    Any suggestions would be apprecaited..
    Regards,
    Kittu

    Hi Kittu,
    Here is one sample code:-
    select-option : s_name like kna1-name1.
    start-of-selection.
    if s_name-low = '*'.
    select * from kna1 into table it_kna1.
    elseif s_name-low = 'pat*' or s_name-low = 'pat'.
    select * from kna1 into table it_kna1 where name1 like 'Pat%'.
    endif.
    In case of wild card Select should be :-
    select * from <dbtab> where <field> like 'P%'.
    You can also use RANGES in your Code.
    E.g. RANGES: R_OBJNR FOR JEST-OBJNR
    R_OBJNR-SIGN = 'I'.
    R_OBJNR-OPTION = 'CP'.
    R_OBJNR-LOW = 'K1*'.
    R_OBJNR-HIGH = 'K2*'.
    Hope this helps.
    Thanks & Regards
    Jitendra Gujarathi

  • How to Add F4 Help To a Screen Field In a Module Pool Program

    Hi Friends,
    1. How to Add F4 Help To a Screen Field In a Module Pool Program?
    2. How to select a single cell in ALV report output for interactive reporting ?
    Kindly give code example.
    regards,
    Pradeep

    Hi,
    Try using the fm 'F4IF_INT_TABLE_VALUE_REQUEST'.
    Refer the link below for selecting  single cell.
    alv
    Reward points if useful.
    Regards
    Rose

  • How to add a help line below a field

    Can anybody give some hints about how to add a help note below a field formatted to its size.
    A single line to be added for user to know how to input a employeeId in which format.
    I know we can add a help to the field.

    <Property name='inlineHelp' value='YYYY-MM-DD'/>

  • How to add leading zeros ?

    Hi Friends,
    I have a shipment no say 10 char long . Now the thing is in my program I need to add leading zeros if the shipment no is not 10 char long .
    For eg : if the tknum is 99919 . I need to make use of a command to make it 10 char long lke 0000099919.
    Also I need to be able to add zeros if tkum is 5 or 7 or 8 char long .
    How do i add these leading zeros to fill up the remaining positions ?
    Thanks,

    hi ,
      use the following code.
    data : lv_vbeln(10) type c.
           lv_sonumber like vbak-vbeln.
    <b>This function module will convert the data into the required format based on the data type of the variable that you are passing in import paramter of the funcation module.</b>
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
              EXPORTING
                        INPUT         = lv_vbeln
                     IMPORTING
                       OUTPUT        = lv_sonumber
    Thanks
    mahesh

Maybe you are looking for