cancel
Showing results for 
Search instead for 
Did you mean: 

Append/Insert(not Single) Mutliple rows on ALV Webdynpro

Former Member
0 Kudos

Hello Friends,

We all know that the std button Append/Insert , can insert only one row on a single click.

My specific requirement is :

1)  that when User clicks on this button(single click), we need to see  'n' rows( n will  be provided as a input box for th user to provide like 5,10,12 etc) appended/inserted at the end of the ALV list .

2) In all the new rows, some of the columns should be defaulted to some data.

Is there any approach to achieve this requirement?

Regards

Vinay.

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

With standard 'Insert Row' , you need to select the n records( using CTRL) and click on 'Insert Row' , then n number of rows will be inserted before the selected records. And you can use ON_DATA_CHECK method to set the default data by looping the r_param->t_inserted_rows.

hope this helps,

Regards,

Kiran

Former Member
0 Kudos

Ok Kira, Thanks for the intial approach. ( I will try to notify ALV WD that indeed a selection has been made when user clicks on the Insert row button).

I tried witth Append row (using CTRL approach) but did not work.

Any pointers?

Regards

Vinay.

former_member184578
Active Contributor
0 Kudos

Hi,

'Append Row' function adds a single row at the end of the ALV regardless of the selected row(s). You could create a custom button and on action of that, just append initial lines (or with default values) to the internal table and bind the context node using bind_table( ) method.

hope this helps,

Regards,

Kiran

Former Member
0 Kudos

Hello Kiran,

As i mentioned earlier, I already implemented the above said approach. Its working..

But just wanted to check if there is any facility as these new rows will not be captured centrally in the

r_param->t_inserted_rows (in data check event). So that i can move on with other processing .

FYI...  there is a method in the class CL_SALV_WD_CONFIG_TABLE - IF_SALV_WD_STD_FUNCTIONS~SET_EDIT_APPEND_ROWS_ALLOWED( which is obsolete now).

I dont know why this facility is not provided.

May be we need to check this faciltiy as well with Thomas Jung to re-add this in future.

Anyways..i continue with my approach...

Regards

Vinay.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vinay,

Instead of Standard Append/Insert ALV button, Create Custom button on Alv toolbar then will do this requirement.

Former Member
0 Kudos

Hi Jack,

Yes, I have already included a custom button. My approach was  stick to standard way.. which will decrease my coding efforts significantly and maintain consistency with Modify and delete buttons.

Just checking with the forum , if ever someone did it before.

Pls refer to this on saphelp.

Adding and Deleting Rows - Web Dynpro for ABAP - SAP Library

I tried it , but couldn't succeed.

Regards

Vinay.

Former Member
0 Kudos

But i didn't think it will work with standard button. Std Append/Insert button will work for single record only.