FileInfo.Delete method appears to run in background
My app is set up to delete output file before regenerating them. It appears that the delete operation is running on a basckground thread. I am not certain what is happening but here is what I do know.
If the process to create the data to be written out runs quicker than normal, the file creation timestamp remains unchanged.
If I add a 1 second delay after deleting the file, the file creation timstamp is always the current time.
My users rely on the file creation timestamp to locate the latest changes.
Any ideas on how to change this behavior without adding a call to sleep()?
Mac
I think it's not about background thread. Instead you're bitten unexpectedly by
file system tunneling.
Try to get the system administrator
disable it for you and see if the symptom disappears. (Mind you, a few common programming techniques rely on this behavior so disabling it could break things. Always set up a test server to simulate normal operations for some time before deploy the change
to production. If you confirmed this is indeed the source of issue but cannot verify the possible impact, you're advised to seek for other techniques like saving the timestamp on database/NOSQL.)
Similar Messages
-
Speed has slowed to nil how do i delete all icons running in background?
speed has slowed to nil. How do I delete all icons running in background?
To close an app, drag the app up from the multitasking display.
Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the app that you want to close and then swipe "up" on the app thumbnail to close it.
this might help as well.
Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up. -
How do I delete programs running in background on old I phone iOS 5
How do delete programs running in background on old I phones
On iOS 5 double-click home button, touch an hold on an app icon until a "-" appears. Touch this to remove the App.
-
My eom lightning charger says its unsupported and acts like a knock off and apps appear to be running in background draining battery but I can't see them. Upgraded to iOS 7 phone only lasts 1/2 day. Notifications are all off.
Crazybioteacher wrote:
Not to sound like a jerk but this is my 3rd iPhone and I hit the usual fixes.
And we would know that based on the initial posting based on what? -
Function module to read the directory list and also run in background
Hi All,
I need to read few files from a folder in the server and upload the data in the file using a BDC. This process has to happen in the background as I am going to schedule the program. I had used the function module "EPS_GET_DIRECTORY_LISTING" to list the file names, it is working properly but when I schedule the program this function module does not work, the jobs gets finished in 0 secs. I am suspecting that it is not running in back ground. Can any one suggest me the function module which runs in background to read the files or an alternate method.
AjeethaThanks for the reply.
Sorry, this function module is working properly, why I assumed it is not working is that the background job got completed in 0 secs which made me feel that the function module is not working. Also I am subsequently copying the file to another folder and deleting it from the source folder, actually thiese two functionalities are not working in background. which added to my conclusion that all the function modules are not working in background. I am using two methods to copy and delete files, they are
CL_GUI_FRONTEND_SERVICES=>FILE_COPY,
CL_GUI_FRONTEND_SERVICES=>FILE_DELETE.
as these are not working in background, now I need to replace them with a method or function module which will run in background.
As I have mentioned earlier, my main objective is to upload the data in the file using a bdc. If I am not able to delete the file in the source folder, then duplicate upload will happen which I have to avoid. So, if someone could help me to find a way to delete the file will be of great help to me.
Ajeetha -
Report program when run in background job getting cancelled immediately
Hi
When i run a program in foreground i am able to see the output. But when run in background not able to run the job successfully. The job is getting cancelled immediately.
I am using the below function module for output display. Should i need to pass any parameters in the below function module so that i can run the program in background successfully.
CALL METHOD DETAIL_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = IS_LAYOUT
I_SAVE = 'A'
IS_VARIANT = GS_VARIANT
CHANGING
IT_FIELDCATALOG = IT_FIELDCATALOG
IT_OUTTAB = BLOCKED_STOCK_TAB_ALV[].
Please suggest.
Thanks and regards
Rajani YeluriHi Rajani.
ALV require the DRYPOR(screen) for display but incase you run in back ground which have to write to spool but in spool we can only write in format of LIST REPORT not inter-active report like ALV. That why
system cancelled your process immediately.
Hope it helps.
Sayan. -
GUI_GET_DESKTOP_INFO is not worked when run in background
Dear all,
I want to retrieve the computer name using this function module. It is working fine in foreground but it returns no result when I run in background. Is there any other method to get the computer name in background? Thanks in advance.Problem solved using the following method:
DATA: BEGIN OF usr_tabl OCCURS 10.
INCLUDE STRUCTURE uinfo.
DATA: END OF usr_tabl.
DATA th_opcode(1) TYPE x.
data: size type i.
CONSTANTS: opcode_list LIKE th_opcode VALUE 2.
CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode_list
ID 'TAB' FIELD usr_tabl-sys.
describe table usr_tabl lines size.
read table usr_tabl index size.
write usr_tabl-term.
while usr_tabl-term is the computer name. It works in background as well.
Edited by: Chiew Ngee Ho on Mar 12, 2009 9:36 AM -
Error when OO ALV report run in background
Hello all,
We recently applied stack 12 for a 7.0 system. My custom ALV report using CL_GUI_CUSTOM_CONTAINER coding now returns an error when run in Background. It works fine in dialog.
The error occurred in program CL_GUI_CUSTOM_CONTAINER=======CP. The log message was "Control Framework: Fatal error - GUI cannot be reached".
Is there a solution for OO ALV reports run in the background? I would not like to re-write my ALV reports using the function call. Any advice is appreciated. Thanks!!Yes, you need to code it a little differently, but you can still use CL_GUI_ALV_GRID. Here is an example.
REPORT ZRICH_0006 .
DATA: ITAB TYPE TABLE OF MARA.
DATA: R_GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA: R_CONTROL TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
DATA: G_DOCK TYPE REF TO CL_GUI_DOCKING_CONTAINER.
DATA: OKCODE type sy-ucomm.
START-OF-SELECTION.
SELECT * FROM MARA INTO TABLE ITAB up to 100 rows.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS '0100'.
SET TITLEBAR '0100'.
IF R_CONTROL IS INITIAL.
* Check whether the program is run in batch or foreground
IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
* Run in foreground
CREATE OBJECT R_CONTROL EXPORTING CONTAINER_NAME = 'CONTAINER_1'.
CREATE OBJECT R_GRID EXPORTING I_PARENT = R_CONTROL.
ELSE.
* Run in background
CREATE OBJECT R_GRID EXPORTING I_PARENT = G_DOCK.
ENDIF.
CALL METHOD R_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'MARA'
CHANGING
IT_OUTTAB = ITAB.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
CASE OKCODE.
WHEN 'BACK'.
leave program.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Regards,
Rich Heilman -
RMMR1MRS-When run in background cause update failure errors looking
hi,
RMMR1MRS report when run in background cause update failure errors .
There are few below reason for the error log.
1. for the PO invoice already generated - (its right if already invoice generated. should not happen again)
2. In MIGO, entire quantity has been reversed and also invoice generated with zero value - ( its right , should not happen invoice again )
3. Particular PO line item deleted - (its right if the PO line item deleted. ERS settlement not require)
For the all above reason, the update error occurs. But the mean time the program "RMMR1MRS" should not through the update error log.
Note: The job was not terminated due to this update error and also no harm because of the error log
can you please help on this update failure why it occurs.Have you found a solution already? If so, please, share it with the community and close this thread.
-
Office intergration - run as background job
Hi,
I have a word template merged with data using "Desktop Office Integration".
Currently word template will be opened before data merging is done.
Is it possible to run as background job, which word template can merge with data in backend? If possible, how should i work on it?
Kindly advise.
Thanks,
GinnieHi,
Thanks for your prompt reply.
Is there any other methods which i can pull my data from table and merge to a word document?
Or is it possible to generate PDF in this case?
I need it to be a backend job.
Any suggestion? Kindly advise.
thanks,
ginnie -
Spool to PDF Conversion in ECC6 from Report running in Background
Hi Friends,
Iam working in ECC6, I have created one Classical report with line size of 295 which is running in Background and spool is generating.
But my requirement is I have to send this spool to email through PDF Attachment.
Here i have to convert Spool of line size 295 to PDF format. and then using FM give mail to respective email ids.
Here is the code i have written for your refference:
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
endif.
1. FORM GET_JOB_DETAILS .
Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM. " G
2. FORM OBTAIN_SPOOL_ID .
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
MESSAGE s004(zdd) WITH gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM. " OBTAIN_SPO
3. CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
dst_device = 'ZLOCL'
PDF_DESTINATION = 'X'
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
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.
CHECK sy-subrc = 0.
*Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM. " CONVERT_SPOOL_TO_PDF
4. FORM PROCESS_EMAIL .
DESCRIBE TABLE it_mess_att LINES gd_recsize.
*DESCRIBE TABLE it_pdf_output LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
ENDFORM. " P
5. FORM SEND_EMAIL USING P_EMAIL.
CHECK NOT ( p_email IS INITIAL ).
REFRESH it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachnament'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
APPEND it_mess_bod.
If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'INT'.
ENDIF.
Send file by email as PDF format
PERFORM send_file_as_email_attachment
TABLES it_mess_bod
it_mess_att
it_pdf_output
USING p_email1
'PDF Document Attached'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
CHANGING gd_error
gd_reciever.
ENDFORM. " SEND_EMAIL
6. FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES it_message
it_attach
USING p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
CHANGING p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
send_mail LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
w_sent_all(1) TYPE c,
w_doc_data LIKE sodocchgi1.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = it_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
LOOP AT p_email1.
t_receivers-receiver = p_email1-low.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
ENDLOOP.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM. " SEND_FILE_AS_EMAIL_ATTACHMENT
But when iam executing the report in Background mail is coming to respective email ids but when i opened that attachment which is in PDF is not opening, giving error as below:
"Could not parsed Attachment.PDF!"
and file size is less oringinallly file size should be 125 KB buit in mail it is coming only 3 KB.
When i executed FM CONVERT_ABAPSPOOLJOB_2_PDF in foreground, its working fine for that Spool id.
Any suggestions from u friends.
regards,
Sekhar.Hi when ur running tha application in background pass the below parameters .
DATA:
w_form_name TYPE tdsfname VALUE 'Zpramu_TEST',
w_fmodule TYPE rs38l_fnam,
w_cparam TYPE ssfctrlop,
w_outoptions TYPE ssfcompop,
W_bin_filesize TYPE i, " Binary File Size
w_FILE_NAME type string,
w_File_path type string,
w_FULL_PATH type string.
Internal tables declaration
Internal table to hold the OTF data
DATA:
t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
Internal table to hold OTF data recd from the SMARTFORM
t_otf_from_fm TYPE ssfcrescl,
Internal table to hold the data from the FM CONVERT_OTF
T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
This function module call is used to retrieve the name of the Function
module generated when the SMARTFORM is activated
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = w_form_name
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = w_fmodule
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Calling the SMARTFORM using the function module retrieved above
GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF
format of the output
w_cparam-no_dialog = 'X'.
w_cparam-preview = space. " Suppressing the dialog box
" for print preview
w_cparam-getotf = 'X'.
Printer name to be used is provided in the export parameter
OUTPUT_OPTIONS
w_outoptions-tddest = 'LP01'.
CALL FUNCTION w_fmodule
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
control_parameters = w_cparam
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
output_options = w_outoptions
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
job_output_info = t_otf_from_fm
JOB_OUTPUT_OPTIONS =
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_otf_from_fm-otfdata[].
Function Module CONVERT_OTF is used to convert the OTF format to PDF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = W_bin_filesize
BIN_FILE =
TABLES
otf = T_OTF
lines = T_pdf_tab
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 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.
To display File SAVE dialog window
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILE_NAME =
FILE_FILTER =
INITIAL_DIRECTORY =
WITH_ENCODING =
PROMPT_ON_OVERWRITE = 'X'
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.
Use the FM GUI_DOWNLOAD to download the generated PDF file onto the
presentation 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 =
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
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
ABAP program to run in Background job
Hi,
We have a custumized program (SO Creation) calling some functions (like: WS_QUERY, WS_UPLOAD, WS_DOWNLOAD, CREATE_TEXT and CALL TRANSACTION VA01) and can only run thru dialog process (foreground). Is it possible to convert it to something that can run thru background job?
Please help.
Thanks.Hi Deo ,
Unfortunately cl_gui_frontend_services will not work in background.
Please have a look at following information about cl_gui_frontend_services :
The class CL_GUI_FRONTEND_SERVICES contains static methods for the following areas:
File functions
Directory functions
Registry
Environment
Write to / read from clipboard
Upload / download files
Execute programs / open documents
Query functions, such as Windows directory, Windows version, and so on
Standard dialogs (open, save, directory selection)
To Use this, you should be bit familier with OO ABAP Concepts. So I will suggest you to go through with OO concepts of ABAP. It will be of great help to you.
Regards,
Nikhil -
Running In Background on Server
I am with a Sender and Receiver application where the Receiver runs on a Server and the Sender runs on the Client. What I would like to do is have the Receiver run on the server and continue to set and run waiting for files to be transmitted. I attempted to put a for loop in the program however, the program generated this following thrown exception when I sent a file the second time:
Exception in thread "main".util. NoSuchElementException
at java.util.StringTokenizer.netToken(Unknown Source>
at UDPReceivedr.<init>(UDPReceiver.java.52)
at FileReceiver.man(FileReceiver.java.63)
The following code is provided for review:
import java.net.*;
import java.io.*;
import java.util.*;
// UDPReceiver class.
public class UDPReceiver
DatagramSocket s;
String filename, initString;
byte[] buffer;
DatagramPacket initPacket, receivedPacket;
FileOutputStream fileWriter;
int bytesReceived, bytesToReceive;
// UDPReceiver method.
public UDPReceiver(int port) throws IOException
// Define instances.
s = new DatagramSocket(port);
buffer = new byte[8192];
System.out.println(" ** Server is ready to receive file on port: "+port);
// Here we want to wait for the client to send a file.
initPacket = receivePacket();
initString = "Recieved-"+new String(initPacket.getData(), 0,
initPacket.getLength());
StringTokenizer t = new StringTokenizer(initString, "::");
filename = t.nextToken();
bytesToReceive = new Integer(t.nextToken()).intValue();
// Announce that the file to be received will be saved
// as a pre-determined filename and the number of bytes
// expected to receive.
System.out.println(" -- The file will be saved as: "+filename);
System.out.println(" -- Expecting to receive: "+bytesToReceive+"
bytes");
// Tell the client that it is ok to send the file.
send(initPacket.getAddress(),initPacket.getPort(),
(new String("OK")).getBytes());
// Receive the transmitted file from client.
fileWriter = new FileOutputStream(filename);
// Write the file out.
while(bytesReceived < bytesToReceive)
receivedPacket = receivePacket();
fileWriter.write(receivedPacket.getData(), 0,
receivedPacket.getLength());
bytesReceived = bytesReceived + receivedPacket.getLength();
fileWriter.flush();
System.out.println(" ** The file transfer from sender is now
complete.");
} // end UDPReceiver method
// receivePacket method
public DatagramPacket receivePacket() throws IOException
DatagramPacket packet = new DatagramPacket(buffer,
buffer.length);
s.receive(packet);
return packet;
} // end method
// receiveData method.
public byte[] receiveData() throws IOException
DatagramPacket packet = new DatagramPacket(buffer,
buffer.length);
s.receive(packet);
return packet.getData();
} // end method
// send method
public void send(InetAddress recv, int port,byte[] message)
throws IOException
// Here we define an instance of DatagramPacket.
DatagramPacket packet = new DatagramPacket(message,
message.length, recv, port);
s.send(packet);
} // end method
}The main is located in another program, which calls this class. I have been looking at running this applicatiion as a Windows Service but I am not sure if that would allow the program to continue running in the background.
Any help with this would be appreciated.The crazy thing here is it will run properly if I allow it to run once, transfer the file and receive it, and let the program complete and teminate.
If I attempt to set this class in a loop I get the thrown exception. I would really like to have this run in background and continue to run and not terminate after each Send and Receive. Is there a way to do this?
The diagram for this would be:
1. Run and wait for sender to send file.
2. Receive the file and write it out to the local dirve.
3. Notify the client the send was successful.
4. Go back to sleep and wait for another file to be sent. -
Error when running in background
Hi,
When i run the pgm in foreground its working fine but if i run in background the job is getting cancelled with the error message "Code page couldnt be determined".I checked in background the value in the o/p is coming but the job is getting cancelled.What is the reason for it?Hi,
In your program are you using any cl_gui_frontend_services methods. That means
any cl_gui_frontend_services=>gui_download
cl_gui_frontend_services=>gui_upload
If you are using frontend services background job. The job will not work
Hope it will helps -
Count down timer not run in background
On my 1520, with 8.1, i tried many timer apps and found the timer function failed when running in background. The even happened to the app, SuperTimer, which claimed to have overcame the issue. In Supertimer the countdown lags and even stop at times depending on what other things I am running. Really disappointing. It appears to be an issue wth Windows OS that none of the app programmers could fix.
Disappointed
Solved!
Go to Solution.Have you allowed the app to run in background in the battery saver settings?
Maybe you are looking for
-
I've checked my current plugins and it still shows Adobe Acrobat Version 7 for Netscape (7.0.9.50) I tried to do the update but I get the same error each time - "Please tell Microsoft about this problem" "Send Error Report/ Don't Send". Also, do I ne
-
Transaction code to change group indicator & group number of a routine
Transaction code to change group indicator & group number of a routine
-
I am making an instant movie. I added 129 clips (mostly very short - 15-30 seconds). It indicated that it was analyzing all of the files and now it is stuck (apparently) at 100% Analyzing Media for the last file. When I check Task Manager the prog
-
Dreamweaver no longer supported? erk?!?!?
Here's my reasoning ... coldfusion 8 have been out for quiet some time now. dreamweaver cs3 have been out quiet some time now. And yet, none of the coldfusion8 tags are supported in dreamweaver ... Making it difficult, at best, to develop for coldfus
-
JMS Channel is thrrowing error with an error code:2007. Error code description is "CharAttrs is not valid. The parameter pointer is not valid, or points to read-only storage for MQINQ calls or to storage that is not as long as implied by CharAttrLen