<?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 functions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306179#M1223660</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;Handle it using user_command in grid display&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Mar 2009 10:59:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-10T10:59:31Z</dc:date>
    <item>
      <title>ALV functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306177#M1223658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HELLO experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to display using ALV&lt;/P&gt;&lt;P&gt;can you please tell me how to do to make the two first  columns  fix , and how to delete a line when  i display my alv, of course i've already implment the 'delete' icon on the tool bar but i don't know to connect the event of clicking in this button with the good 'method' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you a lot  for help me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 10:56:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306177#M1223658</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-10T10:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: ALV functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306178#M1223659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Handle it using i_callback_user_command in grid display if any issues reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 10:58:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306178#M1223659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-10T10:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: ALV functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306179#M1223660</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;Handle it using user_command in grid display&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 10:59:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306179#M1223660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-10T10:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: ALV functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306180#M1223661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First tell me how u r creating ALV,using classes or Function Modules.If u r using Function modules then in the Fieldcatalog there is a field called 'Key',make this field as 'X' then the corresponding field will be u r Key field and will not scroll.Like &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  LOOP AT T_FLDCAT INTO W_FLDCAT.

    IF W_FLDCAT-FIELDNAME EQ 'ZVER' OR W_FLDCAT-FIELDNAME EQ 'ZSNO'.

      W_FLDCAT-KEY = 'X'.
      W_FLDCAT-FIX_COLUMN = 'X'.
      W_FLDCAT-LZERO = 'X'.

      MODIFY T_FLDCAT FROM W_FLDCAT.

    ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as deleting of the records after clicking a button from toolbar,then you need o write the following in your usercommand routine : &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM USERCOMMAND USING R_UCOMM TYPE SY-UCOMM
R_SELFIELD TYPE SLIS_SELFIELD.

  DATA: GD_REPID LIKE SY-REPID, "Exists
  REF_GRID TYPE REF TO CL_GUI_ALV_GRID.

  DATA: L_VALID TYPE C.

*Code to reflect the changes done in the internal table

  IF REF_GRID IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
      IMPORTING
        E_GRID = REF_GRID.
  ENDIF.

  IF NOT REF_GRID IS INITIAL.

    CALL METHOD REF_GRID-&amp;gt;CHECK_CHANGED_DATA
      IMPORTING
        E_VALID = L_VALID.

  ENDIF.

CASE R_UCOMM.

WHEN 'DEL'.     "When clicked on Delete button

Loop at IT_FINAL WHERE CHK = 'X'. " CHK is the chekcbox checked to delete the record

DELETE IT_FINAL[] FROM IT_FINAL.

ENDLOOP.

ENDCASE.

ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 11:02:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306180#M1223661</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-10T11:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: ALV functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306181#M1223662</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;Take a field in the internal table as &lt;STRONG&gt;chk(1) type c&lt;/STRONG&gt; with all the other fields. And while defining the field catalogs declare chk as checkbox.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  wa_field-fieldname = 'CHK'.
  wa_field-tabname = 'IT_FINAL'.
  wa_field-outputlen = 1.
  wa_field-seltext_l = ' '.
  wa_field-checkbox = 'X'.  "to display as checkbox
  wa_field-input = 'X'.
  wa_field-edit = 'X'.
  APPEND wa_field TO it_field.
  CLEAR wa_field.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use code:-&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM       = sy-repid
      IT_FIELDCAT              = it_field
      i_callback_user_command  = 'COMMAND'
      IS_LAYOUT                = wa_layout
      i_callback_pf_status_set = 'PF'
    TABLES
      T_OUTTAB                 = it_final
    EXCEPTIONS
      PROGRAM_ERROR            = 1
      OTHERS                   = 2.
  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.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  command
*&amp;amp;---------------------------------------------------------------------*
*       TO HANDLE USER ACTIONS AGAINST PF-STATUS
*----------------------------------------------------------------------*
*      --&amp;gt;UCOMM      text
*      --&amp;gt;SELFIELD   text
*----------------------------------------------------------------------*
FORM command USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
  DATA : ok_code TYPE sy-ucomm.
  ok_code = ucomm.
  CASE ok_code.
    when 'DELETE'.
      " to reflect the data changed into internal table
      DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new

      IF ref_grid IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = ref_grid.
      ENDIF.

      IF NOT ref_grid IS INITIAL.
        CALL METHOD ref_grid-&amp;gt;check_changed_data.
      ENDIF.
      
      " at this moment you have internal table modified

      sort it_final by chk descending.
      "delete selected records
      delete it_final where chk = 'X'.

      "refresh data back from internal table to alv grid
      selfield-refresh = 'X'.

  ENDCASE.
