Download Background job output to Excel automatically
Dear Experts,
Hi there... Please note the following scenarion and give me your expert solutions on the same...
I have created a SALES QUANTITY REPORT for exports... In this there are many conditions applied to achieve data in many of the columns of this report. If we run it for 2-3 months it is not a problem... The output comes at a marginal wait time... But the moment it is run for a whole year then it just goes on and on.... I cannot fine tune also.... because of the conditions... For better performance and fast retrieval i have used views in this report to achieve quick output...
The thing is when i put it to execute in Background it comes within an hour or so... But the output is not readable.... so here is what i want:
1. First of all why report executes so quickly when put in background, whereas in foreground it takes more than 4 hours and also no guarantee of output.. This is to satisfy my curiosity...
2. I want the output to get automatically converted into excel and get stored in a specific folder the moment the job is finished in background without any format getting disturbed. The report is prepared in ALV...
Please gurus help me out.
Thanks...
Jitesh
It is giving me the following error: -
17.02.2009 11:24:41 Job started 00 516 S
17.02.2009 11:24:41 Step 001 started (program Z_SD_SQR_EXPORT, variant &0000000000007, user ID JBABAP) 00 550 S
17.02.2009 11:24:45 Incorrect Print Parameter 0K 091 I
17.02.2009 11:24:45 Spool request (number 0000014520) created without immediate output SY 355 S
17.02.2009 11:24:45 Excel file c:\sqr\sqrexport.xls cannot be processed UX 893 E
17.02.2009 11:24:45 Job cancelled after system exception ERROR_MESSAGE 00 564 A
form DOWNLOAD .
CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
EXPORTING
* I_FIELD_SEPERATOR =
* I_LINE_HEADER =
i_filename = 'c:\sqr\sqrexport.xls'
* I_APPL_KEEP = ' '
tables
i_tab_sap_data = it_final
* CHANGING
* I_TAB_CONVERTED_DATA =
* EXCEPTIONS
* CONVERSION_FAILED = 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.
endform. " DOWNLOAD
Please reply..
Thanks,
Jitesh
Similar Messages
-
Hello All,
I have a requirement to send/export the background job spool in Excel (in MHTML format) in ECC 6.0. Please help.
Thank you.
NaliniHi Jigar,
Thanks for your response.
Anything is like download to desktop or email is fine. But in MHTML format.
We can download the ALV report in MHTML spreadsheet format when we run the program online. But the program is running for long time and going to dump.
So i scheduled it as background job and downloading the output in .HTML format. But user wants the spool/report output in .MHTML spreadsheet format.
I can write the code. Instead of changing the existing program I would like to know is there any way (from standard SAP) that I can get the background spool in MHTML spreadsheet format.
Thanks,
Nalini -
Facing problem while downloading ALV grid Output into Excel
Hi Guys,
I am facing problem while downloading ALV grid Output into Excel.
It is downloading into excel, but all character columns first and next all quantity columns it is displaying. But I need columns order as it is in the grid.
If I take all columns as characters it works fine. But it will be problem for calculating total, subtotals of quantity columns
Can someone help me regarding this
thanks for your helpHi,
Open up Excel on your desktop. Goto Tools > Macro > Security.
Make sure that your security is set to Medium (or less). SAP uses OLE automation to run the Excel instance and in Office 2003 (for example), Microsoft has increased their default security setting to High. With the High setting, the output to Excel fails.
Was this your problem? Don't forget those points, either.
check with this wetther it is solved or not.
Regards,
sana. -
Background job output to Presentation server
Hi,
I am executing report as Background job.
after job gets completed output should be in excel format in front end or presentation server.
Regards
NagaHi,
We cannot perform any action on the presentation server in a program that is being execcuted in background. What you can do is to write the output on to the app server, and after wards move the file on to the Pres. server using CG3Y transaction.
Regards,
Ravi
Note : Please mark the helpful answers -
Formatting problem when downloading classical report output to excel sheet.
Dear Experts,
My classical report o/p looks like:
SI Name ID
1 xyz 11
2 abc 22
3 eet 33
4 jnc 44
When I download the same to a excel sheet from List->Save->file->Spreadsheet and save it.
The formatting looks like this:
SI Name ID
1 xyz 11
2 abc 22
3 eet 33
4 inc 44
That is the heading and column entries are in different columns.
There is no GUI_Download used.
Kindly help what may be the issue.Hi,
In the report output the formatting looks fine. It is exactly below the heading. But only when I save it to excel, this alignment issue is coming. Even the columns after this column are are properly aligned and there is no issue at all. Only this column in the middle has issue. -
Download alv report output to excel format with out header line
Hi experts,
i want to download a alv report output into excel formatt with out the header line but it has to download including field description. as this output will fed into another transaction, the downloaded excel file should be with out header line.
fro eg:
Report : Zabc ABAP Development Page : 1
Run Date : 12/14/06 System: UD400
Run Time : 08:45:37
this header details should not be downloaded into the excel file.
could somebody help me please.
thanks
deepuhi jayanti,
thanks for your response.
i have delclared all the field types as character but still it is not downloading and it 's sy-subrc is 4... the code is as below.
*field names
lt_fieldnames-value = 'Material Number'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Plant'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Material Group'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Material Description'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'UOM'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Price Unit'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Material Type'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'X-Plant Status'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Valuation Class'.
APPEND lt_fieldnames.
lt_fieldnames-value = lw_avmng.
APPEND lt_fieldnames.
lt_fieldnames-value = lw_avntp.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Latest PO Qty'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Latest PO Cost'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'PO Creation Date'.
APPEND lt_fieldnames.
lt_fieldnames-value = lw_fcaqt.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Prev. Yr. Std. Cost'.
APPEND lt_fieldnames.
lt_fieldnames-value = lw_stcst.
APPEND lt_fieldnames.
CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
EXPORTING
file_name = 'XLSHEET'
CREATE_PIVOT = 0
DATA_SHEET_NAME = ' '
PIVOT_SHEET_NAME = ' '
PASSWORD = ' '
PASSWORD_OPTION = 0
TABLES
PIVOT_FIELD_TAB =
data_tab = t_output1
fieldnames = lt_fieldnames
EXCEPTIONS
file_not_exist = 1
filename_expected = 2
communication_error = 3
ole_object_method_error = 4
ole_object_property_error = 5
invalid_pivot_fields = 6
download_problem = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE e001 WITH 'Data could not be downloaded'.
ENDIF.
ENDFORM. " z_dwn_xl
thanks
deepu -
How to download a smartform output as excel file WITH EXACT LAYOUT.
Hi,
I have searched the forum but could not found any satisfactory answer. I have a smartform with a table, some texts and a logo. I have to write a code which will save the smartform output as excel file in the system keeping the layout of the smartform output EXACT.
i.e., the excel file will contain the output with EXACTLY THE SAME layout as would have been for a pdf file (if the smartform output is converted to a pdf file) and the client can then edit the fields of the table in the excel file. How can I achieve this? Please give a suggestion.. Thanks in advance.Hi Anirban,
Your Requirement is to download a smartform to microsoft Excel .
Well unfortunately we can only download data into excel which is in a tabular format i.e stored in internal tables we have function modules to do the same even u can do that using OLE2.
If u try to download a smartform to Excel only format supported will be ASCII, if u will continue with that the smartforms text's will get downloaded to excel but whole data would be downloaded in a single Cell.
Code to do the same is -
>>>>
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
i_language = v_language
i_application = 'SAPDEFAULT'
IMPORTING
e_devtype = v_e_devtype.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = w_form
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
FM_NAME = w_fmname
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE E002(zcpm) WITH 'Smartform call fails'.
ENDIF.
wa_outopt-tdprinter = v_e_devtype.
wa_ctrlop-no_dialog = 'X'.
wa_ctrlop-getotf = 'X'.
CALL FUNCTION w_fmname "'/1BCDWB/SF00000025'
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = WA_CTRLOP
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
OUTPUT_OPTIONS = WA_OUTOPT
* USER_SETTINGS = ' '
IMPORTING
* DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = T_OTFDATA
* JOB_OUTPUT_OPTIONS =
* document_output_info = st_document_output_info
* job_output_info = st_job_output_info
* job_output_options = st_job_output_options
TABLES
T_FINAL = T_FINAL
T_ZSDT_WAGONS = T_ZSDT_WAGONS_1
T_QTY = T_QTY
T_QTY1 = T_QTY1
T_CON1 = T_CON1
T_CON2 = T_CON2
"T_ZTMM_OUTWB_TXN = T_ZTMM_OUTWB_TXN
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
T_OTF[] = T_OTFDATA-OTFDATA[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'ASCII'
max_linewidth = 132
* ARCHIVE_INDEX = ' '
IMPORTING
bin_filesize = w_bin_filesize
TABLES
otf = t_otf
lines = t_pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
if tabix_m = 1.
*CALL METHOD cl_gui_frontend_services=>file_save_dialog
*CHANGING
*filename = w_FILE_NAME
*path = w_FILE_PATH
*fullpath = w_FULL_PATH
** USER_ACTION =
** FILE_ENCODING =
*EXCEPTIONS
*CNTL_ERROR = 1
*ERROR_NO_GUI = 2
*NOT_SUPPORTED_BY_GUI = 3
*others = 4
*IF sy-subrc <> 0.
*MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
CALL function 'TMP_GUI_BROWSE_FOR_FOLDER'
EXPORTING
WINDOW_TITLE = 'Select A File Folder'
INITIAL_FOLDER = 'C:\'
IMPORTING
SELECTED_FOLDER = W_PATH.
endif.
CONDENSE W_PATH.
concatenate W_PATH '\' wa_final-vbeln '.XLS' into w_FULL_PATH.
****************************************************************************Saving the PDF file on to Application server************************
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = w_bin_filesize
FILENAME = w_FULL_PATH
FILETYPE = 'BIN'
* APPEND = ' '
* WRITE_FIELD_SEPARATOR = ' '
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* TRUNC_TRAILING_BLANKS_EOL = 'X'
* WK1_N_FORMAT = ' '
* WK1_N_SIZE = ' '
* WK1_T_FORMAT = ' '
* WK1_T_SIZE = ' '
IMPORTING
FILELENGTH = w_filesize
TABLES
DATA_TAB = t_pdf_tab
* FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
As u said ,u want to download a smartform to Excel it could be done but only if u r using a internal table and exactly printing line by line values in the smartform, But if u are performing calculation in between, using multiple internal table Work areas, structures, etc i.e if whole smartform is developed with many distributed windows , unfortunately it wont be possible to download a smartform to excel in such cases, because the whole output comes from multiple internal tables, calculations, etc all the data is not printed in a tabular manner so in such a case it would be just impossible to download the smartform to excel.
But we definitely have a workaround which could be done to download the data into excel.
you can develop a ALV report with a header and footer u can define the header and footer of the alv according to the smartform and the middle portion would contain the tabular kind of data which u must be using as Smartform table to print the same.
So if u have a similar kind of smartform with some header data, tabular data, and some footer data, then u can use ALV to do the same thing , advantage with ALV would be that u can easily download the same into excel.
Other alternative is that u can Convert and download the smartform to PDF and copy the same to an Excel wooksheet.
These are all the possibilities with which u can do the same.
Regards,
Akash Rana -
SAP WEBGUI - How to download the report output to Excel ?
Hi Folks ,
We have generated a report in standard SAP GUI 7.1 . But our requirement is to view the report in SAP WEBGUI and download as EXCEL .
We can view the report output in SAP WEBGUI , but could find an option to download as excel !
Is there any option in webgui ?
Please provide you valuable inputs !
Thanks.,
V.RangarajanHi V.Ranjarajan,
Have you created an ALV report?
If yes, there are many ways to download the output to excel:
Go to Menu -> Export - > Local File... , local file button, etc.
In SAP CRM 7.0 there is a std functionality to even download search result list to excel.
Hope this helps!
Regards,
Saumya -
Downloading of ALV output to excel by asking the password
Hi all,
I need to down load the ALV output into the excel sheet. But the thing is that before going to download the output into excel sheet, the system has to prompt for password.once it happens then the user will enter the password and it should validate. if the validation is successful then the output should download to the excel sheet. This is the requirement, can anybody help me out regarding this.Please provide the function module names and sample code.
Thanks & Regards.
Laxman.P
B'lore.Hi,
Check this thread,
Make excel sheet password protected through ABAP codeu0085
Regards,
Omkar. -
Problem while downloading the alv output to excel file.
Hii,
While downloading the alv output to an excel file i am facing a problem. Either the output comes as 1.23456E+11 or the values get cut .
Cant put in txt file as the users require to calculate directy and i have even tried to increase the output length .But both doesnt help.
So what are the other ways to do so.
Edited by: mansi_v27 on Mar 24, 2010 12:35 PMHi,
Welcome to SCN!!!.
Please go through the forum rules. This has been discussed many times. You can search in the forum for this.
Infact there is no problem. Just expand that excel cell. You can see the full value. This is standard excel property.
Thanks,
Vinod. -
I schedule a job in backgroung proces(smartform).
Whwn i click on the spool to see the output , there is error "NO FRONTEND AVAILABALE" .
how can i see my output of the back ground job (smartforms).
i am executing the process like
1. tcode run
2. F9 ( FOR BACKGROUND PROCESS)
3. se37 to see the job proceesing
4. click on spool
5. but no ouput i can see
i don't know why??Hi Ajay,
Please search form with '
Mulitple Purchase order Print in SAP Script'
the thread shows below.
If your requirement is to print multiple PO's then i think you need to develop a Program .
In that in your final internal table you can loop it and print...
And also these setting need for background job.
If you have smartforms you can set following parameters
CALL FUNCTION LV_FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = CONTROL
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = OUTPUT_OPTIONS
USER_SETTINGS = ' '
VEHICLE = VEHICLE
LV_BAR = LV_BAR
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
IT_FINAL = IT_FINAL
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CONTROL-PREVIEW = 'X'. "Preview the output of Smartform
CONTROL-NO_DIALOG = 'X'. "Don't show Dialog
OUTPUT_OPTIONS-TDDEST = 'X' or space. "Spool: Output device(depend on requirement)
OUTPUT_OPTIONS-TDNOPRINT = ' '. "No printing from print preview
OUTPUT_OPTIONS-TDCOPIES = 1. " number of print copies
OUTPUT_OPTIONS-TDIMMED = 'X'. " Print Immediately (Print Parameters)
OUTPUT_OPTIONS-TDDELETE = 'X'. " delete the request after printing
OUTPUT_OPTIONS-TDLIFETIME = '5'. " spool retention period
OUTPUT_OPTIONS-TDCOVER = ' '. " no cover print
If you want immediate output while setting background set printer property time of print "Immediate"
Hope this will help to you.
Thanks,
Hari -
After reports running in background job need to get automatically open in excel sheet
Dear All,
I have a requirement which is new to me ,
Once the user runs the report in background system is displaying the output in HTML format .... But the Users needs to open in Excel sheet .
kindly do the needful
Regards
Srikanth BGHi Srikanth,
Excel processing in background is currently not possible using standard ways. There exist a really good external library that allows you to handle Excel files, and even create them in background. So you could create a final, ready to use Excel file from your background run that can then be opened.
You might have a look at the library here: http://wiki.scn.sap.com/wiki/display/ABAP/abap2xlsx
Maybe it helps and suits your needs.
Cheers,
Marc -
Create Scheduled in Background and Output as excel
Hi All,
I have already created an Adhoc Query, and I would like to run it every Sunday and save it as an Excel File automatically. I have already known how to set schedule in background. but I don't know how to set the output format and save it into specific folder. I would like to collect all the file for data warehouse processes.
Please kindly assist me... (help help help)
Thanks
MWidodoHi,
You can use the following code
types: begin ot ty_string,
a type string,
end of ty_string.
data: it_string type table of ty_string,
wa_string type ty_string,
tab type c value cl_abap_char_utilities=>horizontal_tab.
loop at itab(internal table that contains data fetched from database tables for your requirement).
concatenate itab-a itab-b into wa_string separateb by tab.
append wa_string to it_string.
endloop.
Use FM GUI_DOWNLOAD to download it_string to excel sheet.
Regards
Dande -
Extract SAP Background Job list to excel and E-mail to User
Hi Experts,
I am a Basis consultant and have a requirement to download the list of finished & cancelled SAP BG jobs of previous week to excel and send e-mail to Users. For now we are doing this manually every week, Is this possible to automate this process? Please help to share your views.
Thank you very much in advance.
Regards,Hi Mariano,
Thanks for your reply. Yes, I have already checked TBTC* tables but i want to know is there any standard report/program that can be scheduled on daily basis to download all the required data from SAP to excel?
Regards, -
To download a list output to excel sheet
Hi All,
I am running the transaction MD47 for Product Group Planning.
I get a list output with as many as 90 columns.
When I try to download the output into an excel (System > List > Save > Local File ) only the columns which appear on the screen are being downloaded. Does any one have pointers on how can I download the whole list into an excel?
Regards,
KarthikHey Gabriel,
I am doing good. How are you today?
How do I do that?
This is a list output not an ALV. I dint find any option to choose an ALV layout.
Regards,
Karthik
Maybe you are looking for
-
Importing a TOC from Microsoft Word
I'm working on a Medical instruction manual that was done in Microsoft Word. The TOC came over and SEEMs to link up to it's appropriate areas but I'm having a hard double checking because of the naming conventions (i.e. "ref00084848"). I want to
-
Custom fields to be included in Purchase Order in MM-SUS scenario
Hello, We need to include some custom fields in Purchase Order, that is transferred from ERP to SUS system. We are in SRM 7.01 and the communication from ERP to SUS happens via PI using the standard PI service. There is a SAP note 762984 for
-
BI Publisher xmlpserver 500 Internal Server Error
Hi All, I am fairly new to Oracle BI; we recently experienced a problem with BI Publisher after redeploying xmlpServer.ear onto OC4J. We are unable to connect to the Presentation Server. We are getting the following errors Exception java.lang.Excepti
-
PC Suite 4.88 - WIN XP SP2
Hi, I have a Nokia 6310i. I have downloaded PC Suite 4.88 and tried to install it on a PC with Win XP SP2. I get an error message saying that the .exe file is corrupted. I have since been informed that PC Suite 4.88 will not function with Win XP with
-
Why would Fabric Interconnects populate in fabric topology?
If the Fabric Interconnects are configured in End-Host mode, why would it be sending management traffic through an F port link making it populate on our fabric topology. We don't have this on our existing Blades centers and would expect that we woul