Filter in alv report

hello!
i have a weird problem in alv report with the filter function.
for example the field serial like viqmel-serial, if it contains the value for example 1234 the filter want work. if it contains the value N16 the filter will work.
i cant understand what might be the problem.
another information that concerns this field is that the ls_fieldcat-inttype is 'C'  and that the intlen eq ' '.
thanks
yifat

I think your problem is with internal/external format.  The reason that N16 works, is because in the database it is  stored as N16.  The reason why 1234 doesn't work, is because it is stored in the database as 000000000000001234.   I suggest that you make sure that you filter includes the internal format.   You could use a function module to convert it.
<b>
CONVERSION_EXIT_ALPHA_INPUT
</b>
Regards,
Rich Heilman

Similar Messages

  • How to filter standard ALV report with custom UI element?

    Hello Expert,
    I got a requirement to filter standard ALV report based on the custom UI element (which is created in the screen before displaying the ALV report). Upon entering the values in the Custom field, the ALV report is displayed accordingly.
    Any ideas how to approach it?
    Thanks,
    Mohammed

    Hi,
    Okay, let me explain the steps in detail
    Let us say you have alv table with 10 records and alv table is shown first time with all 10 records
    Create an internal table in component controller's attribute GT_ORIGINAL_DATA and save all 10 records into this table first time
    Now, user enters value in FILTER_MATNR field 123 and press apply_filter button or press enter key
    Read the value of field filter_matnr and get the only matching records from global internal table GT_ORIGINAL_DATA into local internal table as below
              data lv_matnr type matnr.
              data lt_data   like wd_comp_controller->gt_original_data.
                   " read the value from context attribute of filter_matnr
                        lv_matnr = ???
                   " copy all data into local table
                        lt_data[] = wd_comp_controller->gt_original_data.
                   "delete the records which does not match
                     delete lt_data where matnr NP lv_matnr.
    Now, bind the data lt_data to context node of alv table
    Hope this helps you.
    Regards,
    Rama

  • Set Filter in ALV report, blank screen returned

    I have a standard ALV report (uses REUSE_ALV_GRID_DISPLAY).  The user has to be able to filter the results based on entries from certain columns.
    When I try to filter any columns other than a column with a date a blank screen is returned.
    This filtering problem only exists with the Single value field. I can filter the results in the "select ranges", "exclude values" and "exclude ranges" without any problems.
    Any suggestions?
    Edited by: Damien Crowe on Jul 6, 2009 5:09 PM
    Set the fieldcatalog-edit_maskto "==ALPHA".
    Edited by: Damien Crowe on Jul 14, 2009 5:35 PM

    what was the solution to this problem?
    Thanks

  • In ALV Report Filter selection should be case sensitive

    Dear All,
    since one field is case sensitive in database table , i have to fetch that in alv report , but when i am applying  filter on that field its is simply fetching data with case description.  if its in caps it should fetch caps data but in   smaal case report showing no data
    Regards,
    Pankaj Vashista

    Hi,
    All text datas are case sensitive.
    To make it work perfectly You have to Use the Keyword translate to Upper Case than display
    Now filter can work.
    Without Transalation to Upper Case filter will not work.
    Regards
    Arbind

  • Filter not working in ALV Report....

    Hi All,
    I have developed an ALV Report using REUSE_ALV_GRID_DISPLAY.
    Everything is working perfectly except Filtering...
    When i enter data for filtering, the ALV list will become empty. Then if i choose to delete the entry made in filter window, the filter input shows only first 4 digits of the entered value.......If i delete that value, again the data will be displayed in the ALV Screen.....
    All other standard Functions like sort, export to excel sheet are working fine...
    What might be the reason for this bug..?????
    Please Help me...
    Regards
    Pavan

    Thanks Prasanth,
    This is the code...
    It has been observed that few columns can be filtered...Like date, Quantity and few more...
    But there is a column for Production Order number, which can not be filtered...
    What might be the reason..?????
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program     = v_repid
            i_callback_top_of_page = 'TOP_OF_PAGE'
            is_layout              = gs_layout
            it_fieldcat            = gt_fieldcat[]
            it_sort                = t_sort[]
            i_default              = c_x
            is_variant             = v_variant
            i_save                 = c_a
            it_events              = t_events
            is_print               = wa_prntparams
          TABLES
            t_outtab               = i_aufk
          EXCEPTIONS
            program_error          = 1
            OTHERS                 = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

  • Filter criteria in ALV report not working

    Hi,
    In ALV report , when i click on filter button , it does not filter the report according to the filtered criteria. this happens in the cases where the selection criteria is a lengthy field. when i debug after the filter criteria it goes into standard function.
    i am using REUSE_ALV_GRID_DISPLAY
    is there any way in which i can correct this?
    thanks,
    Amit
    null

    chk this useful thread
    Re: ALV problem (with filter use)

  • Filter Function problems on ALV report. [Resolved]

    Hi,
    I developed an ALV report by using function as below:
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
             EXPORTING
                  I_CALLBACK_PROGRAM = G_REPID
    *            I_CALLBACK_PF_STATUS_SET = status_set
    *            I_CALLBACK_USER_COMMAND  = USER_COMMAND
                  I_STRUCTURE_NAME = 'T_BSIK'
                  IS_LAYOUT        = GS_LAYOUT
                  IT_FIELDCAT      = GT_FIELDCAT[]
             TABLES
                  T_OUTTAB    = TAB_BSIK.
    And this ALV custom report is referenced from standard function FBL5N.
    After i completed this report, i made an comparision of FBL5N and my custom report.
    When I apply the filter function, for example, on the document type, I cannot input 2 characters in the document type field under the filter function. The field length is only 1 character. Similar case results on the field document date.
    While the standard function FBL5N works very nice.
    What should i do to make the filter function of my own ALV report as the same as the standard function FBL5N do?
    Thanks in advance.
    Lala
    Message was edited by:
            Hoo lala

    Oh, i found where the problem is...
    add below 2 statements, then the question is resolved.
      LS_FIELDCAT-ref_fieldname = ****
      LS_FIELDCAT-ref_tabname = ***
    FORM FIELDCAT_INIT tables RT_FIELDCAT.
    CLEAR LS_FIELDCAT.
      LS_FIELDCAT-COL_POS   =  3.
      LS_FIELDCAT-FIELDNAME = 'BLART'.
      LS_FIELDCAT-TABNAME   = 'TAB_BSIK'.
      LS_FIELDCAT-SELTEXT_L = 'Document Type'.
      LS_FIELDCAT-ref_fieldname = 'BLART'.
      LS_FIELDCAT-ref_tabname = 'BSIK'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    endform.
    Fine now.
    Lala

  • Short dump while filtering an ALV report

    Hi ,
    I have an ALV report which gives me short dump when I filter any of the 'P' type field. I tried to implement sap note 839839 in debug mode but in vain. Should I implement this note first and then check the chnage?
    the short dump error "..........
    Error in ASSIGN: Memory protection error.                                                                               
    The current program "SAPLSSEL " uses the ASSIGN statement.              
    However, the offset of the segment (20208) plus the length (69)         
    is greater than the length of the segment (20264).                      
    This is not allowed.                                                                               
    If the error is in one of your own ABAP programs or an SAP program that          
    you have modified, try to correct it.                                            
    Reduce the offset and/or length that you are using.                                                                               
    If the error occurred in a non-modified SAP program, you may be                  
    able to find a solution in the SAP note system.                                  
    If you have access to the note system yourself, use the following                
    search criteria:                                                                               
    "ASSIGN_OFFSET+LENGTH_TOOLARGE"                                   
    "SAPLSSEL " or "LSSELFDI "                                        
    "FILL_DYN_FROM_FIELD_SEL"               ........."
    I appreciate ur inputs.
    thanks in advance,
    regards,
    shan

    Hi Guys,
    I found the answer. I had to define all P type fields with eaxact length of 16 . Its working fine.
    thanks for all your help.
    regards,
    shan

  • Filtering programatically in alv report

    please let me know is it posible to filering in alv report.please respond immediately....

    Hi anil,
    here a short extract with 2 Filter-Parameters as i use:
    DATA:  FILTER_1   TYPE SLIS_T_FILTER_ALV.
    DATA: BEGIN OF ITEM_ALL  OCCURS 0,
          KUNNR  LIKE KNA1-KUNNR,
          VBELN  LIKE VBAP-VBELN,
          POSNR  LIKE VBAP-POSNR,
          MATNR  LIKE VBAP-MATNR,
          MATKL  LIKE MARA-MATKL,
          MAKTX  LIKE MAKT-MAKTX,
          KWMENG LIKE VBAP-KWMENG, "Menge Auftrag
          VRKME  LIKE VBAP-VRKME,
          RFMNGJ LIKE VBFA-RFMNG,  "Menge Lieferung
          RFMNGR LIKE VBFA-RFMNG,  "Menge Warenbewegung
          RFMNGM LIKE VBFA-RFMNG,  "Menge Faktura
          END   OF ITEM_ALL.
    Filter für detail setzen
      WA_FILTER-TABNAME   = 'ITEM_ALL'.
      WA_FILTER-FIELDNAME = 'KUNNR'.
      WA_FILTER-SIGN0     = 'I'.
      WA_FILTER-OPTIO     = 'BT'.
      WA_FILTER-VALUF_INT = KUNNR. "From Kunnr
      WA_FILTER-VALUT_INT = KUNNR. "TO Kunnr
      APPEND WA_FILTER TO FILTER_1.
      WA_FILTER-TABNAME   = 'ITEM_ALL'.
      WA_FILTER-FIELDNAME = 'MATNR'.
      WA_FILTER-SIGN0     = 'I'.
      WA_FILTER-OPTIO     = 'BT'.
      WA_FILTER-VALUF_INT = MATNR. "From Matnr
      WA_FILTER-VALUT_INT = MATNR. "To Matnr
      APPEND WA_FILTER TO FILTER_1.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM      = PROGNAME
                I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
                IT_FIELDCAT             = FIELDCAT_1
    IT_FILTER = FILTER_1
                IT_EVENTS               = EVENTS
                IT_EVENT_EXIT           = EVENT_EXIT
                I_SCREEN_START_COLUMN   = 20
                I_SCREEN_START_LINE     = 05
                I_SCREEN_END_COLUMN     = 100
                I_SCREEN_END_LINE       = 30
           TABLES
                T_OUTTAB                = ITEM_ALL
           EXCEPTIONS
                PROGRAM_ERROR           = 1
                OTHERS                  = 2.
    Regards, Dieter

  • The filtering , sorting , totaling action on ALV report is lost

    Hi ,
    I have an Interactive ALV report which i sort it , filter it and total it before I enter into my Z customised screen, from my Z cusomised screen when I come back to the ALV report, the report is no more sorted, no more filtered and no more totaled.
    Please help me on this its a bit urgent.

    *& Report  ZALV_SUM
    REPORT  ZNNR_ALV_SUM.
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_vbap,
      vbeln TYPE vbap-vbeln,
      matnr TYPE vbap-matnr,
      netwr TYPE vbap-netwr,
      waerk TYPE vbap-waerk,
    END OF t_vbap.
    DATA: it_vbap TYPE STANDARD TABLE OF t_vbap INITIAL SIZE 0,
          wa_vbap TYPE t_vbap.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
      fieldcatalog-fieldname   = 'VBELN'.
      fieldcatalog-seltext_m   = 'Sales Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETWR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.        "Display column total
      fieldcatalog-cfieldname     = 'WAERK'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'WAERK'.
      fieldcatalog-seltext_m   = 'Price Curr'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
                                            "click(press f2)
    gd_layout-zebra             = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
               i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
               i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_special_groups       = gd_tabgroup
               IT_EVENTS                = GT_XEVENTS
                i_save                  = 'X'
               is_variant              = z_template
           tables
                t_outtab                = it_vbap
           exceptions
                program_error           = 1
                others                  = 2.
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select vbeln matnr netwr waerk
    up to 50 rows
      from vbap
      into table it_vbap.
    endform.                    " DATA_RETRIEVAL

  • What's the coolest, slickest way to present multiple ALV reports?

    Greetings and good day, everyone.
    Okay, I'm working on an update program, and the users have identified at least three different reports they would like coming out of this thing.  One report is a list of transactions that fail internal logic checking, the second report is a list of transactions that pass internal logic checking but fail to update via a BAPI, and a third report is a list of transactions that pass checks and process correctly (i.e. update the database) via the BAPI.
    At first, still being a newbie, I was wondering how I was going to create multiple ALV reports.  I know I could do this using the WRITE statement, writing each report one after the other, but they have asked for the ALV report so they can do all the ad-hoc manipulating, sorting, etc. that ALV provides.
    I came up with these options:
    1.  Instead of filling my single screen with the container control for an ALV report, as I usually do, this time I could put three containers on the screen.  However, I know that cramps space, and I don't know if they'll be able to adjust or move things around other than scrolling.
    2.  Display a single ALV report on the screen, but have buttons somehow on the top that somehow take the user to other screens for the other reports.
    3.  First give the user a screen with all the buttons for the reports.  They choose one, and the ALV report displays.  They can click back to return to this screen, then choose a different report.
    Nobody else in the office has done anything like this yet using the ALV, so I've got a chance to break some new ground internally and do something slick.  Which option is best, and if so, do you have examples or general guidelines of how I do it?  I've not had dialog programming, although I do understand the concepts from VB/Delphi experience over 10 years ago.  I think I lean toward option 2, but I figured this couldn't be new ground in the SAP world and surely someone's done exactly this sort of thing.
    Please help!  ALL helpful responses, as always, are awarded points!  Thanks so much!
    Dave

    Dave,
    These are all good suggestions.  I would just remember to keep in mind when designing your report two different things.
    1.  Can your program be run in foreground or background?  If it has to be run in background due to data volumes you will lose all interactive capabilities of ALV.  You might also not be able to do three different ALVs on the screen in background.
    2.  I am not sure if I understand your option 3 but if you are talking about the user selecting the options before the load the data, they might have to attempt to load the data multiple times to get all of the report.
    My recommendation ( I think somebody already mentioned this) is to have a single ALV with a column on your report that the user can then sort or filter by.  This way you are not limited to a program that has to be run in foreground. 
    Chris

  • How can I add a custom title to multiple ALV reports selected by layout?

    Greetings and good day, everyone!
    Within the past week or so, I posted a question asking the best way to create a program that would generate multiple ALV reports.  I got some great ideas, and I've actually coded up a few simple demos based on your feedback -- thank you!
    Here's the issue I'm running into:  Many of you suggested that I put all report records into one table, and create a field that I could use to filter on later to determine which fields I want to display for the report.  For example, if I have 3 different reports, I put all the fields for all 3 reports into a table.  I then add a "report key" field.  As I put records into the report table for report 1, I code "01" into the "report key" field.  I do the same for reports 2 and 3, assigning each a "report key" of "02" and "03", respectively.
    I then set up layouts in the ALV for each of the three reports, using the filter option to only pull records with the "report key" value for that particular report.  This all works wonderfully!  However, I seem to have lost the ability to show a custom title for each layout.  I can create a generic TITLEBAR (like "Reporting Center") but I don't know how to reset the grid's title when a layout is selected.  I was hoping that SAP might use the layout description as the title on each page, but it doesn't -- it uses the TITLEBAR text.
    Any ideas?  I think this might be the best way to program multiple ALV reports, but if I can't display the right report title for a particular layout, I'll probably have to go back to my other alternative of putting each report in its own container/screen, and having a button to access each report from the application toolbar.
    Thanks,

    Srikanth,
    I don't have any Selection Screen radio buttons for the user to select a particular report; in my case, they specify some needed criteria by the program in the Selection Screen, the program goes off and does a fair bit of processing/updating, and then displays the ALV reports when finished.  They don't want to choose one particular report to view ahead of time; they want to have all 3 (in my case) there to see what processed correctly, what was eligible to process but kicked out with errors, and what failed some matching checks done up front (this layout includes additional fields from the input file so they can see what didn't match up against R/3).
    So, while I do like the code example you presented, I don't think it's going to help me in my case.

  • ALV Report in PP module

    Hi everyone.
    I need to develop an ALV report. Select options are -
    AFPO-DWERK (plant) (Obligatory)
    AFPO-AUFNR (Prd Ord Num) (optional)
    AFKO-STLBEZ (Mat Nr) (optional)
    S022-ARBPL (Work Center) (optional)
    I have extracted all open production orders from AUFK and placed them in an internal table.
    Now how can I filter this list to the select options.
    Please help me.
    Related Tables  - AUFK, AFPO, AFKO.
    Thanks,
    Lakshmi

    just go to www.alvrobot.com.ar
    and the page will generate the code for you....

  • Download ALV report with layout to application server

    Hi Gurus,
    I have a problem as follows:
    I have one ALV Grid report. This report is very time consuming.
    That is why, user wants this to be run in background every night and in the morning when user comes to the office that ALV report should be on user's drive in excel format.
    However, it should run with one specific variant and that variant should be dynamically populated. (I have handled this part)
    It should also apply specific layout that has many filtering conditions.
    As I can not download ALV to excel in background, I decided to download it to the Application server.
    My problem is that when run in background, in spool ALV report shows o/p with proper filter conditions that is 5 out of 20 records.
    But, when I write this report o/p to Application server, it writes all the records in there, i.e., all 20 records. It does not take into account all the filters. [:(]
    I also tried downloading spool to excel, but o/p is not neatly formatted. All columns are fying here and there.
    Any suggestion, how can I write ALV o/p to Application server with layout into consideration?
    P.S. I have searched forum for this type of query, but no apt responses.
    Thanks

    did u downloaded the report with standard option provided in the alv and checked the data? that is populating all 20 records?. if so then use coding for achieving the standard one
    at the end of selection do like this ..
    SET USER-COMMAND ' %PC' .
    and in the user-command use like this..
    case sy-ucomm.
    when '  %PC'.
    give the file name ..
    do processing ..
    endcase.

  • How to disable 'set filter' in alv list display

    Hi Friends,
    I am working on alv report and I came across a requirement that I need to disable the 'set filter' to restrict the user from filtering records in output.
    please help on this.
    thanks in advance.

    HI
    check these sample codes
    Here are some code snippets:
    FORM output_report.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = 'ZRRRMPROJSTAT'
    is_layout = gs_layout
    it_fieldcat = gt_fieldcat
    it_sort = gt_sort
    i_save = 'A'
    it_events = gt_events
    TABLES
    t_outtab = i_project
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    ENDFORM. " output_report
    FORM build_fieldcat.
    DATA: s_fieldcat TYPE slis_fieldcat_alv.
    DATA: l_col_count like s_fieldcat-col_pos.
    l_col_count = 1.
    CLEAR s_fieldcat.
    s_fieldcat-col_pos = l_col_count.
    l_col_count = l_col_count + 1.
    s_fieldcat-tabname = i_project.
    s_fieldcat-fieldname = 'PSPID'.
    s_fieldcat-datatype = 'CHAR'.
    s_fieldcat-outputlen = '10'.
    s_fieldcat-seltext_l = 'Project Number'.
    s_fieldcat-seltext_m = 'Project Number'.
    s_fieldcat-seltext_s = 'Project Number'.
    s_fieldcat-key = 'X'.
    s_fieldcat-fix_column = 'X'.
    s_fieldcat-just = 'C'.
    s_fieldcat-no_zero = 'X'.
    APPEND s_fieldcat TO gt_fieldcat.
    * and so on....
    ENDFORM
    FORM sort_layout.
    DATA: ls_sort TYPE slis_sortinfo_alv.
    REFRESH gt_sort.
    CLEAR ls_sort.
    ls_sort-spos = '1'.
    ls_sort-tabname = 'i_project'.
    ls_sort-fieldname = 'PSPID'.
    APPEND ls_sort TO gt_sort.
    CLEAR ls_sort.
    ls_sort-spos = '2'.
    ls_sort-tabname = 'i_project'.
    ls_sort-fieldname = 'POSID'.
    APPEND ls_sort TO gt_sort.
    ENDFORM. " sort_layout
    FORM build_layout.
    CLEAR gs_layout.
    * gs_layout-totals_before_items = 'X'.
    gs_layout-zebra = 'X'.
    gs_layout-numc_sum = 'X'.
    gs_layout-get_selinfos = 'X'.
    gs_layout-box_tabname = 'X'.
    gs_layout-info_fieldname = 'COLOR'.
    ENDFORM. "
    Reward alll helpfull answers
    Regards
    Pavan

Maybe you are looking for