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 problem

Former Member
0 Kudos
70

Hi all,

I have more than 100 records in my table control output. i can scroll down to view all records. If i modify the records in the output using a modify button, the records which are in display initially are only present. if i scroll down the records below are lost. Can any one help me to solve this problem.

(iam able to view 14 records initially and can scroll down to view further, but after modify, other than the 14 records all records are lost)

Thanks,

Rajesh.

1 ACCEPTED SOLUTION

anversha_s
Active Contributor
0 Kudos
41

hi,

u just debug ur program.

u can see, after modification the new record are not filled in the table control internal table.

kindly chk this sample.

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

<b>MODIFY int_factor INDEX tab_control-current_line.</b>

<b>IF sy-subrc NE 0. "data not exixting in table control . ie new data, then append it

APPEND int_factor.

CLEAR int_factor.

ENDIF</b>.

ENDMODULE. " move_data_from_table INPUT

for any clarifiaction pls mail me.

pls reward points, if this helped u.

regards,

anversha.

Message was edited by: Anversha s

4 REPLIES 4

anversha_s
Active Contributor
0 Kudos
42

hi,

u just debug ur program.

u can see, after modification the new record are not filled in the table control internal table.

kindly chk this sample.

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

<b>MODIFY int_factor INDEX tab_control-current_line.</b>

<b>IF sy-subrc NE 0. "data not exixting in table control . ie new data, then append it

APPEND int_factor.

CLEAR int_factor.

ENDIF</b>.

ENDMODULE. " move_data_from_table INPUT

for any clarifiaction pls mail me.

pls reward points, if this helped u.

regards,

anversha.

Message was edited by: Anversha s

0 Kudos
41

hi,

This particular code does not loop correctly. i have 45 records in my table control. but the loop is only for 14 records.

PROCESS AFTER INPUT.

LOOP WITH CONTROL tab_control.

MODULE move_data_from_table.

ENDLOOP.

Please send your suggestions,

Thanks,

Rajesh.

0 Kudos
41

hi,

do this.

<b>PROCESS BEFORE OUTPUT.

MODULE status_9010.</b>

&----


*

*& Module STATUS_9010 OUTPUT

&----


  • text

----


MODULE status_9010 OUTPUT.

SET PF-STATUS 'STD_BAR'.

SET TITLEBAR 'TITLE_CREATE'.

<b> CLEAR wf_lines.

*number of lines of table control

DESCRIBE TABLE int_factor LINES wf_lines.

tab_control-lines = wf_lines + 1.

</b>

ENDMODULE. " STATUS_9010 OUTPUT

rgds

anver

Message was edited by: Anversha s

0 Kudos
41

Thanks a lot anver.

Rajesh.