2008 Jul 28 2:04 PM
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
2008 Jul 28 2:21 PM
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
2008 Jul 28 2:21 PM
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
2008 Jul 28 2:29 PM
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
2008 Jul 28 2:45 PM
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.
2008 Jul 28 3:42 PM
2008 Jul 29 2:20 PM