<?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 Gride display for this program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-gride-display-for-this-program/m-p/2938721#M692720</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;well is IT_CDHDR your final output internal table?? (i.e. does it hold the final values that you want to display)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if so then u can easily call the following function maodule inorder to reuse alv grid... with this you &amp;lt;b&amp;gt;dont&amp;lt;/b&amp;gt; need to create any object or any unnecessary things.. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           i_callback_program       = &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           is_layout                      = &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           it_fieldcat                     = &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;            t_outtab                 = IT_CDHDR.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!!&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sagar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Oct 2007 05:07:06 GMT</pubDate>
    <dc:creator>sagarmehta</dc:creator>
    <dc:date>2007-10-22T05:07:06Z</dc:date>
    <item>
      <title>ALV Gride display for this program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-gride-display-for-this-program/m-p/2938717#M692716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the report for document changes for 2 tables CDPOS, CDHDR &lt;/P&gt;&lt;P&gt;I need some modification for how to add the ranges &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plant from ________ to ___________&lt;/P&gt;&lt;P&gt;Udate from __________ to ___________-&lt;/P&gt;&lt;P&gt;Document No from ________ to __________&lt;/P&gt;&lt;P&gt;Change date from ____________ to _____________&lt;/P&gt;&lt;P&gt;username by __________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i don't enter anything the it should display all the records esle the ranges defined.&lt;/P&gt;&lt;P&gt;I even want to add plant code from and to but not getting idea from which table it has to be taken? I want this to be display in ALV Gride  table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please could anyone help me in modification please urgent.........v urgent&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZCHGDOC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: CDHDR,&lt;/P&gt;&lt;P&gt;CDPOS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab occurs 0,&lt;/P&gt;&lt;P&gt;UDATE TYPE sy-datum,&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS udate for sy-datum .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK DOCUMENT WITH FRAME TITLE TEXT-701.&lt;/P&gt;&lt;P&gt;PARAMETER: CHANGENR LIKE CDHDR-CHANGENR.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK DOCUMENT.&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF IT_CDHDR OCCURS 0,&lt;/P&gt;&lt;P&gt;OBJECTCLAS LIKE CDHDR-OBJECTCLAS,&lt;/P&gt;&lt;P&gt;OBJECTID LIKE CDHDR-OBJECTID,&lt;/P&gt;&lt;P&gt;CHANGENR LIKE CDHDR-CHANGENR,&lt;/P&gt;&lt;P&gt;USERNAME LIKE CDHDR-USERNAME,&lt;/P&gt;&lt;P&gt;UDATE LIKE CDHDR-UDATE,&lt;/P&gt;&lt;P&gt;UTIME LIKE CDHDR-UTIME,&lt;/P&gt;&lt;P&gt;VALUE_NEW LIKE CDPOS-VALUE_NEW,&lt;/P&gt;&lt;P&gt;VALUE_OLD LIKE CDPOS-VALUE_OLD,&lt;/P&gt;&lt;P&gt;END OF IT_CDHDR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: WA LIKE LINE OF IT_CDHDR.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATA: WA LIKE LINE OF IT_CDPOS.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF IT_CDPOS OCCURS 0,&lt;/P&gt;&lt;P&gt;OBJECTCLAS LIKE CDHDR-OBJECTCLAS,&lt;/P&gt;&lt;P&gt;OBJECTID LIKE CDHDR-OBJECTID,&lt;/P&gt;&lt;P&gt;CHANGENR LIKE CDHDR-CHANGENR,&lt;/P&gt;&lt;P&gt;TABNAME LIKE CDPOS-TABNAME,&lt;/P&gt;&lt;P&gt;FNAME LIKE CDPOS-FNAME,&lt;/P&gt;&lt;P&gt;VALUE_NEW LIKE CDPOS-VALUE_NEW,&lt;/P&gt;&lt;P&gt;VALUE_OLD LIKE CDPOS-VALUE_OLD,&lt;/P&gt;&lt;P&gt;END OF IT_CDPOS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT OBJECTCLAS&lt;/P&gt;&lt;P&gt;OBJECTID&lt;/P&gt;&lt;P&gt;CHANGENR&lt;/P&gt;&lt;P&gt;USERNAME&lt;/P&gt;&lt;P&gt;UDATE&lt;/P&gt;&lt;P&gt;UTIME INTO CORRESPONDING FIELDS OF TABLE IT_CDHDR&lt;/P&gt;&lt;P&gt;FROM CDHDR&lt;/P&gt;&lt;P&gt;WHERE OBJECTCLAS = 'VERKBELEG'. &lt;/P&gt;&lt;P&gt;IF IT_CDHDR[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;SELECT OBJECTCLAS&lt;/P&gt;&lt;P&gt;OBJECTID&lt;/P&gt;&lt;P&gt;CHANGENR&lt;/P&gt;&lt;P&gt;VALUE_NEW&lt;/P&gt;&lt;P&gt;VALUE_OLD&lt;/P&gt;&lt;P&gt;FNAME&lt;/P&gt;&lt;P&gt;TABNAME&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE IT_CDPOS FROM CDPOS&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN IT_CDHDR&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;OBJECTCLAS = IT_CDHDR-OBJECTCLAS&lt;/P&gt;&lt;P&gt;AND OBJECTID = IT_CDHDR-OBJECTID&lt;/P&gt;&lt;P&gt;AND CHANGENR = IT_CDHDR-CHANGENR.&lt;/P&gt;&lt;P&gt;SORT IT_CDPOS BY OBJECTCLAS OBJECTID CHANGENR.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add tables CDPOS DATA TO CDHDR.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: INDEX TYPE i.&lt;/P&gt;&lt;P&gt;LOOP AT IT_CDHDR.&lt;/P&gt;&lt;P&gt;INDEX = SY-TABIX.&lt;/P&gt;&lt;P&gt;READ TABLE IT_CDPOS WITH KEY OBJECTCLAS = IT_CDHDR-OBJECTCLAS&lt;/P&gt;&lt;P&gt;OBJECTID = IT_CDHDR-OBJECTID&lt;/P&gt;&lt;P&gt;CHANGENR = IT_CDHDR-CHANGENR BINARY SEARCH.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;IT_CDHDR-VALUE_NEW = IT_CDPOS-VALUE_NEW.&lt;/P&gt;&lt;P&gt;IT_CDHDR-VALUE_OLD = IT_CDPOS-VALUE_OLD.&lt;/P&gt;&lt;P&gt;MODIFY IT_CDHDR INDEX index TRANSPORTING value_new value_old.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_CDHDR INTO WA.&lt;/P&gt;&lt;P&gt;WRITE: WA-OBJECTID.&lt;/P&gt;&lt;P&gt;WRITE: / WA-UDATE,WA-CHANGENR,WA-USERNAME,WA-VALUE_NEW,WA-VALUE_OLD.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WRITE: / WA-CHANGENR,WA-VALUE_NEW,WA-VALUE_OLD.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 03:18:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-gride-display-for-this-program/m-p/2938717#M692716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-22T03:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Gride display for this program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-gride-display-for-this-program/m-p/2938718#M692717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this sample program to display data using ALV Grid&lt;/P&gt;&lt;P&gt;Simply copy &amp;amp; execute this program in your system.&lt;/P&gt;&lt;P&gt;You will know how to develop a ALV Grid.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPE-POOLS: slis.

DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
DATA: s_layout       TYPE slis_layout_alv.

DATA: BEGIN OF itab OCCURS 0,
      icon  TYPE icon-id,
      vbeln TYPE vbeln,
      kunnr TYPE kunnr,
      erdat TYPE erdat,
      box TYPE c,
END OF itab.

DATA: v_repid        TYPE syrepid.

START-OF-SELECTION.

* Get the data.
  SELECT vbeln kunnr erdat UP TO 100 ROWS
         FROM vbak
         INTO CORRESPONDING FIELDS OF TABLE itab.

  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE s208(00) WITH 'No data found'.
    LEAVE LIST-PROCESSING.
  ENDIF.

* Modify the record with red light.
  itab-icon = '@0A@'.

  MODIFY itab TRANSPORTING icon WHERE NOT vbeln IS initial.

  v_repid = sy-repid.

* Get the field catalog.
  CLEAR: s_fieldcatalog.
  s_fieldcatalog-col_pos = '1'.
  s_fieldcatalog-fieldname = 'ICON'.
  s_fieldcatalog-tabname   = 'ITAB'.
  s_fieldcatalog-seltext_l = 'Status'.
  s_fieldcatalog-icon      = 'X'.
  APPEND s_fieldcatalog TO t_fieldcatalog.


  CLEAR: s_fieldcatalog.
  s_fieldcatalog-col_pos = '2'.
  s_fieldcatalog-fieldname = 'VBELN'.
  s_fieldcatalog-tabname   = 'ITAB'.
  s_fieldcatalog-rollname  = 'VBELN'.
  APPEND s_fieldcatalog TO t_fieldcatalog.

  CLEAR: s_fieldcatalog.
  s_fieldcatalog-col_pos = '3'.
  s_fieldcatalog-fieldname = 'KUNNR'.
  s_fieldcatalog-tabname   = 'ITAB'.
  s_fieldcatalog-rollname  = 'KUNNR'.
  APPEND s_fieldcatalog TO t_fieldcatalog.

  CLEAR: s_fieldcatalog.
  s_fieldcatalog-col_pos = '4'.
  s_fieldcatalog-fieldname = 'ERDAT'.
  s_fieldcatalog-tabname   = 'ITAB'.
  s_fieldcatalog-rollname  = 'ERDAT'.
  APPEND s_fieldcatalog TO t_fieldcatalog.

* Set the layout.
  s_layout-box_fieldname = 'BOX'.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            i_callback_program       = v_repid
            is_layout                = s_layout
            it_fieldcat              = t_fieldcatalog[]
       TABLES
            t_outtab                 = itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 04:29:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-gride-display-for-this-program/m-p/2938718#M692717</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2007-10-22T04:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Gride display for this program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-gride-display-for-this-program/m-p/2938719#M692718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gopi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks But how can do modification for my code and add alv gride to my above program&lt;/P&gt;&lt;P&gt;can you help please it is urgent &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Piroz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 04:36:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-gride-display-for-this-program/m-p/2938719#M692718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-22T04:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Gride display for this program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-gride-display-for-this-program/m-p/2938720#M692719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried executing the sample code which i gave.&lt;/P&gt;&lt;P&gt;Ok its like this ...&lt;/P&gt;&lt;P&gt;In you case the internal table containing the data is IT_CDHDR,in my case it is itab.&lt;/P&gt;&lt;P&gt;Now you need to fill the field catalog just as i did &lt;/P&gt;&lt;P&gt;Fieldcatalog fills in the fields that should be displayed(lets say layout of ALV output.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Get the field catalog.
  CLEAR: s_fieldcatalog.
  s_fieldcatalog-col_pos = '1'.
  s_fieldcatalog-fieldname = 'ICON'.
  s_fieldcatalog-tabname   = 'ITAB'.
  s_fieldcatalog-seltext_l = 'Status'.
  s_fieldcatalog-icon      = 'X'.
  APPEND s_fieldcatalog TO t_fieldcatalog.


  CLEAR: s_fieldcatalog.
  s_fieldcatalog-col_pos = '2'.
  s_fieldcatalog-fieldname = 'VBELN'.
  s_fieldcatalog-tabname   = 'ITAB'.
  s_fieldcatalog-rollname  = 'VBELN'.
  APPEND s_fieldcatalog TO t_fieldcatalog.

  CLEAR: s_fieldcatalog.
  s_fieldcatalog-col_pos = '3'.
  s_fieldcatalog-fieldname = 'KUNNR'.
  s_fieldcatalog-tabname   = 'ITAB'.
  s_fieldcatalog-rollname  = 'KUNNR'.
  APPEND s_fieldcatalog TO t_fieldcatalog.

  CLEAR: s_fieldcatalog.
  s_fieldcatalog-col_pos = '4'.
  s_fieldcatalog-fieldname = 'ERDAT'.
  s_fieldcatalog-tabname   = 'ITAB'.
  s_fieldcatalog-rollname  = 'ERDAT'.
  APPEND s_fieldcatalog TO t_fieldcatalog.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Instead of the fields ICON, VBELN ,KUNNR, ERDAT just give in the field names in your internal table IT_CDHDR.&lt;/P&gt;&lt;P&gt;And give in the tabname as CDHDR in Quotes 'CDHDR' and append the field catalog.&lt;/P&gt;&lt;P&gt;Now just pass the &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            i_callback_program       = v_repid " v_repid is the report name of your program.
            it_fieldcat              = t_fieldcatalog[] " fieldcatalog name
       TABLES
            t_outtab                 = IT_CDHDR." internal table containing output data&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only thing which you need to do is replace teh fields with your fields from the table IT_CDHDR.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 04:49:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-gride-display-for-this-program/m-p/2938720#M692719</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2007-10-22T04:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Gride display for this program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-gride-display-for-this-program/m-p/2938721#M692720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;well is IT_CDHDR your final output internal table?? (i.e. does it hold the final values that you want to display)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if so then u can easily call the following function maodule inorder to reuse alv grid... with this you &amp;lt;b&amp;gt;dont&amp;lt;/b&amp;gt; need to create any object or any unnecessary things.. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           i_callback_program       = &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           is_layout                      = &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           it_fieldcat                     = &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;            t_outtab                 = IT_CDHDR.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!!&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sagar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 05:07:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-gride-display-for-this-program/m-p/2938721#M692720</guid>
      <dc:creator>sagarmehta</dc:creator>
      <dc:date>2007-10-22T05:07:06Z</dc:date>
    </item>
  </channel>
</rss>

