cancel
Showing results for 
Search instead for 
Did you mean: 

Append row in end of table?

Former Member
0 Kudos

Hi,

I have an ALV table with default "Append row" "Delete Row" buttons. When i give append row initially, then a new row is added to the end of the table. But when i give field sorting (Ascending order), and then go for Append row, a new row which is added to the top of the table. User want this to be added always in the end of the table. Can anyone please help me on this? ...

Thanks,

Sathishkumar GS

Accepted Solutions (1)

Accepted Solutions (1)

phanir_mullapudi
Active Participant
0 Kudos

Hi Sathish,

Yes, add new buttons & give your own code. When user hits your APPEND/ADD button, in the method, Read number of table elements & Add table row at index = no_of_elements + 1.

Thanks,

Phani

Former Member
0 Kudos

Hi,

Thank you for your reply. Can you please tell me how to add self defined buttons in ALV? And also please provide me the appropriate code for add the row.

Thanks in advance,

GS

Former Member
0 Kudos

Hi,

Refer this thread :

Former Member
0 Kudos

Hi Saurav,

I am not able to open the link. Can you please paste the content in the link which u have given.

Thanks,

GS

Former Member
0 Kudos

Code for your reference : (Taken from the thread mentioned earlier)

DATA display_function TYPE REF TO cl_salv_wd_function.

LR_FUNCTION_SETTINGS->IF_SALV_WD_FUNCTION_SETTINGS~CREATE_FUNCTION(
    EXPORTING
      ID     = 'BTN_DISPLAY_DET'
    RECEIVING
      VALUE  = display_function ).
 
* set button and tool tip text
  LV_BUTTON_TEXT = WD_ASSIST->IF_WD_COMPONENT_ASSISTANCE~GET_TEXT( '007' ).
 
  CREATE OBJECT lo_own_button.
  lo_own_button->set_text( LV_BUTTON_TEXT ).
 
  LV_BUTTON_Tooltip = WD_ASSIST->IF_WD_COMPONENT_ASSISTANCE~GET_TEXT( '008' ).
  CALL METHOD LO_OWN_BUTTON->SET_TOOLTIP
    EXPORTING
      VALUE = LV_BUTTON_Tooltip.
 
  display_function->set_editor( lo_own_button  ).

Former Member
0 Kudos

Hi,

Thank you. where shall i write this code. And also i want code for appending row in table.

Thanks,

GS

former_member193202
Participant
0 Kudos

where you coded the routines for showing the alv, at the end after creating the alv object.

appending table:

via wizard: get contet as table operation, like node->get_static_attributes_table( importing table = my_table ).

then:

append initial line to my_table.

and now bind to conext like.

node->bind_table( my_table ).

Answers (1)

Answers (1)

florian_royer
Participant
0 Kudos

Maybe a self defined button "append" and "delete" would help you out?