Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete line in toolbar

Former Member
0 Kudos

Hi guys,

I have to display the 'delete_line' button in alv toolbar, but this button doesn't exist, altough this button is a standard button.

how can I do this?

PS : I am working on alv not editable, but I must have possibility to deleting lines.

need help

Simo

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello Mohamed

Sample report BCALV_GRID_05 demonstrates how to define your own toolbar button.


PROGRAM BCALV_GRID_05.
*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
* Purpose:
* ~~~~~~~~
* Demonstrate the creation of an own toolbar button.
*-----------------------------------------------------------------
* To check program behavior
* ~~~~~~~~~~~~~~~~~~~~~~~~~
* The report shows a list of flights of one airline.
* Select one or more lines and press the 'Detail'-Button to popup
* a dialog window with related bookings.
*-------------------------------------------------------------------
* Essential steps (Search for '§')
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* 1.Apply steps for event handling for events TOOLBAR and
*   USER_COMMAND (see example for print events)
* 2.In event handler method for event TOOLBAR: Append own functions
*   by using event parameter E_OBJECT.
* 3.In event handler method for event USER_COMMAND: Query your
*   function codes defined in step 2 and react accordingly.
* 4.Call method 'set_toolbar_interactive' to raise event TOOLBAR.
*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
...

Regards

Uwe

4 REPLIES 4

uwe_schieferstein
Active Contributor
0 Kudos

Hello Mohamed

Sample report BCALV_GRID_05 demonstrates how to define your own toolbar button.


PROGRAM BCALV_GRID_05.
*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
* Purpose:
* ~~~~~~~~
* Demonstrate the creation of an own toolbar button.
*-----------------------------------------------------------------
* To check program behavior
* ~~~~~~~~~~~~~~~~~~~~~~~~~
* The report shows a list of flights of one airline.
* Select one or more lines and press the 'Detail'-Button to popup
* a dialog window with related bookings.
*-------------------------------------------------------------------
* Essential steps (Search for '§')
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* 1.Apply steps for event handling for events TOOLBAR and
*   USER_COMMAND (see example for print events)
* 2.In event handler method for event TOOLBAR: Append own functions
*   by using event parameter E_OBJECT.
* 3.In event handler method for event USER_COMMAND: Query your
*   function codes defined in step 2 and react accordingly.
* 4.Call method 'set_toolbar_interactive' to raise event TOOLBAR.
*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
...

Regards

Uwe

Former Member
0 Kudos

Hello Uwe, wish you are fine.

why sould I add this button in toolbar, if the button already exist in alv toolbar standard, but I can't found it?

0 Kudos

Hello Mohamed

You could try to set LVC_S_LAYO-EDIT = 'X' instead.

However, if the result is that the entire ALV is editable then you have to disable this property at cell level. In addition, you probably have all the toolbar function for editable ALV which you probably do not need (e.g. Copy/Paste, etc.). You need to inactivate this functions.

I would assume that it is much less effort to define your own toolbar button for deleting rows.

You may even define a button at the application function bar yet this is not the recommended approach in terms of usability.

Regards

Uwe

Former Member
0 Kudos

thanks, a lot it's ok now