<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ALV: Filter Dates in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-filter-dates/m-p/1870013#M366406</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I use edit mast so that the output will be like 07.01.2007.&lt;/P&gt;&lt;P&gt;The data type is like sy-datum.&lt;/P&gt;&lt;P&gt;I use this code in the field catalog :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_field_cat-edit_mask = '==PDATE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Michal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 07 Jan 2007 08:00:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-07T08:00:03Z</dc:date>
    <item>
      <title>ALV: Filter Dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-filter-dates/m-p/1870011#M366404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use ALV report. I have a column type DATE. &lt;/P&gt;&lt;P&gt;I use edit_mask to PDATE in the field catalog.&lt;/P&gt;&lt;P&gt;The problem is that in the ALV report when I filter this column it sometimes gives an error the 'Date is invalid' and it doesn't filter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does any one know how to solve this ?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Michal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Jan 2007 07:46:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-filter-dates/m-p/1870011#M366404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-07T07:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: ALV: Filter Dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-filter-dates/m-p/1870012#M366405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;why are u using edit mask??&lt;/P&gt;&lt;P&gt;What is your date format and the data type??&lt;/P&gt;&lt;P&gt;Please give that piece of code here..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Abdul Hakim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Jan 2007 07:54:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-filter-dates/m-p/1870012#M366405</guid>
      <dc:creator>abdul_hakim</dc:creator>
      <dc:date>2007-01-07T07:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: ALV: Filter Dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-filter-dates/m-p/1870013#M366406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I use edit mast so that the output will be like 07.01.2007.&lt;/P&gt;&lt;P&gt;The data type is like sy-datum.&lt;/P&gt;&lt;P&gt;I use this code in the field catalog :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; wa_field_cat-edit_mask = '==PDATE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Michal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Jan 2007 08:00:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-filter-dates/m-p/1870013#M366406</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-07T08:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: ALV: Filter Dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-filter-dates/m-p/1870014#M366407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Michal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using MASK_EDIT try to set the required conversion exit (field &amp;lt;b&amp;gt;CONVEXIT&amp;lt;/b&amp;gt;). In your case I would expect that no conversion exit at all is required.&lt;/P&gt;&lt;P&gt;In the following sample report set parameter P_CONVEX = 'SDATE', 'IDATE' or space (gives different results on our ECC 5.0 system). Please note that parameter I_BYPASSING_BUFFER &amp;lt;b&amp;gt;= 'X'&amp;lt;/b&amp;gt; (function module LVC_FIELDCATALOG_MERGE) otherwise you would not see any difference when changing the parameter value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZUS_SDN_ALVGRID_EVENTS
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*

REPORT  zus_sdn_alvgrid_events.



DATA:
  gd_okcode        TYPE ui_func,
*
  gt_fcat          TYPE lvc_t_fcat,
  go_docking       TYPE REF TO cl_gui_docking_container,
  go_grid1         TYPE REF TO cl_gui_alv_grid.


DATA:
  gt_knb1          TYPE STANDARD TABLE OF knb1.


PARAMETERS:
  p_bukrs      TYPE bukrs  DEFAULT '2000'  OBLIGATORY,
*
  p_convex     TYPE convexit DEFAULT 'SDATE'. " or 'IDATE' or space




START-OF-SELECTION.

  SELECT        * FROM  knb1 INTO TABLE gt_knb1
         WHERE  bukrs  = p_bukrs.



* Create docking container
  CREATE OBJECT go_docking
    EXPORTING
      parent                      = cl_gui_container=&amp;gt;screen0
      ratio                       = 90
    EXCEPTIONS
      OTHERS                      = 6.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


* Create ALV grid
  CREATE OBJECT go_grid1
    EXPORTING
      i_parent          = go_docking
    EXCEPTIONS
      OTHERS            = 5.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.




* Build fieldcatalog and set hotspot for field KUNNR
  PERFORM build_fieldcatalog_knb1.



* Display data
  CALL METHOD go_grid1-&amp;gt;set_table_for_first_display
    CHANGING
      it_outtab       = gt_knb1
      it_fieldcatalog = gt_fcat
    EXCEPTIONS
      OTHERS          = 4.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.




* Link the docking container to the target dynpro
  CALL METHOD go_docking-&amp;gt;link
    EXPORTING
      repid                       = syst-repid
      dynnr                       = '0100'
*      CONTAINER                   =
    EXCEPTIONS
      OTHERS                      = 4.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


* ok-code field = GD_OKCODE
  CALL SCREEN '0100'.


END-OF-SELECTION.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  STATUS_0100  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'STATUS_0100'.
*  SET TITLEBAR 'xxx'.


ENDMODULE.                 " STATUS_0100  OUTPUT

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  USER_COMMAND_0100  INPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.

  CASE gd_okcode.
    WHEN 'BACK' OR
         'END'  OR
         'CANC'.
      SET SCREEN 0. LEAVE SCREEN.


    WHEN OTHERS.
  ENDCASE.

  CLEAR: gd_okcode.

ENDMODULE.                 " USER_COMMAND_0100  INPUT


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  BUILD_FIELDCATALOG_KNB1
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM build_fieldcatalog_knb1 .
* define local data
  DATA:
    ls_fcat        TYPE lvc_s_fcat.

  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
*     I_BUFFER_ACTIVE              =
      i_structure_name             = 'KNB1'
*     I_CLIENT_NEVER_DISPLAY       = 'X'
      I_BYPASSING_BUFFER           = 'X'  " important here !!!
*     I_INTERNAL_TABNAME           =
    CHANGING
      ct_fieldcat                  = gt_fcat
    EXCEPTIONS
      inconsistent_interface       = 1
      program_error                = 2
      OTHERS                       = 3.
  IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


  LOOP AT gt_fcat INTO ls_fcat
          WHERE ( fieldname = 'ERDAT' ).
    ls_fcat-convexit = p_convex.  " set conversion exit

    MODIFY gt_fcat FROM ls_fcat.
  ENDLOOP.


ENDFORM.                    " BUILD_FIELDCATALOG_KNB1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Jan 2007 23:24:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-filter-dates/m-p/1870014#M366407</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-01-07T23:24:04Z</dc:date>
    </item>
  </channel>
</rss>

