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

Table control

Former Member
0 Likes
949

Hi ABAP gurus,

Based on the project id entered by the user,I am displaying the records in the table control from database table.

Now the user can add the new entries in the table control and they can delete the existing entries in the table control.

These changes should immediately reflect in the table control.

But it should affect the database table when the user clicks save button .

I have done the coding for deletion and save.

For insertion I am not getting the expected output.

Could u pls help me?

10 REPLIES 10
Read only

Former Member
0 Likes
904

Hi,

In the PAI module are you modifying/inserting records properly.

Thanks & Regards,

Navneeth K.

Read only

0 Likes
904

Hi,

on Insert click if you are appending blank row to your internal table then in PBO event you need to set toal rows of yout table control is equal to total no. of rows of your internal table.

You can use statement describe table with addition lines to get total no. of rows of internal table.

Regards,

Vishal Jadhav.

Read only

Former Member
0 Likes
904

Insert into the table control or in the database?

Read only

Former Member
0 Likes
904

I need to insert the record into table control.Pls provide the code if possible

Read only

Former Member
0 Likes
904

I used these things in PBO.

The problem is,when I press the INSERT key,the newly added record is not appended to the internal table.

Read only

0 Likes
904

Show your program code regarding the INSERT you mentioned. Maybe we can see what you did wrong or forgot to do.

Read only

Former Member
0 Likes
904

WHEN 'INSR'.

  • To Insert in the internal table

DATA: ls TYPE ly.

IF gt[] IS INITIAL.

INSERT ls INTO lt INDEX 1.

ENDIF.

LOOP AT gt INTO ls.

CLEAR ls.

INSERT ls INTO lt INDEX sy-tabix.

CLEAR ls.

MODIFY gt FROM ls.

CLEAR: ls.

EXIT.

ENDLOOP.

DELETE ADJACENT DUPLICATES FROM gt.

Read only

0 Likes
904

Why don't you just use APPEND instead of INSERT?

Read only

0 Likes
904

In table control, in PAI you modify the table content inside your LOOP WITH CONTROL statement give another button in your menu to save the table. when user press save you use modify database table to update the database table.

Regards,

Jey

Read only

Former Member
0 Likes
904

Resolved