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
893

Hi,

I have an editable table control.

I will have some data in the table at the first.

When I make a change to the data in the table control i want that to be modified in the Custom Table.

How do I capture the data from the Table Control and update the same in the Database.

Please help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
873

pbo of screen

PROCESS BEFORE OUTPUT.

MODULE status_0100.

LOOP AT it_input INTO wa_input WITH CONTROL tcl_inputs.

MODULE read_table_control.

ENDLOOP.

MODULE read_table_control OUTPUT.

READ TABLE it_input INTO wa_input INDEX tcl_inputs-current_line.

ENDMODULE.

12 REPLIES 12
Read only

Former Member
0 Likes
873

Hi,

Table control data is ultimetly maintained in Internal table only. You can take internal table row into work area and read it into screen flow logic. and same area you can update it into database.

Reward if useful!

Read only

Former Member
0 Likes
873

Hi,

Table control data is ultimetly maintained in Internal table only. You can take internal table row into work area and read it into screen flow logic. and same area you can update it into database.

Reward if useful!

Read only

0 Likes
873

I dont seed the modified data in the internal table.

I see the old data itself.

Can you give me the steps please?

Read only

0 Likes
873
Read only

0 Likes
873

hi Supriya..

To Update the ITAB in PAI .

PROCESS AFTER INPUT.

LOOP AT ITAB.

MODULE SAVE_ITAB.

ENDLOOP.

MODULE SAVE_DB.

In the Module pool:

MODULE SAVE_ITAB input.

MODIFY ITAB FROM WA. "WA is the Workarea of Table control

ENDMODULE.

MODULE SAVE_DB input.

update <DBTable> from table itab.

ENDMODULE.

<b>Reward if Helpful.</b>

Read only

Former Member
0 Likes
873

Hi,

Table control data is ultimetly maintained in Internal table only. You can take internal table row into work area and read it into screen flow logic. and same area you can update it into database.

Reward if useful!

Read only

Former Member
0 Likes
873

Hi

your table control will be acting like an internal table.

consider your table control refers to an internal table 'itab'.

so if you change the values in the table control, it affects the internal table too.

so you can use the syntax modify <dbtab> from table <itab>.

Reward if usefull

Read only

Former Member
0 Likes
874

pbo of screen

PROCESS BEFORE OUTPUT.

MODULE status_0100.

LOOP AT it_input INTO wa_input WITH CONTROL tcl_inputs.

MODULE read_table_control.

ENDLOOP.

MODULE read_table_control OUTPUT.

READ TABLE it_input INTO wa_input INDEX tcl_inputs-current_line.

ENDMODULE.

Read only

Former Member
0 Likes
873

Under the PAI Between loop and endloop of the Table control just add a module and just write a MODIFY With the work.

ex

process after input.

loop at it_ekko.

module user_command_0100.

endloop.

Module User_command_0100 input.

modify it_ekko.

Endmodule.

Read only

Former Member
0 Likes
873

Hi Supriya,

you can capture the data from table control using the name of that editable field.

then you pass that value to other variable and from that you can udate the same in your database table.

Regards,

Bharat.

      • Reward points if helpful

Read only

Former Member
0 Likes
873

Go to following link

http://sapmaterial.com/files/database_update.pdf

Regards

Vasu

Read only

Former Member
0 Likes
873

Hi Supriya,

I the PAI of ur screen, u must be looping on the internal table which is displayed. Use CHAIN-ENDCHAIN commands, so that the new data is populated in the same internal table.

For more info. refer the documentation for the CHAIN-ENDCHAIN (Press F1).

Please let me know in case of concerns.

Award points if u have found a way to ur problem.

Thank you.