Application Development and Automation 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: 
Read only

ALV toolbar

Former Member
0 Likes
1,228

Hello,

I created an ALV and I want to use the buttons on the application of tools.

I mean that when I add a row to the list, I choose "Insert Row" in the application, and an empty row is inserted.

When I enter the values for each field, I can verfy the values inserted then save them in a table.

The same goes for a "Delete Row" button, when I delete a row, I can check before I remove it from the table.

Does anybody know a solution for this? Thanks for help!

Regards

Hello,

I created an ALV and I want to use the buttons on the application of tools.

I mean that when I add a row to the list, I choose "Insert Row" in the application, and an empty row is inserted.

When I enter the values for each field, I can verfy the values inserted then save them in a table.

The same goes for a "Delete Row" button, when I delete a row, I can check before I remove it from the table.

Does anybody know a solution for this? Thanks for help!

Regards

10 REPLIES 10
Read only

former_member242255
Active Contributor
0 Likes
1,199

what u want to check before the deletion..can you be a bit more clear on the issue..

Read only

Former Member
0 Likes
1,199

Hi,

Please go thru the links provided below for editing a alv row based on contirion.

[conditionaly editing alv row|conditionaly editing alv row]

[Conditionaly editing a alv row using cell variant]

Hopes this will helps you.

Edited by: Dande on May 15, 2009 11:54 AM

Edited by: Dande on May 15, 2009 11:54 AM

Read only

Former Member
0 Likes
1,199

Hi

Refer Demo pgm-BCALV_EDIT_04

Read only

Former Member
0 Likes
1,199

hi, here is the code tto save ,edit or modify value in alv which will hit ur dbtab.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = sy-repid

i_callback_pf_status_set = 'PF_STAUS'

i_callback_user_command = 'USER_COMMAND'

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

is_layout = gs_sel

it_fieldcat = tt_fieldcat[]

FORM user_command USING r_ucomm type sy-ucomm

rs_selfield TYPE slis_selfield .

DATA:

lv_erfmg TYPE erfmg,

lv_erfmg2 TYPE erfmg.

" Inserted By Muhammed Safel on 8-7-2009

DATA: REF1 TYPE REF TO CL_GUI_ALV_GRID.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

IMPORTING

  • ET_EXCLUDING =

  • E_REPID =

  • E_CALLBACK_PROGRAM =

  • E_CALLBACK_ROUTINE =

E_GRID = REF1

  • ET_FIELDCAT_LVC =

  • ER_TRACE =

  • E_FLG_NO_HTML =

  • ES_LAYOUT_KKBLO =

  • ES_SEL_HIDE =

.

CALL METHOD REF1->CHECK_CHANGED_DATA.

endform. " this will update the alv..

Edited by: Safel007 on May 15, 2009 3:33 PM

Read only

Former Member
0 Likes
1,199

Hi,

use method check_changed_data. of class cl_gui_alv_grid, after insertion or deletion of row is done

the user presses a pushbutton( say SAVE). in 'save ' functionality u can chk for the changed data.

u need to insert or delete the row from the internal table i.e. displayed onto the grid. and then redisplay

the table data using 'refresh_table_display' method of class cl_gui_alv_grid.



module user_command_<scrno> input.
  case sy-ucomm.
    when 'BACK'.
      set screen '0'.
    when 'EXIT'.
      leave program.

      when 'SAVE'.
  call method r_grid->check_changed_data.

  call method r_grid->refresh_table_display.

Regards,

Mdi.Deeba

Read only

Former Member
0 Likes
1,199

Hi,

u can set in ur report

SET PF-STATUS 'TEST'

use following statement

module user_command_<scrno> input.

case sy-ucomm.

when 'BACK'.

set screen '0'.

when 'EXIT'.

leave program.

when 'SAVE'.

Regards....

Edited by: jinku on May 15, 2009 12:27 PM

Read only

Former Member
0 Likes
1,199

Standard program BCALV_EDIT_01 In this program available insrt row button delete etc.

Read only

0 Likes
1,199

Hi,

Thank you, all of you, for your replies.

For prgrams BCALV_EDIT_0 * , the standard buttons in ALV are used. For some of these programs, the lines are editable, and when adding a new row, it added in edit mode.

While, in my program, I have lines in display mode and when I add a new row, it was dimmed.

Mll Mat

Read only

Former Member
0 Likes
1,199

Are you using oops ALV or funcion module ALV.

Read only

0 Likes
1,199

I'm using Object Oriented ALV.

.