07-07-2014 2:49 PM
Hello Every body,
i programmed a ALV Report without selection screen, and i want to create a job for this alv report.
Any help?
Thank u.
Ouail.
07-07-2014 2:53 PM
Hi Ouail,
create program in se38 and create job using sm36 set job running information.
but one thing what is your requirement?
Regards,
Kalyan
07-07-2014 2:53 PM
Hi, if you need to run reportin background. use FM REUSE_ALV_LIST_DISPLAY ,
alv grid not working in backjob
07-07-2014 3:17 PM
Hi,
I'm using this FM:
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
is_layout = alv_layout
i_bypassing_buffer = 'X'
i_callback_program = sy-repid
it_fieldcat = t_alv_fieldcat[]
it_events = it_evt
i_save = 'A'
* IS_VARIANT =
tables
t_outtab = itab. "internal table
but i still not receive any result....
07-07-2014 2:54 PM
Hi Ouail,
if it's not necessary a selection screen you only have to call the report from your job. If you create a selection-screen you could call the report passing a variant name. (Check SM36 transaction)
07-07-2014 3:01 PM
Only Program of type 1 (even without actual selection-screen) or J can be scheduled in a background job, which kind of report did you build ?
You could also create a small executable program (type 1) that call a form/method of your report and use this wrapper to schedule the background job.
Regards,
Raymond
07-07-2014 3:15 PM
Thank u,
I have executable program.
This program compare data and send email to my outlook.
I use the tcode sm36, but i did not receive in result, when i execute manually, i receive the right result.
07-07-2014 3:24 PM
In the report tittle has 'compare file'.
If your program read a file, and works in foreground but not in background, check if in background mode the file is available in server and you are using open dataset statement.
07-07-2014 3:25 PM
Check
Regards,
Raymond
07-07-2014 7:25 PM
Hi Ouail,
Please provide more details..
Is it like you are not getting any mail alert or spllo is not getting generated in sm37.
Please configure your job via SM36 for that u can use job wizard button.
Regards,
Kannan
07-08-2014 10:35 AM
Hi,
I used with job wizard button, but i'm receiving cancelled Status.
Via ST22 i receive: Exception condition "CONTROL_FLUSH_ERROR" raised.
in my program, i upload 2 xml files to 2 internal table, and i do compare between the both file, at the end i show the compare result in ALV.
this is the code used to upload the xml file:
create object gcl_xml.
*Upload XML File
call method gcl_xml->import_from_file
exporting
filename = p_filref
receiving
retcode = gv_subrc.
if gv_subrc = 0.
call method gcl_xml->render_2_xstring
importing
retcode = gv_subrc
stream = gv_xml_string
size = gv_size.
if gv_subrc = 0.
refresh gt_xml_data[].
* Convert XML to internal table
call function 'SMUM_XML_PARSE'
exporting
xml_input = gv_xml_string
tables
xml_table = gt_xml_data
return = gt_return.
endif.
endif.
Any idea?
07-08-2014 11:19 AM
Hello,
In my program i do a download file(xml) to local pc.
now, i receive that error, displayed by tcode sm21:
Any idea?
i have also that error: raise control_flush_error.
07-08-2014 9:06 PM
It's not feasible to download a file to local PC in a background job. This has been discussed many times on SCN, please use search.
07-09-2014 10:40 AM
Thank u,
There is a way to run my program automatically without using background job ?
07-09-2014 10:48 AM
No way for automatic execution of a program in foreground, it would be better if you use the same program in background and download the file to the Application server instead of Presentation. that should solve the problem.
07-09-2014 11:02 AM
Hi Syed,
I deed it right now, but i still have the same error.
Using download in Application server In foreground works good, but not in Background ...
07-11-2014 9:51 AM
Hi Syed,
When i used the application server, i receive that error: Virus scan profile /SCET/GUI_UPLOAD is not active
Do you have any idea?
07-09-2014 10:46 AM
you can run any custom alv in background, I have several each night.
The key thing is to ensure this bit of coding is in place with the OO grid model...
look at this example below...the bit that's important is the offline check....this prevents the framework issue with enjoi controls in background:
">>>>this bit
if cl_gui_alv_grid=>offline( ) is initial.
create object _o_cont
exporting
container_name = zcl_constants=>c_cont.
endif.
"<<<this bit
you cant save a file on the PC in background....but you can create a file on a server....which I also do in a method using open dataset.....
working example....
if sy-batch is not initial.
"automate file extract if run in background mode
_extract_data_to_file( ).
endif.
if _o_cont is not bound.
if cl_gui_alv_grid=>offline( ) is initial.
create object _o_cont
exporting
container_name = zcl_constants=>c_cont.
endif.
create object _o_grid
exporting
i_parent = _o_cont.
_o_grid->set_table_for_first_display(
exporting
i_save = zcl_constants=>c_a
is_variant = gs_variant
is_layout = gs_layout
it_toolbar_excluding = gt_toolbar_exc
changing
it_fieldcatalog = gt_fieldcat
it_outtab = <table> ).
etc.....
07-09-2014 11:11 AM
Hi Steve,
Can you tell me where i have to put your code?
this is my abap code:
START-OF-SELECTION.
p_filref = '\\SAPSERVER\f\SAFT\ivat\FI_Extract_1000_20140709_102346_910.XML'.
PERFORM copy_from_xml_to_itab TABLES it_ref_file
ref_xml_data
USING p_filref.
**Begin Extraction File
SUBMIT ZZ_FI_IVAT_EXTRACTOR
WITH p_bukrs EQ '1000'
WITH p_gjahr EQ '1998'
WITH filepath EQ '\\SAPSERVER\f\SAFT\iVAT_Extractie\'
WITH cldata eq space
AND RETURN.
DATA: FILE_TABLE TYPE TABLE OF SDOKPATH,
DIR_TABLE TYPE TABLE OF SDOKPATH.
CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
EXPORTING
DIRECTORY = '\\SAPSERVER\f\SAFT\iVAT_Extractie\'
FILTER = '*.*'
TABLES
FILE_TABLE = FILE_TABLE
DIR_TABLE = DIR_TABLE
EXCEPTIONS
CNTL_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
"get file name
LOOP AT FILE_TABLE INTO p_filref.
ENDLOOP.
CONCATENATE '\\SAPSERVER\f\SAFT\iVAT_Extractie\' p_filref INTO path.
PERFORM copy_from_xml_to_itab TABLES t_ext_file
ext_xml_data
USING path.
PERFORM fill_xml_tab_in .
perform build_fieldcatalog.
PERFORM compare_data_ref_ext.
PERFORM send_email.
perform display_alv_report.
PERFORM delete_extraction_file.
in the perform copy_from_xml_to_itab TABLES it_ref_file......, i use this code:
CREATE OBJECT gcl_xml.
*Upload XML File
CALL METHOD gcl_xml->import_from_file
EXPORTING
filename = p_filref
RECEIVING
retcode = gv_subrc.
IF gv_subrc = 0.
CALL METHOD gcl_xml->render_2_xstring
IMPORTING
retcode = gv_subrc
stream = gv_xml_string
size = gv_size.
IF gv_subrc = 0.
REFRESH gt_xml_data[].
* Convert XML to internal table
CALL FUNCTION 'SMUM_XML_PARSE'
EXPORTING
xml_input = gv_xml_string
TABLES
xml_table = gt_xml_data
return = gt_return.
ENDIF.
ENDIF.