Filter on character fields

Hi all,
  Is there any way to have filter on character fields to get the data even if the input is not given without padding zeroes before the data. for eg in ALV grid display if the data is having 7 characters but total field length is 10 chars then in filter we have give 3 zeroes leading to the data to get the filtered condition. is there any way to avoid this so that the users can give directly the data without leading zeroes.

Hi sathya,
in your itab declare the same field referring to Db table.
this will take care of the padding of zeros as alpha routine is applied on that filed.
so the user can proceed with the same by not giving the input padded with zeroes.
below code will give u an idea.
data : val1 like  vbak-vbeln value '0005002030'.
data : val(10) type c  value '0005002030'.
write:/ val.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input        = val
IMPORTING
   OUTPUT        = val.
write:/ val.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input         = val1
IMPORTING
   OUTPUT        = val1.
write:/ val1.
i agree with anurag ..
regards,
VIjay

Similar Messages

  • How to move the value from a character field to numeric or packed decimal

    Hi,
    can anyone explain me on how to move the value from a character field to numeric or packed decimal.
    Please help me on this. Thanks...
    Regards,
    Rose.

    Hi ,
    if you use keyword MOVE u may loose the decimal and thoussan separator and if u don't want to loose them just call the FM ..HRCM_STRING_AMOUNT_CONVERT.
    i doubt wherther it is HRCM or HCRM just try using *
    this will suit ur requirement.
    Regards,
    KK

  • How to get a currency format for a character field

    for some specifix reason, we have a requirement to show character field (which results in value 633948) in the format $633,948
    how do i do this?
    if i do SELECT to_char(:c_1,'$999,999')) from dual;
    it gives me ora: 01722: invalid number error
    c_1 is a user parameter of data type character

    Try using TO_NUMBER first, as in something like:
    SQL> VARIABLE c_1 VARCHAR2(6)
    SQL> EXECUTE :c_1 := '633948';
    PL/SQL procedure successfully completed.
    SQL> SELECT TO_CHAR(TO_NUMBER(:c_1), '$999,999') FROM DUAL;
    TO_CHAR(T
    $633,948Hope this helps.

  • How to accomodate more than 255 characters in character field

    HI All
    i need to accomodate more than 255 characters in character field. How can i do that ?
    thanks in advance!!!

    Hi,
    You can try the following things:
    1. Use a datatype STRING and check it will work.
    2. In se11 transaction goto datatype and search for char* in data elements.
    You will find predefined data types ,you can make use of it.
    For eg. char2000,char3000,char4000 etc.
    Hope this will help.
    Regards,
    Nitin.

  • Sql injection character fields

    Is it true that with MSSQL in the background, character fields can't be used for sql injection?
    A)   One source says that in MSSQL single quotes are escaped into double quotes.
    B)   Another source says that " SQL injection (within ColdFusion apps) is really only an issue with non textual fields. If a text value is tampered with you'll end up with tampered text, but that text will all be part of the core string (within quotes) passed as a value, and will therefore not be executed as separate statements. Numbers, on the other hand, are not enclosed within quotes, and so extraneous text can be tampered "
    Questions about A):   How does escaping 's with "s help, by making string literals in MSSQL not valid?
                                    How could A) above be true when names like O'Mally are being stored with a single quote ?
    Questions about B)    Does it mean code like DELETE * FROM atable would just be stored as a string and not execute ?
                                    If so, is that accurate ?

    To actually answer your question's.
    A) A single quote in SQL is a comment.  To store a single quote as DATA one has to escape it by doubling it.  So to store O'Mally it would be passed as o''Mally.
    The simple SQL injection attack is to end a number value with a random value, that is followed with a ; to end the SQL statment and then another statement can be run, this is then followed by a single quote to comment out any other SQL in the original statement.  ColdFusion automatically escapes single quotes in text fields in most situations, so this is harder to do with text fields, but not impossible.

  • How to set Character field's Format Mask?

    dear all,
    how to set Character field's Format Mask?
    i searched the forum and found the following, where can i use this code and how to change and set its format mask.
    SRW.SET_FORMAT_MASK('mask');
    Thanks
    Muhammad Nadeem

    Nadeem,
    If you have database 10g, look into function REGEXP_REPLACE. Otherwise you can also try this (you might already know).
    SELECT SUBSTR('CHHOCMIPO07020001', 1,2)||'-'||SUBSTR('CHHOCMIPO07020001' ,3,2)||'-'||
    SUBSTR('CHHOCMIPO07020001' , 5,2)||'-'||SUBSTR('CHHOCMIPO07020001' , 7,3)||'-'||
    SUBSTR('CHHOCMIPO07020001' , 10,2)||'-'||SUBSTR('CHHOCMIPO07020001' , 12,2)||'-'||
    SUBSTR('CHHOCMIPO07020001' , 14,4)
    FROM dual
    CH-HO-CM-IPO-07-02-0001
    If you have to use this at many places, create a function, pass the raw value, manipulate the string and return.
    FS

  • How to encrypt/decrypt 4 character field in ABAP?

    Hello SDN Community,
    I have done extensive searches before posting this.  Have even explored fuction modules FIEB_PASSWD_ENCRYPT/DECRYPT.  Even looked at SSF Developers Guide - chapter 4.  The FIEB function modules were dead-end.  SSF looks like it concerns securing of documents or files.  Talks about certificates.
    I also looked at the SSF_BASE64_ENCRYPT/DECRYPT function modules on my system, which is ECC 6.0.  Wasn't sure if they could be used on a stand-alone basis, plus I couldn't find any documentation about them.
    I only want to encrypt, and then decrypt, the values in a 4 character field.   
        eg- DATA: MYFIELD(4) TYPE C.
    Is there an ABAP function module, or coding example, that would demonstrate this?
    Or possibly I overlooked something in the information that I have already found?
    Thank you,
    Dean Atteberry.

    Hi Morten,
    I would recommend reading the comments to the blog as well, as there would not be much difference between a 4 char field and...
    *-- check string-to-string algorithms
      string_in = 'Au weia, der Hahn legt keine Eier'. "#EC NOTEXT
      string_out = test_object->encrypt_string2string( string_in ).
      string_expected = 'AQYRHTFUERodER9UABMRGFQaHBU8VAYREFRYFR0RA1QBNQ=='.
      if string_out <> string_expected.
        result = abap_false.
        return.
      endif.
    ...if the result can be expected (in any SAP system) or easily reversed.
    But it might fullfill a requirement for obfuscation, which is what I was asking as well.
    Cheers,
    Julius

  • Quantity field moved to character field

    Hi,
    when I move a quantity field with decimals to a character field, and place that character field on my sapscript form, the comma that was in the quantity has now become a point. (0,128 has become 0.128)
    Is there a way to avoid that and keep the comma?
    thx.

    Hi There,
    when you debug if you see '.' in character field. then do this  way.
    if lv_char ca '.'
    replace ...<press f1>
    hope this helps.
    Reg

  • 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

  • Character field in excel output exist some junk character's

    PlatForm :IBM630,PC
    Operation System:windows xp,windows 2003,AIX 5.3
    IAS version :10.1.2
    Language :Chinese
    When set desformat parameter equal to spreadsheet, character field in excel output exist some junk character's,
    and as excel output data gather volume,junk character's will more and more.
    But when I only get the record include junk character's,then the excel output will be ok.
    How can I do to solve the problem?
    Thanks in advance!
    lind
    Message was edited by:
    user565112

    PDF,RTF DESFORMAT is right,but users need spreadsheet desformat too.
    the characterset is unicode,and end signal of junk character is ?/SPAN>.
    When I get excel output include junk character,the same time get the junk character's record,and then get excel output only include the junk character's record,the excel output will be showed correctly,no junk characters.
    How to sovle the problem?
    thanks.
    Message was edited by:
    user565112

  • Increasing SMS character field - Curve 8330

    How do I increase the character field for my messages on my Blackberry Curve 8330? It's limited right now to 140 spaces.

     Hi and welcome to the forums caspittal!
    Check out this link: Beyond 160
    Here's a couple more links for you to explore:
    Crackberry.com Software
    Blackberry App World
    Have fun. 
    IrwinII
    Please remember to "Accept as Solution" the post which solved your thread. If I or someone else have helped you, please tell us you "Like" what we had to say at the bottom right of the post.

  • Padding character fields with zeros

    Hello,
    I need to add zeros to the end of character fields TYPE C. I know i can use the conversion routines but that only works for numeric fields.
    Thanks

    Thanks for all the replies.
    STRLEN will give me the lenght of the field but i need the offset of the last chararcter.
    Your post gave me an idea though. I'm doing the following and it's working.
    value = 'Thank You          '.
    tmp    = '00000000000000'.
    FIND REGEX `\w[ [:space:] ][ [:space:] ]` IN value MATCH OFFSET moff.
    IF SY-SUBRC = 0.
       OVERLAY value+moff WITH tmp.
    ENDIF.
    The find looks for the last alphanumeric char and 2 spaces after it meaning the last alphanumeric char in the string.
    Thanks to all, i will reward as fairly as possible.

  • How to move 5.00-  to a character field.

    hi,
    I want to move the value 5.00- to a character field. when i use
    move i_in-value to char1.  (i_in-value = 5.00-)
    it is moving only 5.0 , i want the whole thing to be moved on to char1.
    can anyone help me on this.
    Thanks,
    Rose.

    Hi,
    The example includes an example of converting this floating-point decimal into a character field.
    U want to move the decimal to char so why dont u try like this. First convert the decimal to character type.
    By using UNIT_CONVERSION_SIMPLe and then move it to the destination.
    data:
    floatout like qmih-auszt,
    floatp type p decimals 0,
    printhr(10).
    CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
    INPUT = qmih-auszt
    UNIT_IN = 'S'
    UNIT_OUT = 'H'
    IMPORTING
    OUTPUT = floatout
    EXCEPTIONS
    CONVERSION_NOT_FOUND = 1
    DIVISION_BY_ZERO = 2
    INPUT_INVALID = 3
    OUTPUT_INVALID = 4
    OVERFLOW = 5
    TYPE_INVALID = 6
    UNITS_MISSING = 7
    UNIT_IN_NOT_FOUND = 8
    UNIT_OUT_NOT_FOUND = 9
    OTHERS = 10.
    move floatout to floatp.
    move floatp to printhr.
    Regards.

  • Character Field as Number, Need commas?

    I move a quantity to a character field for a form display output. I left justify the character by shift character field left deleting leading spaces. This way it formats perfectly in the column on my report/form.
    Is there any easy syntaxfunction module, etc.,  that will take char field 1000.0 and put inn a comma 1,000.0?
    I don't want the value to shift back to the right (right-justify).
         Thank-You
    Edited by: TMM on Jan 30, 2009 11:30 AM

    Hi,
    Ok..Please check this..
    * Input character.
    DATA: v_input   TYPE char20 VALUE '1000.0',
          v_output  TYPE char20,
          v_num     TYPE p DECIMALS 1.
    * Move it to numeric variable.
    v_num = v_input.
    * Use the write statement to add the thousands separator.
    WRITE v_num TO v_output.
    * Make sure in the user settings the decimal notation is 1,234,567.89
    * otherwise use this code.
    SET COUNTRY 'US'.
    WRITE v_num TO v_output.
    SET COUNTRY space.
    * Remove the leading spaze.
    SHIFT v_output LEFT DELETING LEADING space.
    * Display
    WRITE:/ v_output.
    Thanks
    Naren

  • How to sort a character field with numbers and letters on the end

    I have an internal table with character field which has data like this after I sort it.  This is not what I expect from the sort.:
    13A
    15A
    29A
    30A
    31A
    33A
    123A
    125
    62 
    76 
    94A
    I expect this, which is sorted number first, then alpha.  Any ideas how to get this sort?:
    13A
    15A
    29A
    30A
    31A
    33A
    62 
    76 
    94A
    123A
    125

    Thanks for the suggestions.  After reading the suggestions and reviewing some other post threads, here's what I did to get the sort to work:
    Add a dash - to the end of any record that did not have an alphabet character at the end.  This way, all records have at least one non-numeric character at the end.  Then I overlayed zeros  '0000000'  over each record.  Then I sorted the table.  Afterwards, I removed the dashes and zeros.
    The long way around, but it worked for me.  Since the internal table is processed in memory, it doesn't add much overhead to the run time.

Maybe you are looking for