Doing background processing in a servlet

Hello folks
I'm new here, I wonder if someone can give me an advice in an architecture problem I encountered. This text looks long, but the problem is quite simple � how to allow a servlet to do something independent by the doXXXX() methods invocation.
In my application I have the following two requirements:
1. To allow an HTTP interface, in which user can enter tasks to the server.
2. To allow that the server will handle the tasks by a priority order, whenever their execution time arrives (which is independent by their creation time).
Actually, the server has a priority queue, which contains tasks, and each task has an execution time. The server should wait until the execution time of the closest task (the task that at the head of the queue), and then to execute it, and pop the next task. I've already implemented an application, single threaded, that implements this requirement. The tasks in my application are entered to the queue in the initialization.
The problem begins when I need to add the implement of the first requirement. When a user enters a task, the system should check that maybe the new task becomes the closest, so the waiting time is shorten to the execution time of the new task.
I understood that servlets are an easy to use tool for handling HTTP POST requests, but I also understood that opening a thread is not a good programming, and discouraged. I think I could start a thread of the queue manipulations in the init() method of the servlet, and this thread could handle all the pops from the queue, waits, and execution of tasks. In this implementation each doPost(), will access the queue and add the new task given by the user with the POST request. But as I wrote, I understood that opening a thread by myself in a servlet indicates that the architecture is not good, so I thought about another solution.
My second idea was to use RMI. The queue manipulation, which is already written as an application, will be a RMI server, and the servlet will be a RMI client, that for each doPost(), invokes a remote method, which, in the separated application, enters the task to the queue. This idea looks more logical to me, but as far as I know, RMI takes expensive performance, and maybe inter-process communication can be avoided at all.
If anyone has read all of this, and has an idea, or can give an advice, I will very appreciate it.
Thanks a lot!
Assaft

