<?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 with objects in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-with-objects/m-p/2780687#M648096</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Krish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; You need to follow these simple steps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 1). Define a screen in your program and using se51 just place a custom container object on the screen and drag it to size of the ALV display you need.&lt;/P&gt;&lt;P&gt;2). use the code below in your PBO module &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MODULE status_0901 OUTPUT.

  SET PF-STATUS c_zvxxstatus.     &amp;lt;=== what ever menu you need

  SET TITLEBAR  c_zvxxtitle.          &amp;lt;=== what ever title you need 

  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
      i_structure_name       = c_zsxx_zrpo_struc     &amp;lt;=== Structure of your internal table
      i_client_never_display = c_x
    CHANGING
      ct_fieldcat            = i_fieldcat_lvc[]
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.

  IF sy-subrc NE 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

  ENDIF.


IF ob_custom_container IS INITIAL.

    CREATE OBJECT ob_custom_container
           EXPORTING
              container_name = c_container.

    CREATE OBJECT ob_grid
           EXPORTING
             i_parent = ob_custom_container.

* make the rows zebra pattern and optimize the width of the colum
    MOVE c_x TO e_layout-zebra.

    MOVE c_x TO e_layout-cwidth_opt.

* set table for first display
    CALL METHOD ob_grid-&amp;gt;set_table_for_first_display
      EXPORTING
*        i_structure_name = c_zsxx_zrpo_struc
        is_layout        = e_layout
      CHANGING
        it_outtab        = t_orders[]
        it_fieldcatalog  = i_fieldcat_lvc
        it_sort          = t_sort[].

  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3). In the PAI module create a routine to handle the actions on the screen and menus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODULE user_command_0901 INPUT.

*  actions according to the function code of the buttons
  MOVE w_ok_code TO w_save_ok.

  CLEAR w_ok_code.

  CASE w_save_ok.

    WHEN c_exit OR c_cancel OR c_back.

      PERFORM f_do_exit.

    WHEN OTHERS.

*     do nothing
  ENDCASE.

ENDMODULE.    
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the code above its pretty simple to get a alv output using OOPS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;VJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Sep 2007 14:18:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-05T14:18:36Z</dc:date>
    <item>
      <title>ALV with objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-with-objects/m-p/2780685#M648094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , I am new to the concept of ALV with OOP ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have built an internal table to be displayed , it is required that it need to be editable at the report screen , so I will have to use oops . I have been going through the sflight examples , Since I have my own internal table what should I pass in  i_structure_name = ' ' , and if there is a simple source code to help me better understand this concept , i will really appreciate it. &lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 14:12:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-with-objects/m-p/2780685#M648094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T14:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: ALV with objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-with-objects/m-p/2780686#M648095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please also if possible post the field catalog , how it need to be filled.&lt;/P&gt;&lt;P&gt;Thankyou&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 14:13:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-with-objects/m-p/2780686#M648095</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T14:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: ALV with objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-with-objects/m-p/2780687#M648096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Krish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; You need to follow these simple steps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 1). Define a screen in your program and using se51 just place a custom container object on the screen and drag it to size of the ALV display you need.&lt;/P&gt;&lt;P&gt;2). use the code below in your PBO module &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MODULE status_0901 OUTPUT.

  SET PF-STATUS c_zvxxstatus.     &amp;lt;=== what ever menu you need

  SET TITLEBAR  c_zvxxtitle.          &amp;lt;=== what ever title you need 

  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
      i_structure_name       = c_zsxx_zrpo_struc     &amp;lt;=== Structure of your internal table
      i_client_never_display = c_x
    CHANGING
      ct_fieldcat            = i_fieldcat_lvc[]
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.

  IF sy-subrc NE 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

  ENDIF.


IF ob_custom_container IS INITIAL.

    CREATE OBJECT ob_custom_container
           EXPORTING
              container_name = c_container.

    CREATE OBJECT ob_grid
           EXPORTING
             i_parent = ob_custom_container.

* make the rows zebra pattern and optimize the width of the colum
    MOVE c_x TO e_layout-zebra.

    MOVE c_x TO e_layout-cwidth_opt.

* set table for first display
    CALL METHOD ob_grid-&amp;gt;set_table_for_first_display
      EXPORTING
*        i_structure_name = c_zsxx_zrpo_struc
        is_layout        = e_layout
      CHANGING
        it_outtab        = t_orders[]
        it_fieldcatalog  = i_fieldcat_lvc
        it_sort          = t_sort[].

  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3). In the PAI module create a routine to handle the actions on the screen and menus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODULE user_command_0901 INPUT.

*  actions according to the function code of the buttons
  MOVE w_ok_code TO w_save_ok.

  CLEAR w_ok_code.

  CASE w_save_ok.

    WHEN c_exit OR c_cancel OR c_back.

      PERFORM f_do_exit.

    WHEN OTHERS.

*     do nothing
  ENDCASE.

ENDMODULE.    
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the code above its pretty simple to get a alv output using OOPS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;VJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 14:18:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-with-objects/m-p/2780687#M648096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T14:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: ALV with objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-with-objects/m-p/2780688#M648097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not able to pass the internal table in i_structure_name and it_outtab. I get an error message .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 14:57:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-with-objects/m-p/2780688#M648097</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T14:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: ALV with objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-with-objects/m-p/2780689#M648098</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;You can use cl_salv_table for display data. &lt;A href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5dc3e690-0201-0010-1ebf-b85b3bed962d" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5dc3e690-0201-0010-1ebf-b85b3bed962d&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report SALV_DEMO_TABLE_REAL_SIMPLE
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Thisisthemostsimple form of callingthenewALV objectmodel
*&amp;amp; Isn'titREALLY simple?
*&amp;amp;---------------------------------------------------------------------*
REPORT SALV_DEMO_TABLE_REAL_SIMPLE.
data: gt_outtabtypetableof SFLIGHT.
data: gr_tabletyperefto cl_salv_table.
*... Selectdata
select* fromSFLIGHT intocorrespondingfieldsof tablegt_outtab.
*... CreateInstance
callmethodcl_salv_table=&amp;gt;factory
IMPORTING
R_SALV_TABLE = gr_table
changing
t_table= gt_outtab.
*... Display table
gr_table-&amp;gt;display( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but, If you need set editable alv use CL_GUI_ALV_GRID: &lt;A href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4544e790-0201-0010-c29c-e46c389f5a96" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4544e790-0201-0010-c29c-e46c389f5a96&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the fieldcat use edit  =  'X' to set it editable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'DATE'. 
    wa_fieldcat-col_pos =  1.           
    wa_fieldcat-decimals_o = 0.
    wa_fieldcat-datatype = 'DATS'.
    wa_fieldcat-no_zero   = 'X'.
    wa_fieldcat-edit    =  'X'. 
    wa_fieldcat-outputlen = 8.
    APPEND wa_fieldcat TO gt_fieldcat.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 15:03:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-with-objects/m-p/2780689#M648098</guid>
      <dc:creator>juandavid_lopezsanta</dc:creator>
      <dc:date>2007-09-05T15:03:33Z</dc:date>
    </item>
  </channel>
</rss>

