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: 

problem in displaying o/p in Table Control

Former Member
0 Kudos
296

Hi ,

while displaying in table control.

its is displaying line twice.

I have some contains in iti itab.

which i am displaying itf itab through table control..

i have coded like this...

PROCESS BEFORE OUTPUT.

MODULE STATUS_0112.

LOOP at itf WITH CONTROL TC CURSOR tc-current_line.

MODULE FILL_TABLE_CONTROL.

ENDLOOP.

*

PROCESS AFTER INPUT.

MODULE CANCEL AT EXIT-COMMAND.

LOOP at itf.

module read_table_INPUT.

ENDLOOP.

MODULE USER_COMMAND_0112.

*&----


-


*

*& Module STATUS_0112 OUTPUT

&----


  • text

----


MODULE STATUS_0112 OUTPUT.

SET PF-STATUS 'ZTC'.

  • SET TITLEBAR 'xxx'.

DESCRIBE TABLE iti LINES tc-lines.

ENDMODULE. " STATUS_0112 OUTPUT

----


  • MODULE fill_table_control OUTPUT

----


*

----


MODULE fill_table_control OUTPUT.

loop at iti .

READ TABLE itf with key ingr_code = iti-ingr_code

ingr_desc = iti-ingr_desc.

MOVE iti-INGR_CODE TO ITF-INGR_CODE.

MOVE iti-INGR_DESC TO ITF-INGR_DESC.

MOVE iti-CONC TO ITF-CONC.

MOVE iti-QUANTITY TO ITF-QUANTITY.

MOVE iti-UOM TO ITF-UOM.

append ITF ."index tc-current_line.

endloop.

ENDMODULE. "fill_table_control OUTPUT

can any one help me

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos
266

Add the check for successful read by using the SY-SUBRC.

Like:


MODULE fill_table_control OUTPUT.
loop at iti .

READ TABLE itf with key ingr_code = iti-ingr_code
ingr_desc = iti-ingr_desc.

IF SY-SUBRC NE 0.
MOVE iti-INGR_CODE TO ITF-INGR_CODE.
MOVE iti-INGR_DESC TO ITF-INGR_DESC.
MOVE iti-CONC TO ITF-CONC.
MOVE iti-QUANTITY TO ITF-QUANTITY.
MOVE iti-UOM TO ITF-UOM.
append ITF ."index tc-current_line.
ENDIF.
endloop.

Regards,

Naimesh Patel

5 REPLIES 5

naimesh_patel
Active Contributor
0 Kudos
267

Add the check for successful read by using the SY-SUBRC.

Like:


MODULE fill_table_control OUTPUT.
loop at iti .

READ TABLE itf with key ingr_code = iti-ingr_code
ingr_desc = iti-ingr_desc.

IF SY-SUBRC NE 0.
MOVE iti-INGR_CODE TO ITF-INGR_CODE.
MOVE iti-INGR_DESC TO ITF-INGR_DESC.
MOVE iti-CONC TO ITF-CONC.
MOVE iti-QUANTITY TO ITF-QUANTITY.
MOVE iti-UOM TO ITF-UOM.
append ITF ."index tc-current_line.
ENDIF.
endloop.

Regards,

Naimesh Patel

former_member188685
Active Contributor
0 Kudos
266
loop at iti .

READ TABLE itf with key ingr_code = iti-ingr_code
ingr_desc = iti-ingr_desc.

MOVE iti-INGR_CODE TO ITF-INGR_CODE.
MOVE iti-INGR_DESC TO ITF-INGR_DESC.
MOVE iti-CONC TO ITF-CONC.
MOVE iti-QUANTITY TO ITF-QUANTITY.
MOVE iti-UOM TO ITF-UOM.
append ITF ."index tc-current_line.

endloop

You dont need to append the data , you have to Modify the data.

Problem is with the above code.

Correct to this...

MODULE fill_table_control OUTPUT.

READ TABLE itf index tc-current_line.
MOVE iti-INGR_CODE TO ITF-INGR_CODE.
MOVE iti-INGR_DESC TO ITF-INGR_DESC.
MOVE iti-CONC TO ITF-CONC.
MOVE iti-QUANTITY TO ITF-QUANTITY.
MOVE iti-UOM TO ITF-UOM.

endloop.

ENDMODULE. "fill_table_control OUTPUT

Regards

Vijay Babu Dudla

0 Kudos
266

Hi vijay,

My itf table is empty so i have to append

contains in itf display throught TC but if a use modify

while reading it is just coming in header line

& second line modifys first line &

it display 2 line twice.

0 Kudos
266

Check the Demo Example

RSDEMO_TABLE_CONTROL

Former Member
0 Kudos
266

Hi ,

Thanks for ur reply