First of all I would like to thank all of you for giving excellent advices and paying attention.
I�ve read all of your replies, and think about the following:
There will be a servlet and a separated application (called �Events Manager� � �EM�), and they will communicate by RMI.
The servlet will recognize events entered by a user, (using XSL, it will traslate it to a known XML-based transfer object of the system, and invoke an insertEvent() method on the EM side. It will get a result, sometimes used for producing the response page.
The EM will have two threads:
1.     Listener for insertEvent() invocations � for each invocation, a singleton events factory will be used for constructing an event instance, which gets all the data given about the event from the servlet. The instances will be instantiated using dynamic loading of it�s class using the recognized event name. This instance will be written (using serialization) to a column in a database table, designed for events. The column of the execution time will sort this table.
2.     Executer for events � wakes up each 2 seconds, and gets the first row from the events table. Than, regenerates the instance (again, by serialization), and execute the doEvent() method of the instance (this method was declared in the Event interface, which every event implements). The result of the method will give an answer whether the event was totally finished, and its line can be removed from the table, or maybe it wants to be executed again in x seconds, so the instance must be stored again in the event�s row, and the table needs to be resorted. In this way I will have stateless events and statefull events.
In the queue there will be an event, regular as every other possible event, that backups the database to another storage. This event will have execution time of every 2 hours. This will guarantee that the whole system is backed up, and can be restarted without a problem.
In addition to that, this implementation will allow scalability of events, because in order to add new events to the system, the only things to do are to add the ability to the servlet side, and supply a class with the corresponding name, which implements the Event interface, and will be loaded and instantiated later by the first thread of the EM.
Last remark: I don�t use EJBs because I didn�t study it yet, and have only 3 weeks to finish the whole thing. In the future I�ll redesign it using EJBs.
Thanks a lot!
Assaf

Similar Messages

  • How to deploy an app with servlet and background processing

    i have a servlet with background processing. it has to run 24 hours a day.
    but i have problem with shutdown (after 1-2 hours without user action). [9iAS 9.0.3.0, windows 2000]
    i created for application seperate OC4J (in the EM) and i deployed it there. first time as war file, later as ear file (because there is possible to re-deploy only ear file).
    but it seems that the servlets are not designated to run as a uninterruptible task.
    the question is: how to deploy such (servlet + uninterruptible background processing) application in the 9iAS?
    a) everything in the OC4J (then how to disable shutdown?)
    b) servlet in the OC4J. where (and how) to install the rest of application?
    b1) servlet in the OC4J + rmi/soap/... + standalone server?
    what is the standard in the oracle world :) ?
    thanks

    Better to post your topic in the iPad in the Enterprise community.
    This is the, "Using Mac App Store" forum and for the most part for troubleshooting the App Store.

  • Servlet background process on tomcat 4.0.2

    i have 1 servlet which will run a thread, background process, whenever the init() on that servlet called. i tried on tomcat 3.3a and tomcat 3.2.3, and both tomcat will run my servlet's background process, will run the thread. but, when i run the servlet using tomcat 4, tomcat 4 will run the init(), but when it do not start the thread. what happen?... i used the same code, servlet, on tomcat 3.2.3, 3.3a and 4....
    can anyone explain it to me?.....

    my code look like this:
    public class Discover extends HttpServlet implements Runnable
    Thread t = null;
    boolean running = false;
    public void init()
    t = new Thread(this);
    t.start();
    System.out.println("thread start");
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws
    ServletException, IOException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("discover=" + running);
    public void run()
    running = true;
    System.out.println("thread running...");
    * do some stuff here....
    running = false;
    System.out.println("thread stopped...");
    i tried this servlet on tomcat 3.2.3 and 3.3a and the thread run. i can see the 'thread start', 'thread running' and 'thread stopped' on the tomcat console. but, when i use tomcat 4, i can only see 'thread start' on the console, which show that the run() is not execute...... y?... please help me.......

  • GUI_DOWNLOAD and background processing

    Hello,
    I have created a process which creates a file. this process uses GUI_DOWNLOAD to put the file on the users C drive or other directory on our network. The user wants to run this process in background and the program is returning a 6  (error unknown) from the GUI_DOWNLOAD FM. I was looking on SDN and found out the GUI_DOWNLOAD only works in foreground. You have to use OPEN and CLOSE DATASET statements to process in background. I am thinking about putting a button to denote foreground/background processing and using the appropriate statements to process the file. I will then have to get the file from the app server to a place will the user can get access to it.
    <b>first question</b> - is there a FM to do a FTP from the app server to a directory on our network for the user to access?
    <b>second question</b> - is this the right approach or is there something else that I should be doing.
    thanks in advance for your help

    Hi,
    Yes, your right, GUI_DOWNLOAD wil not work in background mode, you need to place the file in Application server, here.
    See the below link for a FTP program, use the proper commands(i do not know whether downloading the file is possible through the commands)
    http://www.sap-img.com/ab003.htm
    or else, write a small program which downloads the data from the application server, but it should run in the foreground
    Regards
    Sudheer

  • Background Processing? how schedule job for "System Error" Message .

    Hello everyone,
    in sap help i have read.
    http://help.sap.com/saphelp_nw04/helpdata/en/5a/f72040599a8f5ce10000000a155106/frameset.htm
    PCK> Monitoring>Message Monitoring-->Background Processing
    you can schedule jobs for various background processing:
    ●     Archiving of messages processed successfully
    ●     Deletion of messages that are not to be archived
    ●     Restarting of messages with errors
    ●     Rescheduling of lost messages
    can anyone understand this docu?
    give me some introduction, how can i define and schedule these jobs ?
    thx in advance!!
    best regards
    Yaning

    Background Processing
    Prerequisites
    You have started the message monitor on the initial screen of the PCK and are in Background Processing.
    Features
    Archiving
    You require two archiving sessions to archive messages:
    ●     One session to write the messages to the archive
    ●     One session to delete the persisted messages that have been archived
    To do this, you schedule an archiving job, which implicitly schedules the sessions to write to the archive and delete the archived messages.
    You can define one or more rules for each archiving job; these rules contain conditions that a message must meet in order to be archived by the job. At least one of the defined rules must be met for archiving to take place.
    All information that is displayed for a message in message monitoring is archived, in addition to the audit log for each message.
    Deleting
    A standard delete job is created automatically. It runs once a day. You can schedule additional delete jobs; however, you cannot define rules for them.
    Restarting
    Instead of restarting messages with errors manually with message monitoring, you can schedule a job to automatically restart these messages. This is possible for all messages for which the number of defined restart attempts has been exceeded (messages with the system error status).
    You can define one or more rules for each job to restart messages; these rules contain conditions that a message must meet in order to be restarted by the job. At least one of the defined rules must be met for archiving to take place.
    Rescheduling
    A standard job to reschedule messages is created automatically. The job runs once a day and ensures that messages lost as a result of database failure, for example, are rescheduled. You can schedule additional rescheduling jobs; however, you cannot define rules for them.
    Thx Aamir.
    But I mean the messages with errors in Adapter Engine , not in Intergrations Engine.
    the situation is like Naveen Pandrangi's WebLog
    II. Errors in Adapter Engine [XI :  How to Re-Process failed XI Messages Automatically|XI :  How to Re-Process failed XI Messages Automatically]
    I
    Till now we have seen how to resubmit/restart message that failed in Integration Engine.  One a message makes it from Integration Engine to Adapter Engine, the message is flagged as checked in Integration Engine. The status of the message in Adapter engine does not effect the processed state in Integration Engine. Now if this message was asynchronous, XI will by default try to restart the message 3 times at intervals of 5 minutes before the status of the message is changed from Waiting to System Error .
    *how can i schedule a job to automatically restart these messages with errors?
    best regards
    Yaning
    Edited by: Yaning Liu on Aug 18, 2008 1:43 PM

  • ABAP trail 7.00 timeouts and background process

    Does anyone knows if it's possible to change the number of dialog and background processes?
    And the transaction to change the timeouts of such processes?
    Thank you

    you can change the timeout in rz11.Parameter-name is rdisp/max_wprun_time. Backgound processes habe no timeout, so this value is only valid for dia-processes
    To change the number, you have to adjust your instance profile. In the forum  'Netweaver Administrator' should be some information about that. So just the short hint: you can adjust the profiles in RZ10, but have to do some steps for that. Just search in NW-Admin-forum above.
    Regards,
    ulf

  • Background processing needed...

    iWeb needs to background process.
    Each shape/rollover/png/navbar/image-resize file needs to be generated as you make it, or in the background if you're working fast. Every time you alter the item's size or appearance on the iWeb page, it should regenerate it, but if you don't alter the item it leaves the generated file untouched. Moving the item on the iWeb page should not alter the already generated file. Altering plain text on a page should not change anything, only the html file.
    There should be an info page like iDVD informing you of background encoding status. You can however save at any time (like iDVD).
    When you come to publish, it should generate all other items that have changed or not yet been background encoded (as it does now).
    Next time you open iWeb to work on it, all encoding is all up to date (as it did it all prior to publish), so any items that have not been changed should be untouched, and only new items need to be encoded and hence published.
    That way, only changed items are generated, not the whole shebang. Thus saving everybody's wasted time and effort in uploading/finding changed files etc.
    It should be perfectly possible as iWeb has an undo and a restore feature, so it is already keeping track of changes all the time.
    What do you think, will this be in iWeb 1.2, iWeb 2.0, or Web Studio Pro 1.0 ?
    Michael
    Quicksilver G4 Dual 1GHz   Mac OS X (10.4.5)   http://www.rowan-cottage.co.uk

    Hi,
    This is the F1 documentation for calling a FM in Update task
    Flags the function module func for execution in the update task. It is not executed at once, but the data passed with EXPORTING or TABLES is placed in a database table and a subsequent COMMIT WORK then causes the function module to be executed by the update task.
    This is the F1 documentation for calling a FM in background task
    Flags the function module func to be run asynchronously. That is, it is not executed at once. Instead, the data passed using EXPORTING or TABLES is placed in a database table and the next COMMIT WORK executes it in another work process.
    Hope this helps
    Regards,
    San

  • Background processing of CM21

    Hello all
    I am trying to run the transaction CM21 in background processing through LSMW transaction, but it shows me the following error per each item:
    Run-time error "RAISE_EXCEPTION" occurred
    > Short dump "101201 202224 MEXQAS01 0_ECQ_01 " generated
    Does anyone know about the error? Or the best option to run the transaction CM21 in background processing massively (LSMW).
    Thank you in advance.

    Hi,
    1. What are u tyring to do with CM21 in BG job?
    2. why didnt you try the CM40 - Execute ?
    Reg
    dsk

  • SAP BI 7 - Background process performance Issue

    This question is about efficiency of dialog process compared to inefficiency of the background process and I want suggestions from SAP Basis/BI experts on this.
    We have observed that our background processes on BI server are not running as efficiently as we would like them to run.
    For example
    DSO activation:
    When I use Dialog mode for DSO Activation with 3 parallel processes, I can activate a certain DSO with in 15 seconds. But the same DSO and the same data package when activated using background mode with 3 parallel process takes about 15 minutes.(there are plenty of background processes available on the system when this activation is running). So dialog process runs 60 times faster than background process.
    In BI 7 most of the operations can be executed only in the background parallel mode. And from the activation example we know that our background processes are not as efficient as dialog processes. It
    is understood that in general the background processes will not be as efficient as dialog processes, but in our case the difference is a factor of 60. We want help to identify, why the background processes are not as efficient as dialog processes. What SAP Basis settings need to be changed to make them as efficient as we can. Any suggestion or help will be highly appreciated.

    Hello Eswaran
    Generally a dialog process is not faster by any means than a background workprocess. Nevertheless i trust you on your observations, so there must be some difference. I just did a small test, i ran SE16 chose a big table and selected 10000 rows, i did 3 tries in dialog and 3 in background. The results:
    dialog: 10.2s, 9.4s, 9.6s
    background: 26s, 24s, 24s
    So even in my simple example the background execution took more time. The issue here is, that the resulting output (which is pretty large) had to be saved additionally in a spool (a total of 167 pages) when executed in background. The selection of the data certainly did not take more time in either case.
    The most important difference between dialog and batch processes is the memory management. Dialog processes work with a shared memory segment (extended memory). Background processes have their private heap memory.
    Nevertheless, background processes are not "slower" in general, not at all. You will need to observe closer, what your processes are doing. Maybe watching SM50 while running the DSO activation is enough to see it, maybe you need to trace a process. If you see large spools generated, or huge amounts of memory consumed, we might already have an answer.
    Regards
    Michael

  • Background processing- download multiple itabs into one excel with tabs

    Hello,
    I want to run a report as a background job and download the outputs in excel file into different tabs.
    Problem is OLE does not run in background mode.
    Are there any other alternatives for that?
    I searched the forum and did not get any useful answer for background procesing. All the topics use for foreground processing.
    (Old query for reference:- )
    [background processing] multiple work sheets in single attachment file
    Thanks.

    Hi,
    Even i had the same issue before, what i did is, i written a program which will run in the background and stores the data in application server file, and also it sends the email to user saying that 'the data is soted in application server, to veiw please run the ZXXXX transaction code to view,
    The second transaction code is having the OLE code which will download the data into an excel sheets with more than 1 tab.
    Thanks
    Sudheer

  • RHINTE20 and background processing

    Does anyone know how to set a variant when running RHINTE20?
    When I run the program it presents a list of objects to be corrected, and I manually select all the subtree with the icon and then run Create Several Objects.  It's these last two steps I'd like to specify in the variant, so I can setup the job to run nightly (grab the folders and process all objects).
    Thank you in advance for any hints to resolve this.
    Cheers, Al Perkins

    Hi Albert,
    Make all your selections and click on Save (CtrlS). You will be taken to Variant Attributes screen. Give the variant name, meaning, check "only for background processing" and save. Then when you execute the program, you should be able to select your saved variant by clicking on Get Variant (ShiftF5).
    Donnie

  • RFC in background process.

    Hi All,
    I hve to process a RFC in background process.
    For doing that firstlly i hve creted va rfc n it's wkg fine then using this syntax i called this rfc for background task
    CALL FUNCTION 'Y_DYNTABLE1_AJ' IN BACKGROUND TASK
    DESTINATION 'rfc_bacground'
    buy whenever any error raise this rfc created a error log in sm58 n i can watch it in sm58 but whenever it's work fine then i'm unble to see there result in sp01, beco'z  it's nt creating any spool in sp01 n my result is in table form.
    pls help me how to get my result
    regards,
    Anuj

    With this option you can EXPORT the whole internal table to INDX table and you can IMPORT the table for later usage.
    Please refer to demo programs DEMO_DATA_EXT_CLUSTER_EXPORT_D and DEMO_DATA_EXT_CLUSTER_DELETE.
    Make sure that you delete the the cluster after you import the data.

  • No background processing active on TargetServr BWTCLNT400

    Hi There
    I am currently working on a landscape where we have had a copy-back on our CRM system, plus the BW system was moved onto new hardware etc etc. the net result is that I am having a nightmare re-establishing the comminications CRM --> BW (which is now sorted) but especially BW --> BW.
    I have sorted out all the usual stuff (SM59, WE20, WE21 etc etc) but when I run an update from an DSO in BW to another InfoProvider using the 3.x data flows, I get the following error in SM21:
    BP_JOB_MODIFY: Job cannot be modified. Reason:
    > Job BIREQU_62ZSSTFTQ5AI5RW1Y429235SE contains invalid data
    BP_JOB_MODIFY: Job cannot be modified. Reason:
    > No background processing active on TargetServr BWTCLNT400
    I suspect this has definitely something to do with me trying to sort out the process chains and de-scheduling the background job for BI_PROCESS_LOADING on the BW system.
    When I try to re-shedule this job using SM37, where you define a step for the ABAP Program RSPROCESS the system insist that I should enter a variant (which does not exist). So obviously I am being a muppet.
    Does anybody know how I can re-start the Background Processing (I suspect there is a program that needs to be run or something)?
    Any help would be MUCH appreciated.
    Cheers - Daneel

    Hi
    I m facing the same error .. please check this note 147104 might be helpful in your issue..
    check the entry in table ROIDOCPRMS for target system.. for the current source system.
    Thanks
    Sonal....
    Edited by: Sonal Patel on Aug 28, 2009 12:08 PM

  • Workflow not working in Background Processing

    Hi All,
    I am relatively new to Workflow.  Currently, I am creating Deliveries (preferably in background) once a Sales Order is created.  I am using an ABAP Class as the object method to submit the sales order number to the delivery processing method (which just submits basic information to standard SAP transaction VL04).  I found that if the execution of the delivery creation task is not in Background Processing (the user manually kicks off the Delivery creation in SBWP) the workflow works as expected and creates the deliveries.  However, if the Background Processing is checked, the workflow does not process and does not create a delivery.  Is there any specific reason as to why the workflow will not work in background?
    Any help you can give would be greatly appreciated.  Thanks.
    John

    Hi,
    John
    See to process a Back ground task, there should be a proper parameter flow.
    Please look at the import parameters in the method you are using to process the back ground task..
    If proper import parameters are passed then the task will work
    This should help..
    Thanks,
    Shanky

  • Background processing - unable to access the file

    Hi Gurus!
    01/09/2009 00:00:06 Job started
    01/09/2009 00:00:06 Step 001 started (program ZWELL_UPLOAD, variant 20080107WMI-1, user ID STIWARI)
    01/09/2009 00:00:06 File P:\SAP\ERP\ZWELL\wmigdc\wmi_dls_extract_20090107_3 does not exist or cannot be opened
    01/09/2009 00:00:06 Step 002 started (program ZWELL_UPLOAD, variant 20080107WMI-2, user ID STIWARI)
    01/09/2009 00:00:06 File P:\SAP\ERP\ZWELL\wmigdc\wmi_dls_extract_20090107_2 does not exist or cannot be opened
    01/09/2009 00:00:06 Step 003 started (program ZWELL_UPLOAD, variant 20080107WMI-3, user ID STIWARI)
    01/09/2009 00:00:07 File P:\SAP\ERP\ZWELL\wmigdc\wmi_dls_extract_20090107_3 does not exist or cannot be opened
    01/09/2009 00:00:07 Job finished
    Can I get some help as to why is it not able to loacte the file when run through background processing when its able to read and excute when I directly run the program. Is theer any settings that I need to set up in the ABAP program itself which will enable to make it happen or else what to do so that I can set a background job to happen successfully.
    Thanks

    I have assigned thhose correctly I believe.
    *   Selection-Screen                                            *
    selection-screen  begin of block 1 with frame title text-001.
    parameters:  p_bukrs type t001-bukrs default '1000',      " company code
                 p_zss type zsds_uwi-zss,                     " Survey system
                 p_pathps like rlgrap-filename modif id g1 ,  " Presentation server path
                 p_pathas like rlgrap-filename modif id g2 ,  " Application server path
    *             p_pbkas  LIKE rlgrap-filename MODIF ID g2 ,  " Backup path
                 p_err    like rlgrap-filename ,               " error file as SAP table format
                 p_err2   LIKE rlgrap-filename,               " error file as input format
                 p_ps like ssfparms-binccerts radiobutton group ssff " Presentation server
                 default 'X' user-command shift,
                 p_as like ssfparms-binccerts radiobutton group ssff." Application server
    selection-screen  end of block 1.
    *   Includes                                                           *
    include zwellupd0001. "Top Include
    include zwellupd0002. "Form Include
    *  Initialization.
    initialization.
    *--- Assign default '1' to survey system
      p_zss = v_zss = 1.
    *  At Selection-Screen                                          *
    at selection-screen output.
      perform modify_screen.
    *-Presentation
    at selection-screen on value-request for p_pathps.
      call function 'KD_GET_FILENAME_ON_F4'
        exporting
          static    = c_x
        changing
          file_name = p_pathps.
    *-Application
    at selection-screen on value-request for p_pathas.
    *- Assign the Physical File Name Using a Logical File Name
      call function 'FILE_GET_NAME'
        exporting
          client           = sy-mandt
          logical_filename = c_asin
          operating_system = sy-opsys
        importing
          file_name        = p_pathas
        exceptions
          file_not_found   = 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.
    at selection-screen on value-request for p_err.
        call function 'KD_GET_FILENAME_ON_F4'
        exporting
          static    = c_x
        changing
          file_name = p_err.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_err2.
        CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          static    = c_x
        CHANGING
          file_name = p_err2.
    *  Start-Of-Selection                                           *
    start-of-selection.
    *---Modify the screen variables as per the user selection
      perform initialize.
    *--- Upload file from Presentation
    *  PERFORM upload_ps .
    **--- Upload file from Application
    *  PERFORM upload_as .
      perform upload_file.
      perform write_err_file.
    *  perform write_err2_file.
      perform write_report.
    *  End-Of-Selection                                             *
    end-of-selection.
    *&      Form  modify_screen
    *       Modify the screen variables as per the user selection
    form modify_screen .
      if p_ps = 'X'.
        loop at screen.
          check screen-group1 = c_g2.
          screen-active = 0.
          modify screen.
        endloop.
      else.
        loop at screen.
          check screen-group1 = c_g1.
          screen-active = 0.
          modify screen.
        endloop.
      endif.
    endform.                    " modify_screen
    *&      Form  initialize
    *       Assign Local Variables
    form initialize .
    *-Pass selection screen fields to local variables.
      v_zss      = p_zss.
      v_pathas   = p_pathas.
      v_pathps   = p_pathps.
    *  v_pathbkas = p_pbkas.
      v_ps       = p_ps.
      v_as       = p_as.
      v_bukrs    = p_bukrs.
    endform.                    " initialize
    *&      Form  write_report
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form write_report .
       if v_zss = 1.
          write: /  '*** Update report for DLS ***'.
       else.
           write: /  '*** Update report for NTS ***'.
       endif.
       write:
              / 'Input File Count', g_inp_count,
              / 'Insert     Count', g_insert_count,
              / 'Updated    Count', g_upd_count,
              / 'Failed     Count', g_err_count.
    endform.                    " write_report
    *&      Form  write_err_file
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form write_err_file .
           case p_as.
            when 'X'.                      "X is application server
    *         TRANSLATE FILENAME USING '\/'." correct slash for unix
              open dataset p_err for output in text mode encoding default.
              if sy-subrc = 0.
                loop at t_err into s_welldls.
                  transfer s_welldls to p_err.
                  if sy-subrc ne 0.
                    message i010(ad) with p_err 'Download Failed'.
                  endif.
                endloop.
                close dataset p_err.
              else.
                message i010(ad) with p_err 'dataset could not be found'.
                sy-subrc = -1.             "Maintain error condition
              endif.
            when ' '.                      "Blank is presenation server
              translate p_err using '/\'."correct slash Dos file
              call function 'DOWNLOAD'
                   exporting
                        filename = p_err
                        filetype = 'DAT'   "FTYPE set to ASC in DATA seg
                   tables
                        data_tab = t_err.
                   if sy-subrc ne 0.
                message i010(ad) with 'File ' p_err 'cannot be located.'.
                sy-subrc = -1.             "Maintain error condition
                exit.
              endif.
          endcase.
    endform.                    " write_err_file
    even the constants:
    *-Declare survey system as constants
    CONSTANTS: c_dls TYPE zsds_uwi-zss VALUE '1',
               c_nts TYPE zsds_uwi-zss VALUE '2',
               c_x   TYPE c VALUE 'X'.
    *-Logical File Path maintained in Txn FILE
    CONSTANTS:
    c_asin  TYPE filename-fileintern VALUE 'Z_INTERFACES_IN_WELL_MASTER',
    c_asout TYPE filename-fileintern VALUE 'Z_INTERFACES_OUT_WELL_MASTER'.
    *-Screen Grouping
    CONSTANTS:
    c_g1 TYPE screen-group1 VALUE 'G1',
    c_g2 TYPE screen-group1 VALUE 'G2'.
    DATA: v_folder  TYPE string.
    DATA: v_filestr TYPE string.
    DATA: v_datalen TYPE i.
    DATA v_rec(1000).
    Thanks

