<?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 grid in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735005#M635223</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can do all your validation in the user command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*----------------------------------------------------------------------*
* call the ABAP list viewer                                            *
*----------------------------------------------------------------------*
FORM list_display TABLES a_output.

  pgm = disvariant-report = sy-repid.
  disvariant-variant = variant.
* call list viewer
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      i_callback_program       = pgm
      i_callback_pf_status_set = 'SET_PF_STATUS'
      it_fieldcat              = fieldcat
      is_variant               = disvariant
      is_layout                = layout
      is_print                 = print
      i_save                   = 'A'
      it_events                = eventcat
      it_sort                  = sortcat
      i_callback_user_command  = 'USER_COMMAND'
    TABLES
      t_outtab                 = a_output
    EXCEPTIONS
      program_error            = 1
      OTHERS                   = 2.

ENDFORM.                    "LIST_DISPLAY

**---------------------------------------------------------------------*
** FORM SET_PF_STATUS *
**---------------------------------------------------------------------*

*FORM set_pf_status USING extab TYPE slis_t_extab.
*  SET PF-STATUS 'STATUS1'.
*ENDFORM.                    "set_pf_status
FORM set_pf_status USING extab TYPE slis_t_extab.
  SET PF-STATUS 'ZZSTD'.
ENDFORM.                    "set_pf_status

**---------------------------------------------------------------------*
** FORM USER_COMMAND *
**---------------------------------------------------------------------*

FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
  DATA t_difference TYPE i.
  CASE ucomm.

    WHEN 'COPY'.
      LOOP AT t_output INTO wa_output.
        IF wa_output-chkbox = 'X'.
          wa_output-zzcastqtyactual = 0.
          wa_output-zcastqty = 0.
          wa_output-plnum = ''.
          wa_output-zzgsmng = 0.
          IF v_tabix NE sy-tabix.
            v_tabix = sy-tabix + 1.
            INSERT wa_output INTO t_output INDEX v_tabix.
          ENDIF.
        ENDIF.
      ENDLOOP.

    WHEN 'DELETE'.
      DELETE t_output WHERE chkbox = 'X'.

    WHEN 'SELA'.
      LOOP AT t_output.
        t_output-chkbox = 'X'.
        MODIFY t_output INDEX sy-tabix.
      ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might have to add buttons on the screen and assign a function code to it and use them in the program. &lt;/P&gt;&lt;P&gt;Hope this helps and let me know if you need additional help or a demo code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shreekant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Sep 2007 20:18:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-04T20:18:12Z</dc:date>
    <item>
      <title>ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735000#M635218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to edit a cell in the ALV grid display using function modules.?Or Abap objects are the only option. &lt;/P&gt;&lt;P&gt;I have a big internal table and , the user should be able to view it and also enter value in an empty field and the program should get the entered value perform a simple subtraction and then display the new value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2007 19:33:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735000#M635218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-04T19:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735001#M635219</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;When you are preparing the field catalog for the ALV, in the export parameters, you will get a flag for input enabled..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will need to check that flag for the field which you want to make input enabled..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Best Regards,&lt;/P&gt;&lt;P&gt;Vikas Bittera.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2007 19:37:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735001#M635219</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-04T19:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735002#M635220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes it is possible for an edidtable ALV report and you would not need any special coding.&lt;/P&gt;&lt;P&gt;The normal function modules will take care of it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shrerekant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2007 19:37:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735002#M635220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-04T19:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735003#M635221</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;Use this function module:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'REUSE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the fieldcat parameter pass the field catalog table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When appending a field to the field catalog table.. do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Workarea for table i_fieldcat&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA : e_fieldcat TYPE slis_fieldcat_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Clear table header and work area&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CLEAR : e_fieldcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Append the values&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  e_fieldcat-col_pos    = p_pos   .&lt;/P&gt;&lt;P&gt;  e_fieldcat-fieldname  = p_field .&lt;/P&gt;&lt;P&gt;  e_fieldcat-seltext_l  = p_lable .&lt;/P&gt;&lt;P&gt;  e_fieldcat-seltext_m  = p_lable .&lt;/P&gt;&lt;P&gt;  e_fieldcat-seltext_s  = p_lable .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  e_fieldcat-input = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  e_fieldcat-outputlen  = p_len   .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND e_fieldcat TO i_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Best Regards,&lt;/P&gt;&lt;P&gt;Vikas Bittera.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2007 19:46:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735003#M635221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-04T19:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735004#M635222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thankyou Vikas ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that it can be edited, but a question , how to retrieve what has been entered - perform validations and then again display it on screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can share your knowledge on this , it will be great&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2007 20:13:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735004#M635222</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-04T20:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735005#M635223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can do all your validation in the user command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*----------------------------------------------------------------------*
* call the ABAP list viewer                                            *
*----------------------------------------------------------------------*
FORM list_display TABLES a_output.

  pgm = disvariant-report = sy-repid.
  disvariant-variant = variant.
* call list viewer
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      i_callback_program       = pgm
      i_callback_pf_status_set = 'SET_PF_STATUS'
      it_fieldcat              = fieldcat
      is_variant               = disvariant
      is_layout                = layout
      is_print                 = print
      i_save                   = 'A'
      it_events                = eventcat
      it_sort                  = sortcat
      i_callback_user_command  = 'USER_COMMAND'
    TABLES
      t_outtab                 = a_output
    EXCEPTIONS
      program_error            = 1
      OTHERS                   = 2.

ENDFORM.                    "LIST_DISPLAY

**---------------------------------------------------------------------*
** FORM SET_PF_STATUS *
**---------------------------------------------------------------------*

*FORM set_pf_status USING extab TYPE slis_t_extab.
*  SET PF-STATUS 'STATUS1'.
*ENDFORM.                    "set_pf_status
FORM set_pf_status USING extab TYPE slis_t_extab.
  SET PF-STATUS 'ZZSTD'.
ENDFORM.                    "set_pf_status

**---------------------------------------------------------------------*
** FORM USER_COMMAND *
**---------------------------------------------------------------------*

FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
  DATA t_difference TYPE i.
  CASE ucomm.

    WHEN 'COPY'.
      LOOP AT t_output INTO wa_output.
        IF wa_output-chkbox = 'X'.
          wa_output-zzcastqtyactual = 0.
          wa_output-zcastqty = 0.
          wa_output-plnum = ''.
          wa_output-zzgsmng = 0.
          IF v_tabix NE sy-tabix.
            v_tabix = sy-tabix + 1.
            INSERT wa_output INTO t_output INDEX v_tabix.
          ENDIF.
        ENDIF.
      ENDLOOP.

    WHEN 'DELETE'.
      DELETE t_output WHERE chkbox = 'X'.

    WHEN 'SELA'.
      LOOP AT t_output.
        t_output-chkbox = 'X'.
        MODIFY t_output INDEX sy-tabix.
      ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might have to add buttons on the screen and assign a function code to it and use them in the program. &lt;/P&gt;&lt;P&gt;Hope this helps and let me know if you need additional help or a demo code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shreekant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2007 20:18:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735005#M635223</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-04T20:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735006#M635224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shreekant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the code. It not totally clear for me right now  as how to perform validations. If you can mail me a complete source code , it will be great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Krish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2007 22:37:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/2735006#M635224</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-04T22:37:54Z</dc:date>
    </item>
  </channel>
</rss>

