2008 Jan 24 4:18 AM
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.
2008 Jan 24 4:52 AM
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.
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.
2008 Jan 24 4:52 AM
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.
2008 Jan 24 3:22 PM
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.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |