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 does nt Hold data?

NR_Ranasingh
Participant
0 Likes
1,055

Hi,

As per my requirement , i hav a TABLE CONTROL in my screen.

But when i save the data in those field , d dats gets cleared from the TABCONTROL fields on screen.

whts the way to save the data on the TABCONTROL fields. ? without duplicacy.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
816

Hello Sagar,

In you PAI MODULE within loop end loop add this code.

MODULE refresh_itab.

LOOP AT itab.

CHAIN.

FIELD <field1>.

FIELD <field2>.

FIELD <field3>.

FIELD <field4>.

MODULE capture_data.

ENDCHAIN.

ENDLOOP.

-


MODULE refresh_itab.

REFRESH <your interal table>

ENDMODULE.

MODULE capture_data.

MOVE <tablecontrol data> to <your work area>.

APPEND <your work area> to <internal table>.

ENDMODULE.

-


You need to add the CHAIN ENDCHAIN thing within loop coz it prevents data from getting refreshed/cleared.

Hope this solves your issue. Please revert back incase the problem persists.

Cheers,

Suvendu

Edited by: Suvendu Swain on Jun 8, 2009 1:27 PM

6 REPLIES 6
Read only

Former Member
0 Likes
817

Hello Sagar,

In you PAI MODULE within loop end loop add this code.

MODULE refresh_itab.

LOOP AT itab.

CHAIN.

FIELD <field1>.

FIELD <field2>.

FIELD <field3>.

FIELD <field4>.

MODULE capture_data.

ENDCHAIN.

ENDLOOP.

-


MODULE refresh_itab.

REFRESH <your interal table>

ENDMODULE.

MODULE capture_data.

MOVE <tablecontrol data> to <your work area>.

APPEND <your work area> to <internal table>.

ENDMODULE.

-


You need to add the CHAIN ENDCHAIN thing within loop coz it prevents data from getting refreshed/cleared.

Hope this solves your issue. Please revert back incase the problem persists.

Cheers,

Suvendu

Edited by: Suvendu Swain on Jun 8, 2009 1:27 PM

Read only

Former Member
0 Likes
816

Hi ,

First check the data is moving to TABLE control in Debug mode.

If so ,please check your sy-ucomm clearence.

Read only

Former Member
0 Likes
816

in pai of the screen between loop-endloop statement write code like

you might not updating those field to itab.


process after input
Loop at itab.
module update_itab.
endloop.

now in


Module update_itab.
 modify itab index tc-current_line.
if sy-subrc ne 0.
   append itab.
endif.
end module

.

Read only

Former Member
0 Likes
816

Hi Sagar,

You need to append the Table control data to an internal table,

for that create an module in the PAI loop and endloop, and code like this,

IF NOT x_assignment-employee_id IS INITIAL AND NOT x_assignment-activity IS INITIAL.

MODIFY t_assignment FROM x_assignment INDEX tablecontrol-current_line.

IF sy-subrc NE 0.

APPEND x_assignment TO t_assignment.

ENDIF.

ENDIF.

Read only

0 Likes
816

You must be using a loop to read your control data. In each loop pass your control will give you next entry, so you need to append every time in each loop pass.

Read only

NR_Ranasingh
Participant
0 Likes
816

yes, i solved it..