2008 Apr 07 7:53 AM
Hi Experts,
I am using a table control in module pool programming, How can I Insert row and delete row in a table control?
Thanks in Advance....
hey there,,,''
i would suggest you to use table control wizard in order to do these operations... it reduces the coding part alot and automaticallyl generates the code.
do reward if helpful
2008 Apr 07 7:56 AM
2008 Apr 07 8:41 AM
Santhosh,
Iam using this code..
FORM fcode_delete_row
USING p_tc_name TYPE dynfnam
p_table_name
p_mark_name .
-BEGIN OF LOCAL DATA----
DATA l_table_name LIKE feld-name.
data: p_mark_name type c.
FIELD-SYMBOLS <tc> TYPE cxtab_control.
FIELD-SYMBOLS <table> TYPE STANDARD TABLE.
FIELD-SYMBOLS <wa>.
FIELD-SYMBOLS <mark_field>.
-END OF LOCAL DATA----
ASSIGN (p_tc_name) TO <tc>.
get the table, which belongs to the tc *
CONCATENATE p_table_name '[]' INTO l_table_name. "table body
ASSIGN (l_table_name) TO <table>. "not headerline
delete marked lines *
DESCRIBE TABLE <table> LINES <tc>-lines.
LOOP AT <table> ASSIGNING <wa>.
access to the component 'FLAG' of the table header *
ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
if <MARK_FIELD> = 'X'.
PERFORM f_save_confirmation_9101.
IF gv_answer EQ '1'.
DELETE <table> INDEX syst-tabix.
IF sy-subrc = 0.
<tc>-lines = <tc>-lines - 1.
ENDIF.
ELSE.
ENDIF.
ENDIF.
ENDLOOP.
in this code ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
if <MARK_FIELD> = 'X'.
this code is not working...
2008 Apr 07 8:02 AM
hey there,,,''
i would suggest you to use table control wizard in order to do these operations... it reduces the coding part alot and automaticallyl generates the code.
do reward if helpful
2008 Apr 07 8:07 AM
2008 Apr 07 8:14 AM
Hi,
Pls refer to the program : RSDEMO_TABLE_CONTROL
Regards,
Renjith Michael.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |