cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting a row from View Dynamically

Former Member
0 Kudos

Hi Experts,

I am working with dynamic programming... there is Add button Once I press Add it will create the 3 input fileds and one button (its for Delete ) in one row.

If press the Button( Delete ) it should delete the respective row ( 3 input fileds and the button ( delete) ).

Please help me with the solution.

Thanks,

Anil

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

One idea: you could put these fields and the button inside a group (dynamically created by CL_WD_GROUP=>NEW_GROUP(...), and then use methods of the group (CL_WD_GROUP) to either set it invisible (SET_VISIBLE) or - if it's an element within another element (say, another group) use method REMOVE_CHILD from within the surrounding group.

Regards,

Trond

Former Member
0 Kudos

Thanks Trond for your reply.

I used below code and when I am click on the delete button its deleting the top row on the view.

Its not deleting the respective row...

Ex if i have 4 rows on view and I am pressing on second row delete button but still its deleting the top row.

I changed index of Remove_child and tried..

I used index = 0 , index = 1 and i am not passed any index still its not deleting the respective row.

CALL METHOD lr_container->remove_child

EXPORTING

index = 1

id = gv_char.

Please let me know how can i do this.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You can't hard code the index here. The index tells it which of the children UI elements you want to delete. You will need to specify the index of the item you wish to detele.

Former Member
0 Kudos

Hi Thomas,

I think we need to pass the positions for ID not for Index. Index will tell the type of behaviour..

Correct me if i am wrong...