<?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 Replace standard button behavior! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-replace-standard-button-behavior/m-p/4207566#M1005514</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to Override the Standard Button Behaviour you have to Use the Two events &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One SET_PF_STATUS and User_command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One is for Setting the PF-status and other to Handle the Button actions&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
     I_CALLBACK_PROGRAM                = SY-REPID
   I_CALLBACK_PF_STATUS_SET          = ' STATUS'
   I_CALLBACK_USER_COMMAND           = 'USER_COMMAND '
     IS_LAYOUT                         = FS_LAYOUT
     IT_FIELDCAT                       = T_FIELDCAT
    TABLES
      T_OUTTAB                          = T_VBAP
   EXCEPTIONS
     PROGRAM_ERROR                     = 1
     OTHERS                            = 2.
  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.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to have two forms one is for Sattus and other is for User_command handling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM STATUS using extab type slis_t_extab.

SET PF-STATUS 'AAAA' excluding extab.

"here you set the status, give your own okcodes to the buttons 
"like sort etc.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

FORM USER_COMMAND using ucomm type sy-ucomm 
                                                selfield type slis_selfield.

"hanlde the above buttons here..

case ucomm.

when 'SORTT'.
 "Do popup here.
endcase.

ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vijay Babu Dudla&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Jul 2008 13:34:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-17T13:34:04Z</dc:date>
    <item>
      <title>ALV Replace standard button behavior!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-replace-standard-button-behavior/m-p/4207565#M1005513</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;Can anybody explain me if its possible to replace a standard behavior of a Grid's button?&lt;/P&gt;&lt;P&gt;For example: I want to replace the logic of Sort button, when the user sorts the ALV I want to show a popup message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to find where the sort logic is done, but I couldn't find it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 13:27:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-replace-standard-button-behavior/m-p/4207565#M1005513</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T13:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Replace standard button behavior!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-replace-standard-button-behavior/m-p/4207566#M1005514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to Override the Standard Button Behaviour you have to Use the Two events &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One SET_PF_STATUS and User_command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One is for Setting the PF-status and other to Handle the Button actions&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
     I_CALLBACK_PROGRAM                = SY-REPID
   I_CALLBACK_PF_STATUS_SET          = ' STATUS'
   I_CALLBACK_USER_COMMAND           = 'USER_COMMAND '
     IS_LAYOUT                         = FS_LAYOUT
     IT_FIELDCAT                       = T_FIELDCAT
    TABLES
      T_OUTTAB                          = T_VBAP
   EXCEPTIONS
     PROGRAM_ERROR                     = 1
     OTHERS                            = 2.
  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.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to have two forms one is for Sattus and other is for User_command handling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM STATUS using extab type slis_t_extab.

SET PF-STATUS 'AAAA' excluding extab.

"here you set the status, give your own okcodes to the buttons 
"like sort etc.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

FORM USER_COMMAND using ucomm type sy-ucomm 
                                                selfield type slis_selfield.

"hanlde the above buttons here..

case ucomm.

when 'SORTT'.
 "Do popup here.
endcase.

ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vijay Babu Dudla&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2008 13:34:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-replace-standard-button-behavior/m-p/4207566#M1005514</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-17T13:34:04Z</dc:date>
    </item>
  </channel>
</rss>

