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

pls help me

Former Member
0 Likes
488

hi,

i have created ALV list and application toolbar also. i have added 'ADD' button in the toolbar. Now i want to insert one row at the end of that list by clicking on that 'ADD' button and which will show the number next number of row (suppose there are 4 rows and each one has sr no. associated with it, now i want next row to be displayed with sr no. 5 and other blank fields).

thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
467

When you click ADD,

In the internal table which ur passing to the ALV display, append a new row.

For the serial no.,

Sort itab by srno descending.

read table itab index 1.

new_no = itab-srno + 1.

clear itab.

itab-srno = new_no.

append itab.

now refresh the grid display.

hi,

i have created ALV list and application toolbar also. i have added 'ADD' button in the toolbar. Now i want to insert one row at the end of that list by clicking on that 'ADD' button and which will show the number next number of row (suppose there are 4 rows and each one has sr no. associated with it, now i want next row to be displayed with sr no. 5 and other blank fields).

thanks in advance.

2 REPLIES 2
Read only

Former Member
0 Likes
468

When you click ADD,

In the internal table which ur passing to the ALV display, append a new row.

For the serial no.,

Sort itab by srno descending.

read table itab index 1.

new_no = itab-srno + 1.

clear itab.

itab-srno = new_no.

append itab.

now refresh the grid display.

Read only

Former Member
0 Likes
467

Create an event handler for User Command.

In that Event handler handle the User Command for the ADD button as follows.

Read the last record's serial number. Add + 1 to that serial number and populate it in the newly created row.

Call method REFRESH_TABLE_DISPLAY to refresh your ALV table display.

Have a look at the following link to have a feel of the event handler for USER_COMMAND.

[http://www.abap4.it/download/ALV.pdf]

Reward if helpful.