Application Development 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: 

Insert row between two filled rows in table control

former_member554223
Participant
0 Kudos

Hello Abapers

I have a requirement in table control that the user can insert the row between two filled rows to make it a sub row of the first one. I have two buttons one is to insert row at the end and second is when a user select a line in table control and press the second button then the empty row should insert below that particular selected line.

your help will be appreciated.

3 REPLIES 3

former_member288834
Participant

Its simple, get the selected line, and insert empty row in internal table, declare one key field for both header and item rows so that is easy to insert row. Key field can be used to insert row if you are not able to insert empty row. Key field would be there in background, its our coding purpose, not required to display to user. Hope this solution works. You can also validate the user is trying to insert any other sub row(Second sub row) you can give error. Also you can sort the data with that key field declared in your internal table.

You can achieve with little bit coding.

Regards

Guru Prasad

0 Kudos

Thanks Guru for your quick response

do you have the sample code of it? It would be great help to me.

Azeem Haider : use INSERT ... INTO ... INDEX ... :
INSERT line INTO table INDEX linenumber.