‎2009 Apr 28 10:34 AM
Hi,
My requirement is,
i picked the data acoording to purchase document No.dynamically in a table control,and i saved it into a ztable,so according to that purchase doc No. the line items have displayed in a table control but i dont want to save all line items which comes from purchase doc no. for example
for pur.doc.No :100
i will get 10 line items in that i want to save only 5 line items remainig have to be deleted.
and one more requirement is how to put vertical scroll arrows.
waiting for ur reply,.....
Thanks & Regards,
‎2009 Apr 28 10:56 AM
Hi.
At PBO before passing data in a internal table to Table control you need to delete data which are
you don't want to display from the internal table before display to output screen.
Hope it helps.
Sayan
‎2009 Apr 28 12:03 PM
hi
have a Tab selection for table control, with that u can select the required rows
and only those rows gets saved to the database table,also u can delete the unwanted rows
from the table control.
simple coding for ur refrerence
program ycoe_module29 message-id zmsg.
data : begin of i_ysrtmm occurs 0,
sno type ysrtmm-sno,
sname type ysrtmm-sname,
scity type ysrtmm-scity,
sedu type ysrtmm-sedu,
spercent type ysrtmm-spercent,
select(1),
end of i_ysrtmm.
data : i_ysrtmm1 like i_ysrtmm occurs 0 with header line.
SE51
process before output.
module status_8000.
loop with control control.
module fill_table_control.
endloop.
process after input.
loop with control control.
module read_table_control.
endloop.
module user_command_8000.
PBO
module status_8000 output.
set pf-status 'STAT29'.
describe table i_ysrtmm1 lines lines.
control-lines = lines.
endmodule. " STATUS_8000 OUTPUT
module fill_table_control output.
describe table i_ysrtmm1 lines wk_init.
if wk_init is not initial.
read table i_ysrtmm1 into i_ysrtmm index control-current_line.
endif.
endmodule.
PAI
module read_table_control input.
lines = sy-loopc.
read table i_ysrtmm1 index control-current_line.
if sy-subrc eq 0.
modify i_ysrtmm1 from i_ysrtmm index control-current_line.
else.
move-corresponding i_ysrtmm to i_ysrtmm1.
append i_ysrtmm1.
clear i_ysrtmm.
endif.
endmodule.
module user_command_8000 input.
case sy-ucomm.
when 'INSE'.
loop at i_ysrtmm1.
i_final-mandt = sy-mandt.
i_final-sno = i_ysrtmm1-sno.
i_final-sname = i_ysrtmm1-sname.
i_final-scity = i_ysrtmm1-scity.
i_final-sedu = i_ysrtmm1-sedu.
i_final-spercent = i_ysrtmm1-spercent.
append i_final.
clear : i_final.
endloop.
select sno sname scity sedu spercent
from ysrtmm into table i_check for all
entries in i_final where sno = i_final-sno.
if sy-subrc ne 0.
if i_final[] is not initial.
insert ysrtmm from table i_final.
if sy-subrc eq 0.
commit work.
message i010.
clear : i_ysrtmm,i_ysrtmm1,i_final.
refresh : i_ysrtmm,i_ysrtmm1,i_final.
leave screen.
else.
rollback work.
endif.
endif.
endif.
when 'DELE'.
delete i_ysrtmm1 where select = 'X'.
endcase.
endmodule.
Regards
‎2009 Apr 28 5:04 PM
Hi Ali
Answer to your second question.
PLease add this codes in PBO to get the scroll bar.
data : line type i.
DESCRIBE TABLE itab LINES line.
tablecontrol-lines = line + 10.
.
Your First Question is not clear are you using standard tcode to display the contents or you r using a Z modulepool.
Incae you r using a zmodule pool then you can delete the contents as per your requirement.
Incase of standard program you need to find a Userexit or BAdi and delete the unsed data before getting displayed.
Hope this will solve your problem
Cheers
Suvendu
‎2009 Apr 29 6:27 AM
Thanks for ur reply,
I get the scroll bar(Vertical) in a table control for my second question with your help.
but its not working..
Regards,