07-15-2008 3:14 PM
Hi,
How to delete or insert in itab (in table control) by marking a particular row?
At the same time the database should be updated with the operation done.
Thanks,
Mohan
07-15-2008 4:45 PM
Mohan,
same as you done in reports.
for more info just use F1 help on insert delete update command from se38.
you will come to know.
Amit.
07-15-2008 7:36 PM
check this program : DEMO_DYNPRO_TABCONT_LOOP_AT.
hope it will make you better understandable.
07-15-2008 7:51 PM
Hello.
First your table control must have a mark column. For that create in the structure of itab a field TYPE char1 (named MARK for example) and then in table control parameters, select it to the mark field.
Then, in the screen layout, create a button delete row and assign a function code to it (DEL for example).
After that, in PAI of that screen, USER-COMMAND module, make a statement like:
CASE ok_code.
...
WHEN 'DEL'.
perform del_row.
...
ENDCASE.
Create your form with something LIKE.
FORM del_row.
LOOP AT itab INTO wa WHERE mark EQ 'X'.
DELETE ztable WHERE field = wa-field.
ENDLOOP.
DELETE itab WHERE mark EQ 'X'.
ENDFORM.
Also, don't forget that to the mark fields became marked after a enter (for example), must be passed to itab in PAI too, like.
LOOP.
FIELD: wa-mark MODULE mark ON REQUEST.
ENDLOOP.
Create your module with something LIKE.
MODULE mark INPUT.
modify itab from wa TRANSPORTING mark.
ENDMODULE.
Regards.
Valter Oliveira.