Maybe you are looking for

  • AJVOAF: not allowing searching more than once

    Dear Friends I did a vo extension in R12 to add extra fields to material LOV. Here for material LOV ,one can give search crieteria through 1.Material 2.Description 3.Crossreference etc. Here when we are searching for first time like by giving % OR an

  • Error while calling DYnamic shell task flow from unbounded login activity

    Hi All, MY problem-Hi , In my case I have alogin page in undounded task flow which calls dounded task flow. My bounded task flow uses dynamic tab shell.And if login is successfull user will be directed to welcome page where default welcome tab shell

  • Browser Plug-in / Paid Job

    I need a plug-in that calls up a web browser within PS, nothing more.  I will pay someone for the Job, I assume good knowledge of the SDK will be required. 

  • Pencil mark-ups disappear and Drawing Markups box goes black

    As I use Adobe Reader X, after a few pages of using the Comment--Drawing Markups tools, like the pencil marks, these start going goofy, disappearing an reappearing. Also the Drawing Markups box goes black, the "find" windows starts to disappear too.

  • JDBC thin driver pads CHAR col to byte size when NLS_LENGTH_SEMANTICS=CHAR

    We're using an Oracle 9.2 database with the database character set specified as AL32UTF8 with NLS_LENGTH_SEMANTICS set to CHAR. I've reproduced this problem with both the "classes12.zip" and "ojdbc14.jar" available with the Oracle 9.2 client installa