‎2009 Jan 14 10:38 AM
Hi,
I have created table control displaying fields from ztable and now i have created user defined structure containing the same table as structure and one more field is added as MARK for capturing row. Now the problem is when i select one row on table control and scroll down to select another row and again if i scroll up to select another row , its not showing the previous row selected Please provide me solution
Please follow the code for reference.
On screen 0600.
PROCESS BEFORE OUTPUT.
MODULE status_0600.
MODULE fetch_data.
MODULE vertical_scroll2.
LOOP AT it_vnd INTO fl_vnd WITH CONTROL tbl_2.
MODULE display_fetched_data.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0600.
LOOP AT it_vnd.
FIELD fl_vnd-mark
MODULE move_records ON INPUT.
ENDLOOP.
MODULE create_records.
MODULE change_delete.In TOP INCLUDE
TYPES: BEGIN OF zthird.
INCLUDE STRUCTURE zfmmvndrcert.
TYPES: mark TYPE c LENGTH 1.
TYPES: END OF zthird.
CONTROLS : tbl_2 TYPE TABLEVIEW USING SCREEN 0600.
DATA : it_vnd TYPE TABLE OF zthird,
it_evnd TYPE TABLE OF zthird,
it_strd TYPE TABLE OF zthird,
fl_vnd TYPE zthird.
PROCESS BEFORE OUT.
MODULE status_0600 OUTPUT.
DATA l_code TYPE TABLE OF sy-ucomm.
APPEND 'SAVE' TO l_code.
SET PF-STATUS 'ZVNDR' EXCLUDING l_code.
SET TITLEBAR 'ZVND'.
ENDMODULE. " STATUS_0600 OUTPUT
MODULE fetch_data OUTPUT.
SOME DATA FETCHING LOGIC IS THERE BUT NOT INCLUDED
SORT it_vnd BY lifnr cert_number cert_type DESCENDING.
LOOP AT it_strd INTO fl_vnd.
fl_vnd-mark = c_x.
MODIFY it_vnd FROM fl_vnd TRANSPORTING mark WHERE lifnr = fl_vnd-lifnr
AND cert_number = fl_vnd-cert_number
AND cert_type = fl_vnd-cert_type.
CLEAR fl_vnd.
ENDLOOP.
DESCRIBE TABLE it_vnd LINES v_ln.
ENDMODULE. " fetch_data OUTPUT
module vertical_scroll2 output.
describe table it_vnd
lines v_lines.
tbl_2-lines = v_lines + 2.
endmodule. " vertical_scroll2 OUTPUT
MODULE display_fetched_data OUTPUT.
MOVE-CORRESPONDING fl_vnd TO zfmmvndrcert.
CLEAR fl_vnd.
ENDMODULE. " display_fetched_data OUTPUT
PROCESS AFTER INPUT.
MODULE move_records INPUT.
IF v_fl EQ space.
REFRESH : it_evnd,it_strd.
v_fl = c_x.
ENDIF.
MOVE-CORRESPONDING zfmmvndrcert TO fl_vnd.
fl_vnd-mark = c_x.
MODIFY it_vnd FROM fl_vnd TRANSPORTING mark WHERE lifnr = fl_vnd-lifnr.
APPEND fl_vnd to it_strd.
APPEND fl_vnd TO it_evnd.
CLEAR fl_vnd.
DESCRIBE TABLE it_evnd
lines v_ln.
ENDMODULE. " move_records INPUTPlease provide me solution.
Thanks ...
PARAG
Edited by: Matt on Jan 14, 2009 2:02 PM added tag
‎2009 Jan 14 11:09 AM
Open the Layout screen, Double click on Table control( Open the Table Control Properties) and choose Line Sel = Single.
Hope this will solve your problem.
regards,
Jinson
‎2009 Jan 14 11:09 AM
Open the Layout screen, Double click on Table control( Open the Table Control Properties) and choose Line Sel = Single.
Hope this will solve your problem.
regards,
Jinson
‎2009 Jan 14 11:48 AM
Hi,
But i want to select multiple lines for further processing.
Please help me in this issue.
Thanks...
Parag
‎2009 Jan 14 12:39 PM
Ok. So you want to select multiple rows.
For this, add one single char field say SEL in your internal table for table control i.e it_vnd.
Then on your screen layout, table control properties add the field into w/SelName field (IT_VND-SEL).
Now when you select records in the table control, the field SEL will have value X.
Check if the above solution works.
regards,
Jinson
‎2009 Jan 15 10:41 AM
Hi......
While creating the table control with wizard it is in the fifth step
in the Line selectabiliy check the check box Line selection col.
and give the char field in the input field which hold the value of the selected row in the table control.
Also go with the radio button multiple.
This is of great help I believe
Thanks and regards
Bhuvana