2007 Aug 14 3:10 PM
Hi,
I have a screen with a I/O textfield and a custom container.
It's supposed to list in alv the table that's in the textfield.
I'm using the cl_salv_table class to display the alv, it works fine the first time but when I change the name at the textfield it just do nothing.
the t_table parameter is always correct when it reaches the method factory.
I'm kinda lost, I've tried many things but nothing seems to work.
here's my source code:
DATA: CC_1400_REG type ref to cl_gui_custom_container.
data: gr_table2 type ref to cl_salv_table.
check not io_tabname is initial.
IF not gr_table2 IS initial.
gr_table2->refresh( ).
else.
create object CC_1400_REG
exporting
container_name = 'CC_1400_REG'.
TRY.
CALL METHOD cl_salv_table=>factory
exporting
r_container = CC_1400_REG
container_name = 'CC_1400_REG'
importing
r_salv_table = gr_table2
changing
t_table = <TABLE>.
CATCH CX_SALV_MSG.
ENDTRY.
gr_table2->display( ).
endif.is a fs pointing to a dinamicly created internal table.
i've already tried to free the container and the cl_salv_table each time PBO is executed but nothing works...
those anybody knows how can I solve this?
best regards,
André Costa
2007 Aug 14 3:20 PM
You are going to want to destroy all of the objects every time the PBO is fired. It is the easiest way to rebuild the ALV. Make sure that you are clearing(CLEAR) the reference variables as well as freeing(FREE) them.
Regards,
Rich Heilman
2007 Aug 14 3:18 PM
Hi,
Refresh the container and dynamic internal table.
Your code for generating the new ALV list should be in PBO.
I think the dynamic internal table is not regenerated.You can check this in debugging mode.
Reward if helpful.
2007 Aug 14 3:20 PM
2007 Aug 14 3:28 PM
Uma sankar . S : Could you tell me how to refresh the container?
Rich Heilman : Still not working... here's my code with "your" changes:
DATA: CC_1400_REG type ref to cl_gui_custom_container.
data: gr_table2 type ref to cl_salv_table.
check not io_1400_nome is initial.
FREE gr_table2.
FREE CC_1400_REG.
create object CC_1400_REG
exporting
container_name = 'CC_1400_REG'.
TRY.
CALL METHOD cl_salv_table=>factory
exporting
r_container = CC_1400_REG
container_name = 'CC_1400_REG'
importing
r_salv_table = gr_table2
changing
t_table = <TABLE>.
CATCH CX_SALV_MSG.
ENDTRY.
gr_table2->display( ).The internal table <table> is reaching this point properly...
Message was edited by:
Andr Costa
2007 Aug 14 3:51 PM
Try this.....
DATA: CC_1400_REG type ref to cl_gui_custom_container.
data: gr_table2 type ref to cl_salv_table.
CLEAR gr_table2. FREE gr_table2.
CLEAR CC_1400_REG. FREE CC_1400_REG.
check not io_1400_nome is initial.
* move clear and free before this CHECK statement.
Or are these defined directly in the module of the PBO?
Regards,
Rich Heilman
2007 Aug 14 4:00 PM
no... still not working...
and no, this is from a FORM called at PBO.
and btw, the check statement is just to avoid the shortdump at the first call of the screen (because there is no name at that field...)
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |