Application Development and Automation 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: 
Read only

Insert row and delete row in a table control

Former Member
0 Likes
896

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....

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....

5 REPLIES 5
Read only

Former Member
0 Likes
811

Refer to the below related threads

Regards,

Santosh

Read only

0 Likes
811

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...

Read only

Former Member
0 Likes
811

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

Read only

Former Member
0 Likes
811

hi ramu,

Refer this thread.it may be helpful to u

revert back for any queries

regards,

sravanthi

Read only

Former Member
0 Likes
811

Hi,

Pls refer to the program : RSDEMO_TABLE_CONTROL

Regards,

Renjith Michael.