<?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 adding a button to standard  bar in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-button-to-standard-bar/m-p/3661058#M881850</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;it is like i want to add sort filter sum button in my report after the output displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anybody plz help me its a bit urgent. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Anupama&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Apr 2008 10:35:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-15T10:35:56Z</dc:date>
    <item>
      <title>adding a button to standard  bar</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-button-to-standard-bar/m-p/3661058#M881850</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;it is like i want to add sort filter sum button in my report after the output displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anybody plz help me its a bit urgent. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Anupama&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Apr 2008 10:35:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-button-to-standard-bar/m-p/3661058#M881850</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-15T10:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: adding a button to standard  bar</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-button-to-standard-bar/m-p/3661059#M881851</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;Below code is a program for sorting using a button on toolbar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES :
       spfli.

************************************************************************
** Declaring Selection Screens                                         *
************************************************************************


SELECTION-SCREEN BEGIN OF BLOCK b1.
                  

SELECT-OPTIONS s_range  FOR spfli-carrid NO-EXTENSION.
SELECT-OPTIONS s_range1 FOR spfli-connid NO-EXTENSION.

SELECTION-SCREEN END OF BLOCK b1.


***********************************************************************
*   Structure Declaration to Hold the FLIGHT  Data                    *
***********************************************************************

DATA:

     BEGIN OF fs_spfli,
       carrid    LIKE spfli-carrid,
       connid    LIKE spfli-connid,
       cityfrom  LIKE spfli-cityfrom,
       cityto    LIKE spfli-cityto,
       airpfrom  LIKE spfli-airpfrom,
       airpto    LIKE spfli-airpto,
       countryfr LIKE spfli-countryfr,
       countryto LIKE spfli-countryto,
      END OF fs_spfli.

***********************************************************************
*   Internal Table And Work Area Declarations  For SPFLI TABLE         *
***********************************************************************

DATA :
  t_spfli LIKE
 STANDARD TABLE
       OF fs_spfli.



***********************************************************************
*                  START-OF-SELECTION                                 *
***********************************************************************
START-OF-SELECTION.


  PERFORM get_spfli_data.
  PERFORM display_data.

***********************************************************************
*                  AT USER-COMMANDE                                   *
***********************************************************************
AT USER-COMMAND.

Perform user_command.


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  get_spfli_data
*&amp;amp;---------------------------------------------------------------------*
*       Getting t_spfli Data from SPFLI Table
*----------------------------------------------------------------------*
* There are no interface parameters to be passed                      *
*---------------------------------------------------------------------*
FORM get_spfli_data .

  SELECT
        carrid
        connid
        cityfrom
        cityto
        airpfrom
        airpto
        countryfr
        countryto
   INTO TABLE  t_spfli
   FROM spfli
  WHERE carrid IN s_range
    AND connid IN s_range1.

  IF sy-subrc NE 0.
    MESSAGE 'Entries Not Found' TYPE 'E'.
  ENDIF.

ENDFORM.                    " get_spfli_data

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  display_data
*&amp;amp;---------------------------------------------------------------------*
*       Subroutine to  display SPFLI Contents                          *
*----------------------------------------------------------------------*
* There are no interface parameters to be passed                      *
*---------------------------------------------------------------------*


FORM display_data .

  LOOP AT t_spfli INTO fs_spfli.

    SET PF-STATUS 'PUSHBUTTON'.

    WRITE : / fs_spfli-carrid,
            8 fs_spfli-connid,
            15 fs_spfli-cityfrom,
            30 fs_spfli-cityto,
            45 fs_spfli-airpfrom,
            56 fs_spfli-airpto,
            65 fs_spfli-countryfr,
            75 fs_spfli-countryto.
  ENDLOOP.
ENDFORM.                    " display_data


*&amp;amp;--------------------------------------------------------------------*
*&amp;amp;      Form  sortspflidata                                           *
*&amp;amp;--------------------------------------------------------------------*
*       subroutine to Sort list on Cursor position.                   *
*---------------------------------------------------------------------*
* There are no interface parameters to be passed                      *
*---------------------------------------------------------------------*


FORM sortspflidata .

  DATA : lw_cursor(20) TYPE c ,
         lw_cursor1(20) TYPE c .


  GET CURSOR FIELD lw_cursor.

  IF sy-subrc NE 0.
    MESSAGE 'Error' TYPE 'E'.
  ELSE.

    MOVE lw_cursor+9 TO lw_cursor.
    SORT t_spfli BY (lw_cursor).

    LOOP AT t_spfli INTO fs_spfli.
      WRITE : / fs_spfli-carrid,
                8 fs_spfli-connid,
                15 fs_spfli-cityfrom,
                30 fs_spfli-cityto,
                45 fs_spfli-airpfrom,
                56 fs_spfli-airpto,
                65 fs_spfli-countryfr,
                75 fs_spfli-countryto.

    ENDLOOP.
  ENDIF.
ENDFORM.                    " sortspflidata

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  SORT_data_by_window
*&amp;amp;---------------------------------------------------------------------*
*  Subroutine to Sort by selecting a Field from window                 *
*----------------------------------------------------------------------*
* There are no interface parameters to be passed                       *
*----------------------------------------------------------------------*

