Application Development 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: 

Table control

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

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

Thanks & Regards,

Navneeth K.

0 Kudos

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.

Former Member
0 Kudos

Insert into the table control or in the database?

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

Resolved