BAckground Job Downloading.
Hi Experts,
There's a solution of SAP regarding this topic using rfcsdk method by cerating SM59 and some changes to your local machine to have a connection between your machine and SAP server in background mode.
But the RFC_REMOTE_FILE function has a limit of 256 characters of reading.
How can we by pass this limit or rather cross the limit of 256 characters.
Jenifer,
When you download a spool in "Spreadsheet", SAP really downloads the data in tab delimited text format, even thought the file extension is .XLS.
So, just open the Excel file in notepad (or any other text editor) and see if the missing rows are present. If there are, then you have to figure out how to import the file properly into Excel file without losing the rows.
Similar Messages
-
Background job downloading missing some rows in sm37
Hi,
I am downloading background job output through spool request in excel format. Out of 2000 records some 50 records in the middle are not displayed.But those 50 records are there in the spool output.
When downloaded in text format means all 2000 records are downloaded correctly..
Give me a solution please...
Thanks and Regards,
JeniferJenifer,
When you download a spool in "Spreadsheet", SAP really downloads the data in tab delimited text format, even thought the file extension is .XLS.
So, just open the Excel file in notepad (or any other text editor) and see if the missing rows are present. If there are, then you have to figure out how to import the file properly into Excel file without losing the rows. -
MDMGX download to ports as background job without FTP?
Hello everybody,
is it possible to use MDMGX as a background job to download directly into the mdm ports without FTP?
If I try to download as a local download (in background job) I get the error message: "Cannot open dataset for batch download of file: No such file or directory. Message no. MDM_GX_MSG031"
Any advice?
Regards,
AxelHello Alex,
As said in the above post MDMGX is used to extract the reference data from ECC. This data can be extracted to the local system as well. You need to specify the FTP server and MDM Root of the system on which the MDM server is Installed, by doing so the data extracted will be placed in the respective folders created under the given root in MDM. PI is not required for this since the output is in the required XML format
Please go through the below link
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0740b31-a934-2b10-2e95-af2252991baa?QuickLink=index&overridelayout=true&30296699350032
http://wiki.sdn.sap.com/wiki/display/SAPMDM/MDMGenericExtractor
Hope this helps
Rgds,
Prasad
Edited by: Prasad Tuttagunta on Feb 28, 2012 12:28 PM -
Error in background job of downloading data to PC
Hi Gurus,
I hv created a report for downloading data to PC using
GUI_DOWNLOAD FM when scheduling job in background
job is getting canceled...................
give me some solution....thnaks friend.i hv used DATASET as u said...............
But I M getting dump
FILE IS NOT OPEN
this is my code
TYPES:BEGIN OF T_MARD,
MATNR LIKE MARD-MATNR,
WERKS LIKE MARD-WERKS,
LGORT LIKE MARD-LGORT,
LABST LIKE MARD-LABST,
MAKTX LIKE MAKT-MAKTX,
END OF T_MARD.
***********WORK AREAS**********
DATA: WA_MARD TYPE T_MARD,
WA_MARD1 TYPE T_MARD.
DATA:BEGIN OF IT_MARD1 OCCURS 0,
MATNR(18),
WERKS(4),
LGORT(4),
LABST(13),
MAKTX(40),
END OF IT_MARD1.
TYPES : BEGIN OF TY_BAT,
LINE(100) TYPE C,
END OF TY_BAT.
*********INTERNAL TABLES*******
DATA:IT_MARD TYPE STANDARD TABLE OF T_MARD INITIAL SIZE 0 WITH HEADER LINE .
types: BEGIN OF ITAB1,
FIELD(100),
END OF ITAB1.
DATA : IT_BAT TYPE TABLE OF TY_BAT,
WA_BAT TYPE TY_BAT,
wa_itab1 type itab1.
data : it_tab type table of ALSMEX_TABLINE with header line.
*DATA: FILENAME1 TYPE STRING valu.
*DATA: FILENAME1(500).
DATA: FILENAME1 TYPE RLGRAP-FILENAME .
LOOP AT IT_MARD1.
CONCATENATE IT_MARD1-MATNR IT_MARD1-LABST IT_MARD1-MAKTX
INTO wa_ITAB1 SEPARATED BY ' '.
APPEND wa_itab1 to IT_tab.
CLEAR wa_ITAB1.
CLEAR WA_MARD.
ENDLOOP.
CONCATENATE 'D:\STOCKINH\' SY-DATUM '.TXT' INTO FILENAME1.
open dataset filename1 for output in binary mode." ENCODING DEFAULT.
IF sy-subrc = 0.
EXIT.
ENDIF.
LOOP AT it_tab into wa_itab1.
TRANSFER wa_itab1 TO filename1.
CLEAR wa_itab1.
ENDLOOP.
close dataset filename1.
MESSAGE S001(38) WITH 'Files Generated'.
WA_BAT = 'ftp -s:d:\ftp\ftp_upload.txt'.
APPEND WA_BAT TO IT_BAT.
CLEAR FILENAME1.
FILENAME1 = 'D:\STOCKINH\ftp_upload.BAT'.
open dataset filename1 for output in binary mode." ENCODING DEFAULT.
IF sy-subrc = 0.
EXIT.
ENDIF.
LOOP AT it_bat INTO wa_bat.
TRANSFER wa_bat TO filename1.
CLEAR wa_bat.
ENDLOOP.
close dataset filename1.
CLEAR: IT_BAT.
REFRESH IT_BAT.
WA_BAT-LINE = 'open 10.100.103.199'.
APPEND WA_BAT TO IT_BAT.
CLEAR WA_BAT.
WA_BAT-LINE = 'epossync'.
APPEND WA_BAT TO IT_BAT.
CLEAR WA_BAT.
WA_BAT-LINE = 'sync@1234'.
APPEND WA_BAT TO IT_BAT.
CLEAR WA_BAT.
WA_BAT-LINE = 'lcd D:\STOCKINH\20080201.TXT'.
APPEND WA_BAT TO IT_BAT.
CLEAR WA_BAT.
WA_BAT-LINE = 'cd /home/epossync/AMIT'.
APPEND WA_BAT TO IT_BAT.
CLEAR WA_BAT.
WA_BAT-LINE = 'binary'.
APPEND WA_BAT TO IT_BAT.
CLEAR WA_BAT.
WA_BAT-LINE = 'hash'.
APPEND WA_BAT TO IT_BAT.
CLEAR WA_BAT.
WA_BAT-LINE = 'put D:\STOCKINH\20080201.txt'.
APPEND WA_BAT TO IT_BAT.
CLEAR WA_BAT.
WA_BAT-LINE = ' '.
APPEND WA_BAT TO IT_BAT.
CLEAR WA_BAT.
WA_BAT-LINE = 'bye'.
APPEND WA_BAT TO IT_BAT.
CLEAR WA_BAT.
CLEAR FILENAME1.
FILENAME1 = 'D:\STOCKINH\ftp_upload.txt'.
open dataset filename1 for output in binary mode." ENCODING DEFAULT.
IF sy-subrc = 0.
EXIT.
ENDIF.
LOOP AT it_bat INTO wa_bat.
TRANSFER wa_bat TO filename1.
CLEAR wa_bat.
ENDLOOP.
close dataset filename1. -
Why the background job for downloading file failed?
I have a background job for downloading file with logical path.
with
'OPEN DATASET l_out_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT';
Now, the program can be run in foreground;but when it running on background, it shows 'open file error'.
I do not know what happen?
Please help ~~Hi,
The logical path you have provided might be incorrect or you might not have the necessary authorization to read/write on that folder.
Please check the folder in transaction AL11 & check whether you have the authorization to read/write. BASIS consultant would be able to tell you about it.
Best regards,
Prashant -
Background job to download standard ALV reports
Hi,
Could anyone knows how to download an standard ALV report in a background job?
In a job I made, some ALV reports were precessed and made, and their spools were made,
but not downloaded.
Regerds,
Katsumi Makabehi,
I think you can have a network shared folder on application server.
you said that it is a comma separated file.
1) Using TCODE CG3Z, upload the flat file to application server , remember to copy the path (it contains file path aswellas name).
2) Using DATASET read the filepath along with the name and read each line into workarea and split at ',' into fields.
3) Then append those fields to internal table.
using the FMs job_open, job_submit and job_close you can go for background scheduling.
Please go through the following link for sample code on FTP.
http://abap4.tripod.com/FTP_Using_SAP_Functions.html
Reward points if helpful.
Thanks and regards -
Download ALV result list as excel-file in background job
Dear Experts,
I am looking for a possibily to download the result of an ALV based report as excel-file in a background job. Surely there is a standard function which can be used or at least some hints how to implement this. I searched the forum but couldn't find a thread which was covering this problem exactly.
Thanks in advance
BenjaminDear Mr. Krapf,
it is possible to output an ALV list to an Excel file in the background but there are some limitations.
Please consider the following notes:
#7925 Graphics, Upload, Download do not work in backgrnd
#65050 Data types and file formats in files (DATASET)
#145073 - FAQ Report Writer: Excel download
#569537 - Incorrect data during import into Excel
#590126 Sending CSV documents up to Release 4.6
Please be aware that they are all Basis notes. So for more information you might ask in the Basis SDN Forum.
Best regards, Christin Angus -
Hi
Is it possible to set a program , that contains the download , in background?
If so, how?
Thank U
Narendrahi,
You cannot download to the frontend in a background job because the GUI isn't available.
You will have to use OPEN DATASET stmts and
put the file on the Application server in the background
and then use the transaction CG3Y in the foreground to download the file to the pc from the application server.
regards,
priya. -
Download(xls) file fm ABAP using background job
Hi,
My request is how to download(xls) file fm ABAP using background job. ( Daily 3 times download )
Pls advise...Hello Rajesh,
Actually it is not the function module WRITE_DATASET but command OPEN DATASET. Check this link for more info:
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/content.htm
Also for this please contact your ABAP collegues. It is their job and they should have the expertise.
Regards.
Ruchit. -
Background Job : To download file to windows server
Hi Gurus,
Here we have to develop a program thats creates a csv file in a network shared folder( a windows folder), We have to schedule it as a background process. We cant use gui_upload function module, since it doesnt support background jobs.
Please share your ideas.
Any idea about ftp?
Thanks in advance,
Anuroophi,
I think you can have a network shared folder on application server.
you said that it is a comma separated file.
1) Using TCODE CG3Z, upload the flat file to application server , remember to copy the path (it contains file path aswellas name).
2) Using DATASET read the filepath along with the name and read each line into workarea and split at ',' into fields.
3) Then append those fields to internal table.
using the FMs job_open, job_submit and job_close you can go for background scheduling.
Please go through the following link for sample code on FTP.
http://abap4.tripod.com/FTP_Using_SAP_Functions.html
Reward points if helpful.
Thanks and regards -
How to avoid use of function module in case of background jobs?
Hi ,
I am working a file tranfer interface .Functionality is to extract file either apllication or presentation server , and process the file through bapi , send the result in their respective server. This program should run through batch jobs in background mode.
I am using following function module :
SUBST_GET_FILE_LIS : Get the file list from application server
TMP_GUI_DIRECTORY_LIST_FILES : Get the file list from presentation server
GUI_UPLOad : to extract file data from presentation server
GUI_downLOAD : to download data to presentation server
in case of background job these function modules will not work.... so how to resolve this issue...
what are the methods we can apply?
Thanks & Regards
SandeepHi,
This FM is used to get list of files from Application server (will work in Background). This cannot be used to list files from presentation server. There is no way , by which you can process presentation server files in background mode.
Regards
Vinod -
After writing a report, I used this Function Module LIST_TO_ASCI to copy my report to an internal table (DOWNTAB) because Ill use that internal table to download a text file on the server using dataset.
Here is my code:
FORM DL_REP_SERVER.
DATA: ABAP_LIST LIKE ABAPLIST OCCURS 1,
MV_FILE2 LIKE RLGRAP-FILENAME.
DATA: BEGIN OF DOWNTAB OCCURS 1,
LINE(150),
END OF DOWNTAB.
CLEAR: MV_FILE2.
MV_FILE2 = J:/Downloads/Report.txt.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
LIST_INDEX = SY-LSIND
TABLES
LISTASCI = DOWNTAB
LISTOBJECT = ABAP_LIST
EXCEPTIONS
LIST_INDEX_INVALID = 1
OTHERS = 2.
OPEN DATASET MV_FILE2 FOR OUTPUT IN TEXT MODE.
IF SY-SUBRC <> 0.
IF SY-SUBRC = 8.
MESSAGE E037 WITH 'File could not be opened'.
ELSE.
MESSAGE E037 WITH 'Error occurs in downloading the file'.
ENDIF.
ENDIF.
LOOP AT DOWNTAB.
TRANSFER DOWNTAB TO MV_FILE2.
ENDLOOP.
CLOSE DATASET MV_FILE2.
ENDFORM. " DL_REP_SERVER
My big problem is this, when Im running my program ordinarily (not as background job), Im getting all the pages downloaded correctly but when I run it as background job (using SM36), Im only getting the last page of my report being downloaded. Definitely, I cant debug it because its in background. I cant figure out why. Hope that I stated my problem clearly. Any help would be greatly appreciated. Thanks.You can debug batch jobs by going to 'SM37', type in 'JDBG' in the
command line ( no '/' ), put the cursor on the job and press enter - will
take you to the job in debug mode.
You can do this only after the job has finished execution. This will simulate the exact background scenario with the same selection screen values as used in the job also sy-batch will set to 'X'.
So type in the transaction code 'JDBG' and place your cursor on the job after It has finished. It will take you to a SAP program in debug mode. Step through this program which is about 10 lines, after this your program will be executed in the debug mode.
Steps
1. Create variant called BACKGROUND for program to be debugged.
2. Execute ZDEBUGBG (pgm code below) in background for immediate processing.
3. Execute transaction SM50.
4. Select process that runs ZDEBUGBG.
5. Goto 'Program/Session' 'Program' 'Debugging'.
A se80 debug session will open.
6. Change variable W_EXIT to 'E'.
7. Step thru (F6) until ZWBTEST comes up.
1. Go to Transaction SM66 and find your work porocess.
Select the line work process is on and click on the Debugging button.
If this is a custom program, you can put a wait statement in the code to buy yourself sometime.
2. Go to Transaction SM50. From the tool bar "Program/session"->Program->Debugging.
goto SM37 and from Program menu(not sure.. try other menu's)
-->Catchjob . it will goto the active job in debugging mode. -
Can ABAP proxy to consume WSDL file be run as background job for every10min
Hi all,
I have a requirement where I need to build an interface which gatheru2019s the purchase order details and send to external third party software in their required format (as an XML file).
So I should be the first point of contact and should trigger the interface each time a purchase order is generated.
So I am thinking that I should develop a background job for every 10 minutes which will look for new purchase orders and gathers the information of the purchase orders and send them to external third party software in their required format.
I have gone through all the SAP forums and e-Learning but still I have confusion in regards to how is it possible technically? Can some one guide me with some information on the same.
I have a little bit of confusion and want to know few things.
1) Should I create a web service or should I consume a web service?
2) If I need to consume a web service, then can I write an ABAP proxy to be run in background fro evry 10 minutes? I mean can we run ABAP proxy as a batch job in the background?
3) Is there a difference between consuming an XML file and WSDL File?
Any Help will be highly appreciated.
Regards,
Jessica.There are two options (as I know) to generate XML file.
1. Use XML TRANSFORMATION to get the XML string based your TRANSFORMATION. You can input your data and get back the XML string. Download this string to a file
Test XML generation program is:
types: begin of ty_data,
num type i,
end of ty_data.
DATA: itab TYPE standard table of ty_Data,
la_data like line of itab,
xmlstr TYPE string.
DO 3 TIMES.
la_data-num = sy-index.
APPEND la_data TO itab.
ENDDO.
CALL TRANSFORMATION ztest_np1
SOURCE table = itab
RESULT XML xmlstr.
CALL FUNCTION 'DISPLAY_XML_STRING'
EXPORTING xml_string = xmlstr.
My ZTEST_NP1 transformation. To create a transformation, click on the transformation in the "CALL TRANSFORMATION ztest_np1" statement. Select Simple transformation type.
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="table"/>
<tt:template>
<table>
<tt:loop ref=".table">
<item>
<tt:value ref="NUM"/>
</item>
</tt:loop>
</table>
</tt:template>
</tt:transform>
XML string is like:
<?xml version="1.0" encoding="utf-8" ?>
<table>
<item>1</item>
<item>2</item>
<item>3</item>
</table>
To use this option, you have to create a transformation and than use it to generate the XML string.
Check this SAP Help
http://help.sap.com/saphelp_nw04s/helpdata/en/e3/7d4719ca581441b6841f1054ff1326/frameset.htm
2. You can concatenate and create an XML string and download that string into a file.
Regards,
Naimesh Patel -
How to set pl/sql function as background job in apex?
Hi,
I wrote a function which returns boolean value based on result.This function updates a table everyday.How to set this as a background job?or do I need to use dbms_job only?
Thanks,
Mahender.No, you can use APEX_PLSQL_JOB.
Example:
DECLARE
l_sql VARCHAR2(4000);
l_job NUMBER;
BEGIN
l_sql := 'BEGIN MY_PACKAGE.MY_PROCESS; END;';
l_job := APEX_PLSQL_JOB.SUBMIT_PROCESS(
p_sql => l_sql,
p_status => 'Background process submitted');
--store l_job for later reference
END;
full documentation link [http://download.oracle.com/docs/cd/E14373_01/apirefs.32/e13369/apex_plsql_job.htm#BGBCJIJI]
If I help you, please stamp my answer as CORRECT or HELPFULL :) -
Dear All,
We have a background job, which will execute a z program. The out put of Z program will be sent as a mail to the recipient listed in "Spool list recipient" (SM36).
We did unicode conversion and upgrade to ecc 6.0.
Even now background job send the out put to mail, but when we open the attached html file in the mail which contains the out put, it displaying with junk characters.
Out put looks like " æ¼â¾â¼¼ã¹¢â¼¼æ½¦ç®ã° "
Your help will be highly appriciated.
Thanks and regards
Josephhi check this...
Save Report Output to a PDF File
This report takes another report as input, and captures the output of that report. The output is then converted to PDF and saved to a local file. This shows how to use some of the PDF function modules, as well as an easy way to create PDF files.
One thing I am not thrilled about is how the spool number is retrieved. If anyone has any better method, please let me know! Until I actually have a production use for a program like this, I will not try to find a better way.
Source Code Listing
report zabap_2_pdf.
*-- Enhancements: only allow to be run with variant. Then called
*-- program will be transparent to users
*-- TABLES
tables:
tsp01.
*-- STRUCTURES
data:
mstr_print_parms like pri_params,
mc_valid(1) type c,
mi_bytecount type i,
mi_length type i,
mi_rqident like tsp01-rqident.
*-- INTERNAL TABLES
data:
mtab_pdf like tline occurs 0 with header line,
mc_filename like rlgrap-filename.
*-- SELECTION SCREEN
parameters:
p_repid like sy-repid, " Report to execute
p_linsz like sy-linsz default 132, " Line size
p_paart like sy-paart default 'X_65_132'. " Paper Format
start-of-selection.
concatenate 'c:\'
p_repid
'.pdf'
into mc_filename.
*-- Setup the Print Parmaters
call function 'GET_PRINT_PARAMETERS'
exporting
authority= space
copies = '1'
cover_page = space
data_set = space
department = space
destination = space
expiration = '1'
immediately = space
in_archive_parameters = space
in_parameters = space
layout = space
mode = space
new_list_id = 'X'
no_dialog= 'X'
user = sy-uname
importing
out_parameters = mstr_print_parms
valid = mc_valid
exceptions
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
others = 4.
*-- Make sure that a printer destination has been set up
*-- If this is not done the PDF function module ABENDS
if mstr_print_parms-pdest = space.
mstr_print_parms-pdest = 'LOCL'.
endif.
*-- Explicitly set line width, and output format so that
*-- the PDF conversion comes out OK
mstr_print_parms-linsz = p_linsz.
mstr_print_parms-paart = p_paart.
submit (p_repid) to sap-spool without spool dynpro
spool parameters mstr_print_parms
via selection-screen
and return.
*-- Find out what the spool number is that was just created
perform get_spool_number using sy-repid
sy-uname
changing mi_rqident.
*-- Convert Spool to PDF
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid= mi_rqident
no_dialog = space
dst_device = mstr_print_parms-pdest
importing
pdf_bytecount = mi_bytecount
tables
pdf = mtab_pdf
exceptions
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
others = 12.
call function 'DOWNLOAD'
exporting
bin_filesize = mi_bytecount
filename = mc_filename
filetype = 'BIN'
importing
act_filename = mc_filename
tables
data_tab = mtab_pdf.
FORM get_spool_number *
Get the most recent spool created by user/report *
--> F_REPID *
--> F_UNAME *
--> F_RQIDENT *
form get_spool_number using f_repid
f_uname
changing f_rqident.
data:
lc_rq2name like tsp01-rq2name.
concatenate f_repid+0(8)
f_uname+0(3)
into lc_rq2name separated by '_'.
select * from tsp01 where rq2name = lc_rq2name
order by rqcretime descending.
f_rqident = tsp01-rqident.
exit.
endselect.
if sy-subrc ne 0.
clear f_rqident.
endif.
endform." get_spool_number
regards,
venkat .
Maybe you are looking for
-
Hello everybody. I would like to tune a PI 7.0 application. both ABAP (things such as number of dialog and background processes) and the JAVA (no zero administration in PI 7.0) Can anyone please point me to a good guide? Tried to look in service.sap.
-
Hi All, I am new to OBIEE but have a question regarding Direct Database Request. We have our EBS data stored in the OBIEE Data Warehouse but we'd also like to be able to use some of our Oracle SQL Developer queries against our EBS database directly u
-
Enhancement for transaction IW32
Hi all, I need to create a push button in the application area of transaction IW32 which will trigger a java application. Can anyone provide me with the enhancement name where i can code for its logic. Thanks, Asha
-
Getting to know if JVM is running in 64bit mode
Is it possible to get to know when running an application if the JVM is running in 64 bit mode? So if it is started using -d64 command line option? Thanks, Kristof
-
Since I upgraded to win 8 yesterday, firefox has not run the same at all. it is slow, the browser blinks on any page that uses flash. the plugin crashes or simply just shuts when i try to play a video on youtube or vimeo. I have troubleshooted all