FORM sort_data_by_window .

  SET PF-STATUS 'WIN'.

  WINDOW STARTING AT 1  15
         ENDING   AT 79 23.
  DATA:
    box TYPE c,
    box1 TYPE c,
    box2 TYPE c,
    box3 TYPE c,
    box4 TYPE c,
    box5 TYPE c,
    box6 TYPE c,
    box7 TYPE c.

  WRITE:  box AS CHECKBOX .
  WRITE: 'carrid',
        / box1 AS CHECKBOX .
  WRITE: 'connid',
        / box2 AS CHECKBOX .
  WRITE: 'cityfrom',
        / box3 AS CHECKBOX.
  WRITE: 'cityto',
        / box4 AS CHECKBOX.
  WRITE: 'airpfrom',
        / box5 AS CHECKBOX.
  WRITE: 'airpto',
         / box6 AS CHECKBOX.
  WRITE: 'countryfr',
        / box7 AS CHECKBOX.
  WRITE: 'countryto'.
ENDFORM.                    " SORT_data_by_window

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  ascending
*&amp;amp;---------------------------------------------------------------------*
*   Subroutine for sorting data in window IN ASCENDING
*----------------------------------------------------------------------*
* There are no interface parameters to be passed                       *
*----------------------------------------------------------------------*

FORM ascending .

  DATA:

       w_lisel TYPE sy-lisel,
       w_word(15) TYPE c.

  DO 9 TIMES.
    READ LINE sy-index FIELD VALUE sy-lisel INTO w_lisel.
    IF w_lisel+0(1) = 'X'.
      w_word = sy-lisel+1(15).
      SORT t_spfli ASCENDING BY (w_word).
      PERFORM display.
    ENDIF.
  ENDDO.
ENDFORM.                    " enddo

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  DESCENDING
*&amp;amp;---------------------------------------------------------------------*
* subroutine for sorting data by selected column in decending.         *
*----------------------------------------------------------------------*
* There are no interface parameters to be passed                       *
*----------------------------------------------------------------------*

FORM descending .
  DATA:

        lw_lisel TYPE sy-lisel,
        lw_word(15) TYPE c.

  DO 9 TIMES.
    READ LINE sy-index FIELD VALUE sy-lisel INTO lw_lisel.

    IF lw_lisel+0(1) = 'X'.
      lw_word = sy-lisel+1(15).
      SORT t_spfli DESCENDING BY (lw_word).
      PERFORM display.
    ENDIF.
  ENDDO.
ENDFORM.                    " DESCENDING
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  display
*&amp;amp;---------------------------------------------------------------------*
*   subroutine for sorting data by selected column
*----------------------------------------------------------------------*
* There are no interface parameters to be passed                       *
*----------------------------------------------------------------------*

FORM display .


  LOOP AT t_spfli INTO fs_spfli.
    WRITE : / fs_spfli-carrid,
              8 fs_spfli-connid,
              15 fs_spfli-cityfrom,
              30 fs_spfli-cityto,
              45 fs_spfli-airpfrom,
              56 fs_spfli-airpto,
              72 fs_spfli-countryfr,
              79 fs_spfli-countryto.

  ENDLOOP.
ENDFORM.                    " display
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  user_command                                             *
*&amp;amp;---------------------------------------------------------------------*
*      Subroutine  to perform User Command                             *
*----------------------------------------------------------------------*
* There are no interface parameters to be passed                       *
*----------------------------------------------------------------------*
form user_command .
  CASE sy-ucomm.

      WHEN'SORT'.
      PERFORM sortspflidata.
    WHEN 'SORTWIN'.
      PERFORM sort_data_by_window.
    WHEN 'ASCENDING'.
      PERFORM ascending.
    WHEN 'DESCENDING'.
      PERFORM descending.
    WHEN 'CANCEL'.
      LEAVE screen.
  ENDCASE.
endform.                    " user_command&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to set PF status which I have mentioned in report and activate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie. Pf status : 'PUSHBUTTON'  &amp;amp; 'WIN'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for PF status ' Pushbutton'   ,  take two buttons on application toolbar,&lt;/P&gt;&lt;P&gt;                                             one for 'sort data'  &amp;amp; 'Sort Data By'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort data by will open new window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for that window also set pf status ie , 'WIN '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in that take three butttons ...for sorting list.. assending or decending and one for exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;reward points if helpful,&lt;/P&gt;&lt;P&gt;Brijesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Briesh Patel on Apr 15, 2008 10:12 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Apr 2008 16:41:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-button-to-standard-bar/m-p/3661059#M881851</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-15T16:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: adding a button to standard  bar</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-button-to-standard-bar/m-p/3661060#M881852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;if you want to use oops concept then the coding will be simple and not so lengthy.&lt;/P&gt;&lt;P&gt;if you want i can send you the sample codes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pratyush&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Apr 2008 11:46:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-button-to-standard-bar/m-p/3661060#M881852</guid>
      <dc:creator>former_member5472</dc:creator>
      <dc:date>2008-04-16T11:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: adding a button to standard  bar</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-button-to-standard-bar/m-p/3661061#M881853</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;Write this code in event initializaation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the Display filter button on the screen.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  &lt;STRONG&gt;sscrfields-functxt_01 = 'FILTER'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when you press this button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above sy-ucomm wil trigger&lt;/P&gt;&lt;P&gt;then you can write the code&lt;/P&gt;&lt;P&gt;as you want filter the entries....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2008 08:47:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-a-button-to-standard-bar/m-p/3661061#M881853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-17T08:47:50Z</dc:date>
    </item>
  </channel>
</rss>

