on 06-10-2007 6:53 PM
Hello All,
Happy Monday morning...!
My requirement : Pass a variable to the iterator class's RENDER_CELL_START method...such that it should change dynamically for every ROW...
O.K. i did my part of searching and found
And as mentioned, I chose to create a public attribute(RG_ID) of my iterator class, and then in my layout called it as follows :
<%
loop at itab into wa.
clear wa.
read table itab into wa index sy-tabix.
lw_iterator->RG_ID = wa-RG_ID.
endloop.
%>
<htmlb:tableView id = "TV1"
table = "<%= gt_exc_tab_mod %>"
iterator = "<%= lw_iterator %>"
selectionMode = "MULTILINEEDIT"
keepSelectedRow = "TRUE"
filter = "SERVER" />
But the problem with this is that it is just passing the last RG_ID to the RENDER_CELL_START...!
I understand that the logic used by me is incorrect...but right now can't think of anything else...!
Please help..!! a bit of URGENT..!!
Thanks,
Tatvagna Shah.
hello Tatvagna,
u can set the value of public attribute inside RENDER_ROW_START method. u can say
me->RG_ID = sy-tabix. This will set its value per new row and u can use the same inside ur RENDER_CELL_START.
Regards
Rajeev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Finally, what I am doing is that getting the parameter in CONSTRUCTOR method...!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
create a constructor method with importing parameter similar to itab for your class and while instantiating the iterator pass your itab and now within iterator you can apply the logic of
read table itab into wa index sy-tabix.
lw_iterator->RG_ID = wa-RG_ID.
Raja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raja,
Had thought of the same thing before i posted this...atleast am thinking like you...that in intself is my success..!
The only problem was that i will have to create a table-type...in DDIC....coz. i tried using generic type TABLE but it is not accepting it....gives error while activating...
Actually i have already used the method...but i guess the problem will come when i will filter....coz, once a filter is applied, then the whole itab passed to TV will change...and then it will be difficult for me to implement the logic...!
Hope u get my point..!
Any pointers or any push in the correct directionm will be greatful...!
Thanks in Advance,
Tatvagna Shah.
<i>The only problem was that i will have to create a table-type...in DDIC....coz. i tried using generic type TABLE but it is not accepting it....gives error while activating...</i>
to over come this, declare the importing parameter as type ref to data.
in your application (bsp) before instatiating the iterator class.
get your itab into a varialbe of type type ref to data
data: outputtab type ref to data.
get reference of <itab> into outputtab .
now you can pass outputtab to importing parameter (which is a variable of type type ref to data) of your constructor class.
to get it back into a itab in your iterator class , you can use the following code
field-symbols: <outtab> type any table .
assign outdref->* to <outtab> .
(outdref is the import parameter of your constructor class.)
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.