Skip to Content
-1

se16 problem when searching in char field

Hi,

I have a custom table and one of the fields is defined as CHAR Length 10. If I enter with SE16 and try to search after this field like "not equal to blank" it finds me the records. If I search inserting the value 10 in this field it doesn't finds me any record even if there are records with value 10 for this field. If i search using 10* it finds me the records with value 10 in it. Why doesn't finds me anything when I search only with value 10?

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

8 Answers

  • Best Answer
    May 12, 2017 at 07:15 AM

    Ok.

    If you programatically assign a value to a field with a conversion exit (and it would have helped for you to mention the domain as well) then it will be entered into the field as it is assigned.

    eg

    w_vbeln = '10'

    Will be '10', not '00000000000010'.

    When you assign a value to a field that has a conversion exit ( and you must check the domain but you get to know the majority in the end) you must use a conversion exit.

    So VBELN has a conversion exit 'ALPHA', Conversion exits come in two halfs - _INPUT and _OUTPUT.

    When you are populating a table field to save in the database you would use:

    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = l_Vbeln
      IMPORTING
        OUTPUT        = ls_Vbak-Vbeln.

    Or, you could assign the value to a variable of the right type and WRITE it to another field.

    This is especially important when you start using WBS Elements etc since these have a full text description which is converted to an 8 character number.

    Conversion exits are called implicitly with SELECT-OPTIONS, PARAMETERS and WRITE statements.

    Rich

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 11, 2017 at 12:28 PM

    Hi ,

    Use conversion exit ALPHA in the domain of that field. This will solve your problem.

    Thanks and Regards,

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 11, 2017 at 08:23 AM

    Maybe it was saved as 10XXXXXXXX【X=FULL BLANK SPACE】.

    You can try to see the detail content in Tr-CODE se16n. Which have the detail technical contents of database.

    Add comment
    10|10000 characters needed characters exceeded

  • May 11, 2017 at 01:29 PM

    Why not looking at the exact value of the table field and the value of the selection field? To do it, add a break point at statement "SELECT" (press F9 key in the debugger), and display the exact values via the debugger. You should then understand why they are different.

    Add comment
    10|10000 characters needed characters exceeded

  • May 11, 2017 at 01:51 PM

    Hi.

    Kindly remove the conversion exit which is mapped in domain. Conversion routine ALPHA accepts the space in the table.

    Regards

    Rajkumar Narasimman

    Add comment
    10|10000 characters needed characters exceeded

  • May 11, 2017 at 02:12 PM

    The OP states that it is a CHAR 10 field. Does not state that it has a domain etc (so me believing that he knows what he was talking about deleted my comment about conversion exits....)

    Add comment
    10|10000 characters needed characters exceeded

  • May 11, 2017 at 02:28 PM

    More info: The domain used for this field is VBELN

    Add comment
    10|10000 characters needed characters exceeded

    • So, this one has ALPHA conversion exit. It means that when you enter the value "10" in the SE16 screen, SE16 will look for value "0000000010" in the table. But in the database table, you may theoritically, although abnormal, have values "10", "010", "0010", "00010", etc. Though, they are all displayed "10" because of the ALPHA conversion exit. You might even have in the database table the value "10" with leading blanks, which are not displayed if you're using the ALV grid display mode.

  • May 12, 2017 at 06:19 AM

    Using se16, if I edit the table, delete the value 10, save, and write again the value 10, then if i display the records (using se16) this edited record is displayed like 0000000010 (I think because of the domain VBELN). So the problem is when the value is written in that field? Should be written in another way? I don't understand.

    Add comment
    10|10000 characters needed characters exceeded