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: Entry gets Cleared from the Table Control

Former Member
0 Likes
713

In my Dialog program I have used a table-control to let the user enter records.But after entering the record and without actually saving if I press the Enter key, the whole entry gets cleared from the table-control, but the entry gets saved in the table. I wish the entry to remain there in the table-control.

How to tackle this please suggest.

Alok

4 REPLIES 4
Read only

gopi_narendra
Active Contributor
0 Likes
589

make sure u use the MODIFY statement in the PAI of the table control.

for better understanding teh table control see the programs

demo_dynpro_tabcont_loop

demo_dynpro_tabcont_loop_at.

RSDEMO_TABLE_CONTROL

Regards

- Gopi

Read only

Former Member
0 Likes
589

Hi Alok,

Please refer the below thread,

I hope this helps.

Regards,

Hema.

    • Reward points if it is useful.

Read only

Former Member
0 Likes
589

Also, refer the below link where a similar problem is resolved,

Regards,

Hema.

    • Reward points if it is useful.

Read only

anversha_s
Active Contributor
0 Likes
589

hi,

kindly chk this.

PROCESS BEFORE OUTPUT.
MODULE status_9010.

LOOP WITH CONTROL tab_control.
MODULE move_data_to_table.
ENDLOOP.


PROCESS AFTER INPUT.

LOOP WITH CONTROL tab_control.
MODULE move_data_from_table.
ENDLOOP.


****************************


*&---------------------------------------------------------------------*
*& Module move_data_to_table OUTPUT
*&---------------------------------------------------------------------*
* This is to move the data from the internal table to the table control
*----------------------------------------------------------------------*
MODULE move_data_to_table OUTPUT.

* This is to move the data from the internal table to the table control
*zmpets_mode-modecode,zmpets_range-*rangeid,zmpets_servfacto-factor are column name of table control

READ TABLE int_factor INDEX tab_control-current_line.
IF sy-subrc = 0.
zmpets_mode-modecode = int_factor-modecode.
zmpets_range-rangeid = int_factor-rangeid.
zmpets_servfacto-factor = int_factor-factor.
ENDIF.

ENDMODULE. " move_data_to_table OUTPUT



**********************



*&---------------------------------------------------------------------*
*& Module move_data_from_table INPUT
*&---------------------------------------------------------------------*
* Date is moved from the table control to the Internal Table
*----------------------------------------------------------------------*
MODULE move_data_from_table INPUT.

* To move the data from the table control to internal table 'INT_FACTOR'.

int_factor-modecode = zmpets_mode-modecode.
int_factor-rangeid = zmpets_range-rangeid.
int_factor-factor = zmpets_servfacto-factor.
*here if the data is there, it will modify
MODIFY int_factor INDEX tab_control-current_line.
IF sy-subrc NE 0. "data not exixting in table control . ie new data, then append it
APPEND int_factor.
CLEAR int_factor.
ENDIF.

ENDMODULE. " move_data_from_table INPUT

for any clarifiaction pls mail me.

pls reward points, if this helped u.

regards,

Anver