01-09-2008 4:17 PM
Hi
I'm using OO in background via the OFFLINE method but the program still won't run in the background
any idea what's wrong as this IMO should work according to the "sparse" documentation available.
Here's the relevant bit of code
MODULE status_0100 OUTPUT.
data: off type int4.
if sy-batch = 'X'.
CALL METHOD cl_gui_alv_grid=>offline
RECEIVING
e_offline = off.
endif.
IF grid_container1 IS INITIAL.
CREATE OBJECT grid_container1
EXPORTING
container_name = 'CCONTAINER1'.
CREATE OBJECT grid1
EXPORTING
i_parent = grid_container1.
struct_grid_lset-edit = 'X'. "To enable editing in ALV
CALL METHOD grid1->set_table_for_first_display
EXPORTING is_layout = struct_grid_lset
CHANGING
it_outtab = <dyn_table>
it_fieldcatalog = it_fldcat.
ENDIF.
SET PF-STATUS '001'.
SET TITLEBAR '000'.
ENDMODULE.
Cheers
jimbo
01-09-2008 8:58 PM
Hello James
I have not yet used ALV list in background but I found the solution in thread:
[background processing in ALV Oops|;
According to the answer in this thread you have to change your coding like this:
" Create container only in dialog, not in background
IF ( off IS INITIAL ).
CREATE OBJECT grid_container1
EXPORTING
container_name = 'CCONTAINER1'.
CREATE OBJECT grid1
EXPORTING
i_parent = grid_container1.
ENDIF.
CREATE OBJECT grid1
EXPORTING
i_parent = grid_container1. " container initial in background!
...
Regards,
Uwe
01-09-2008 8:58 PM
Hello James
I have not yet used ALV list in background but I found the solution in thread:
[background processing in ALV Oops|;
According to the answer in this thread you have to change your coding like this:
" Create container only in dialog, not in background
IF ( off IS INITIAL ).
CREATE OBJECT grid_container1
EXPORTING
container_name = 'CCONTAINER1'.
CREATE OBJECT grid1
EXPORTING
i_parent = grid_container1.
ENDIF.
CREATE OBJECT grid1
EXPORTING
i_parent = grid_container1. " container initial in background!
...
Regards,
Uwe
01-10-2008 8:21 AM
Hi uwe
thanks -- that solved it.
Points awarded.
I don't often run this stuff in background but just sometimes we need it for a long running job
Cheers
jimbo
01-10-2008 10:51 AM
Hello James
Thank you for the confirmation. So I know that it works even if I have never used it (yet).
Kind Regards,
Uwe