ENDFORM.                    "command
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tarun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 11:05:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306181#M1223662</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-03-10T11:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: ALV functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306182#M1223663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just right click on the column you want to fix then click on &lt;STRONG&gt;Freeze to column&lt;/STRONG&gt; option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 11:07:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306182#M1223663</guid>
      <dc:creator>sarbajitm</dc:creator>
      <dc:date>2009-03-10T11:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: ALV functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306183#M1223664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1)First keep a checkbox in your ALV display so that you can mark the row that you wan to delete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to do so what you have to do is keep a field like below in your final ITAB that you want to ALVdisplay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BEGIN OF T_final ,&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;chk(1)    TYPE c&lt;/STRONG&gt;, for making checkbox..&lt;/P&gt;&lt;P&gt; ............&lt;/P&gt;&lt;P&gt;..............&lt;/P&gt;&lt;P&gt;END OF T_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Then when you create the field catalog for the checkbox(chk field of your ITAB)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   write down the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WA_fieldcat-fieldname = 'CHK'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;WA_fieldcat-seltext_m = 'CheckBox'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;WA_fieldcat-checkbox = 'X'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;WA_fieldcat-edit = 'X' .&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;WA_fieldcat-input = 'X'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;WA_fieldcat-tabname = 'IT_FINAL'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;WA_fieldcat-col_pos = 1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;APPEND WA_fieldcat TO IT_fieldcat.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CLEAR WA_fieldcat.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Declare a data at your data section of the report&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA : lc_s_glay TYPE lvc_s_glay.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then before calling &lt;STRONG&gt;REUSE_ALV_GRID_DISPLAY&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;just write down the following piece of code&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;lc_s_glay-edt_cll_cb = 'X'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the REUSE_ALV_GRID_DISPLAY FM&lt;/P&gt;&lt;P&gt;you must set the follwing 2 Exporting Parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i) &lt;STRONG&gt;i_callback_user_command           = 'USER_COMMAND'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ii) &lt;STRONG&gt;i_grid_settings                    = lc_s_glay&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for &lt;STRONG&gt;i)&lt;/STRONG&gt; write down the following subroutine........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM user_command USING I_r_ucomm LIKE sy-ucomm&lt;/P&gt;&lt;P&gt;                  rs_selfield TYPE slis_selfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_out_string TYPE string,&lt;/P&gt;&lt;P&gt;        l_out_final  TYPE ekpo-menge,&lt;/P&gt;&lt;P&gt;        l_cntr TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CASE I_r_ucomm.&lt;/P&gt;&lt;P&gt;    WHEN 'DEL1'. &lt;STRONG&gt;assuming your Fcode&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;   delete from itab where chk = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;ENDFORM.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sarbajit Majumdar on Mar 10, 2009 4:50 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sarbajit Majumdar on Mar 10, 2009 4:50 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sarbajit Majumdar on Mar 10, 2009 4:51 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sarbajit Majumdar on Mar 10, 2009 4:51 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sarbajit Majumdar on Mar 10, 2009 4:52 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sarbajit Majumdar on Mar 10, 2009 4:53 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2009 11:18:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306183#M1223664</guid>
      <dc:creator>sarbajitm</dc:creator>
      <dc:date>2009-03-10T11:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: ALV functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306184#M1223665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Assistance MAP,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are you still watching this thread? Are not you get the answer ? Please mark the thread as ANSWERED if you get your desired answer. Otherwise keep posting the difficulties you are still facing. Can try to give the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sarbajit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Mar 2009 07:17:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306184#M1223665</guid>
      <dc:creator>sarbajitm</dc:creator>
      <dc:date>2009-03-16T07:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: ALV functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306185#M1223666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Assistance MAP,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are you still watching this thread? Are not you get the answer ? Please mark the thread as ANSWERED if you get your desired answer. Otherwise keep posting the difficulties you are still facing. Can try to give the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sarbajit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2009 13:21:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-functions/m-p/5306185#M1223666</guid>
      <dc:creator>sarbajitm</dc:creator>
      <dc:date>2009-03-18T13:21:51Z</dc:date>
    </item>
  </channel>
</rss>

