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 : add new and change existing

Former Member
0 Kudos

Hi all,

I am working on Dialog programming. I am confused as of how I would be able to add a new record to a table which already has few records in it and also when necessary change the contents of the existing record.

Please let me know, thanks so much in advance.

Step by step explanation would be really helpful along with sample code.

Thanks!

4 REPLIES 4

Former Member
0 Kudos

hi Shekar,

To add a line in a table control which already has some data use following code in your PBO.

describe table <itab> lines l_lines. "itab is the table used to display ur table control)

tcontrol-lines = l_lines + 1.

In PAI of your screen loop at the table control and save it the table you want.

This will help you in both adding and modifying an already existing data.

Thanks,

Arun

0 Kudos

Thankyou Arun!

Could you tell me how I can add a new record?

Thanks!

0 Kudos

I hope u have Add button in your GUI_STATUS.

if the button is clicked,

do this in your PBO.

desc table itab lines l_lines.

tccontrol-lines = l_lines + 1.

This code will help you in adding new line to your table control.

When user enters and value and presses save,

do the following in your PAI.

loop at itab.

modify table itab.

endloop.

case okcode.

when okcode = 'SAVE'.

modify dbtab from itab.

endcase.

The modify dbtab will add new records and modify existing records in your database table.

Thanks,

Arun

Former Member
0 Kudos

Hi,

Refer to the sample program RSDEMO02

Regards,

Renjith Michael.