FM used in background job throws an Exception-NO_BATCH

Hi,
I have one normal ABAP report with selection screen, where selection parameters are file names and they are used for uploading data from excel to internal table and then internal table to excel respectively.
Now I want to put this as a background job. So I saved the variant and now while running the job there is an exception.
Reason for the same as I could find out is:
while uploading function module (KCD_EXCEL_OLE_TO_INT_CONVERT or ALSM_EXCEL_TO_INTERNAL_TABLE) is called, it has some front-end  services called.
That is in case of first function module, it is CLPB_IMPORT which in turn calls WS_QUERY where GUI_EXIST is checked and there it throws an exception.
And in the later case it is cl_gui_frontend_services class and its some method is called.
So basically, frontend services are called in any case and I still want this as a background job.
Can Anyone clear it conceptually?

Hello Krupa,
The rule is pretty much simple: <i>Anything that you do in batch / background, cannot have anything to do with the front-end / desktop.</i>
The Excel sheet you use is an application that runs on the Frontend, right? So you cannot do it in batch. The reason, to put it crudely, is that a background job is run by a different workprocess altogether and that work process is not capable of accessing the front-end. Ideally, a background job should be run-able even without a GUI!!
SO what you can do in a background job, is to operate on the files present on the application server (that is where the job runs).
Hope that is clear. If not, get back.
Regards,
Anand Mandalika.
Regards,
Anand Mandalika.

Similar Messages

  • Find out particular printers that are being used by background jobs.

    Find out particular printers that are being used by background jobs..
    Hi Gurus,
    I have to remove some printers from SPAD, but before removing those printers I have to make sure that those are not being used by any background jobs.   The table TBTCP can be used to identify which jobs are still using those printers, but this is a tedious process. 
    Any input would be highly appreciated.
    Thank you
    Adil

    Hi Adil,
    I'm lazy so I'd just run this SQL
    select distinct(jobname), pdest from SAPSR3.TBTCP where PDEST in ('LP01', 'LOCL') ;
    Just put the printers you want as shown above and just perform a little manual cross check by checking the job in SM37.
    And that's it .....
    Cheers,
    Amerjit

  • GUI_DOWNLOAD can not be used in Background Job?

    Hi,
       I tried to use GUI_DOWNLOAD to output a TXT file to my local disk. If I just execute my program, it is successful. I can find the file on my D disk. But if I try to scheculd a backgound job, it will fail. It job log says 'Could not ascertain code page Job cancelled after system exception ERROR_MESSAGE'.
      So I don't know whether the GUI_DOWNLOAD support background job, or I have to find another FM or method to output my TXT file.
       Thank you.
    Best Regards,
    Yan

    Hi Yan Chen
    While executing the program in background, we can not download to presentation server(i.e local disk). We have to download to application server using commands like OPEN DATASET, TRANSFER & CLOSE DATASET statements.
    Once downloaded to application server, we can bring the file to local disk using transactions like CG3Y.
    <u><b>Sample Coding for your reference:</b></u>
    open dataset <dsn> for output in text mode encodind default.
    if sy-subrc ne 0.
      write:/ 'Unable to open file:', <dsn>.
    else.
      loop at itab into <wa>.
             trasnfer <wa> to <dsn>.
      endloop.
      close dataset <dsn>.
    endif.
    Kind Regards
    Eswar

  • Export with BiarEngine.jar works, using the API it throws an exception

    Hello,
    I'm using BiarEngine.jar to export from my CMS. it works fine.
    Now I want to use the API to get someting more handy, but I receive an exception (NoSuchFieldError) as if I had a mismatch between versions.
    I'm stuck with it, if somebody has an idea...
    Thanks a lot.
    Alain
    Here is the java code:
    IExportOptions oExportOptions = BIARFactory.getFactory().createExportOptions();
    oExportOptions.setIncludeSecurity(false);
    oExportOptions.setIncludeDependencies(true);
    oExportOptions.setCallback(
         new IExportCallback()
              public void onSuccess(int id)      {...}
              public void onFailure(int id, BIARException biarException) {...};
    BIAROutput oBIAROutput = new BIAROutput( oEntrepriseSession, "c:\myFile.biar", exportOptions );
    At this point it throws the exception:
    Exception in thread "main" java.lang.NoSuchFieldError: SI_MODELCUID_SET
         at com.businessobjects.sdk.plugin.desktop.deltastore.internal.DeltaStore.setupProperties(DeltaStore.java:188)
         at com.businessobjects.sdk.plugin.desktop.deltastore.internal.DeltaStore.unpack(DeltaStore.java:37)
         at com.crystaldecisions.sdk.occa.infostore.internal.al.continueUnpack(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.al.startUnpack(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.InternalInfoStore.queryHelper(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.InternalInfoStore.query(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.at.query(Unknown Source)
         at com.businessobjects.sdk.biar.internal.XSDManager$RepositoryXSD.retrieveXSDVersions(XSDManager.java:204)
         at com.businessobjects.sdk.biar.internal.XSDManager$RepositoryXSD.<init>(XSDManager.java:194)
         at com.businessobjects.sdk.biar.internal.XSDManager$XSDCache.getXSD(XSDManager.java:365)
         at com.businessobjects.sdk.biar.internal.XSDManager.<init>(XSDManager.java:55)
         at com.businessobjects.sdk.biar.BIAROutput.<init>(BIAROutput.java:73)

    >
    Just need to confirm if the ANT script can be run against individual OSB project than OSB configuration project?
    >
    It is possible. I'm going the same way here. However, I remember I needed to contact support because it was not a standard feature of the Ant task. They provided me with the patch that allowed me to use -configSubProjects parameter in export.
    >
    Can we have multiple OSB configuration projects on the OSB server ?
    >
    I don't think so.

  • How to download output process receipt /SAPAPO/RRP4 using a background job.

    Hello,
    I am taking download for various location and product in the /SAPAPO/RRP4 , /SAPAPO/RRP1 or /SAPAPO/POV1.
    But as the size of the output data is very high, many times it loggs out.
    Can anybody suggest how to run this report in background ad take download.
    Regards

    Hi,
    We also had similar requirement and we have tried in many ways to set the job to run in background and to download the output but we failed. Then we developed the Z program using BAPIs with excel interface. You can use BAPI - BAPI_POSRVAPS_GETLIST3 to get the list and then filter as you require and download the put put using excel interface.
    It works.
    Regards
    Venkat

  • How to get data from the called program using SUBMIT in a background job?

    Hi Experts,
    I've a program which creates a background job using JOB_OPEN and JOB_CLOSE function modules.
    Between the above function modules I need to call a program using SUBMIT VIA JOB statement.
    My problem is, How do I fetch some data in an internal table in the called program to the calling program after the SUBMIT statement?
    I tried to EXPORT and IMPORT the data, but they are giving a failed sy-subrc when using this background job.
    Kindly let me know your inputs and valuable suggestions.

    Kumar,
    When we execute a program as a background job then the output will be sent to Spool which needs to be fetched again.I guess we need to use Submit via spool as mentioned by Rajat.
    Check these threads to get some idea
    submit report to spool & import spool id
    Re: Generate Spool for a report
    K.Kiran.

  • Setting up archive delete functionalities using background job

    Hi,
    Through SARA transaction there we can set up a archive delete job by selecting the files, job timing details. Instead of this, we want to set up this functionality using a background job as per the variant and timing requirements.
    Is there any option to set up a background job of archive delete functionality by selecting the files through a program or function moduel. Please suggest me if anyone has done this in previous.
    Thanks,
    Siva

    Hello,
    Take a look at OSS note 205585 which describes how to schedule archive delete jobs indirectly using program RSARCHD.
    Hope this helps.
    Best Regards,
    Karin Tillotson

  • Call Function Destination in a background job

    I am having a problem using:
      CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC'
             DESTINATION p_dest
    in a background job.
    I am working on a program that would compare the same table in 2 different systems and write the differences.  It works when I run it in the foreground.  However, I want to run this in a nightly background job.  However, it is failing and I beleive that it is the result of the program needing a user to interactively logon to the remote system.
    How can I bypass the logon screen or enter information into the logon screen using a background job?
    Thanks.
    Jon

    Hi Jonathan,
    Would you like to reward some points to the poster to thank them as a part of SDN Contributor Recognition Program?
    You can click on the yellow star on the right of each post header to reward points.
    For more information:
    https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
    John.

  • Create a Excel File in a Background Job

    Hi SAP Gurus,
    I am trying to create an Excel file using a background job but it is not possible.
    In foreground mode i get a file.
    Can someone give an explanation for that? Or someone have a workaround ??
                   Best Regards
                          João Fernandes

    João,
    If you have successfully demonstrated that SAP can write an output to an excel file, then it can do this in background as well as foreground.  The problem is probably not with the fact that it is 'Excel', but that it is trying to write a file in the background to a destination file location that is unknown to the system.
    Generally, without special setup, SAP software is unaware of most file locations that are outside of the SAP system itself.  When you log on through the SAP Gui, the SAP back end can "learn" about certain additional file locations through your PC setup and the SAPGUI session.  This 'knowledge' is lost as soon as you commit your program to a background process.
    Talk to your Basis person, and tell him what you wish to do.  This functionality is possible to do, but probably not in the way you are expecting.
    Best Regards,
    DB49

  • DP background job version value shows *to{q}ZsmfF*

    Hi,
    I am using DP background jobs in Mass processing. The Version field in the mass processing job displays value as "toZsmfF".
    I tried to change the version to 700 in transaction SAPAPO/MC8D. But the version field is disabled.
    I also tried after removing the DP background job from all the process chains where ever it was used. After that also the version field, planning book,data view are not active to change (greyed -unable to change). How can change the  version value in the DP background jobs.
    Thanks and regards
    Murugesan

    This is becasue the DP job executed without initializing the planning area for the version. Created new job with differenet name and assigned with version.

  • Error in Background Job Processing.

    Dear All,
             I am using a background job for processing the outbound delivery.
             In the user exit in delivery program I am checking for the combination of
             ship to party, Material & Batch of outbound delivery in a ztable. If the combination exists in
             Ztable I do not want to save & ignore this delivery creation and continue with the next
             delivery order creation thru the batch job.
             However I need to give an error / warning message for the delivery orders
             which are not created so I am giving the error message as success message
             in  the below format :-
              IF L_RETURN-TYPE = 'E'.
                MESSAGE S000(Z64_I) WITH L_RETURN-MESSAGE_V1
                                         L_RETURN-MESSAGE_V2
                                         L_RETURN-MESSAGE_V3
                                         L_RETURN-MESSAGE_V4
                                         DISPLAY LIKE 'E'.
                PERFORM FOLGE_GLEICHSETZEN(SAPLV00F).
                FCODE = 'ENT1'.
                SET SCREEN SYST-DYNNR.
                LEAVE SCREEN.
              ENDIF.
            But my job is finished as soon as the above message is encountered and the
            rest of the outbound deliveries are not created.
            However if I execute the progarm in foreground the execution is working fine.
            Could you please let me know what do I need to code / do corrections to make
            the program run successfully in background.
    Thanks & Regards
    Jitendra Gujarathi

    Hello,
    Check system log and also check work process trace, to know the error.
    I feel that it could be Authorization issue, you don't have sufficient authorization to do.
    Hope this helps.
    Regards
    venkata
    Edited by: venkata emandi on Sep 12, 2011 8:13 AM

  • Date and time for background job

    Hi,
    I am creating a program with out selection screen . This program runs based on date and time . so I need to create a table
    with date and time fileds.
    Program runs based on FROM DATE FROM TIME  TO DATE  TO TIME....... FROM DATE and FROM TIME  will get it from ztable and TO DATE & TO TIME values as SY-DATUM & SY-UZEIT. In the end I will update sy-datum and sy-uzeit values in the custom table to get the values ( Use it for from date from time ) for next run of the program.
    This program is mainly used for background job so how do we get the values of from date and from time for the first run of the program ? how do we update the latest date and time details by deleting old date and time details.
    Thanks ,
    Vinay.
    Edited by: Vinay parakala on Apr 22, 2010 9:18 AM

    First of all, I'll suggest to maintain TVARVC instead of doing it in custom table unless you need a complete log.
    As per my understanding, you are trying to fetch some records based on the time period(Delta loads).
    So, you will do an initial run to load the complete data then you will run it for time periods. For example,
    1st Load- 01/01/1991(earliest date possible) - today's date say 03/22/2010
    2nd load- 03/22/2010 - today's date
    so on............
    You have to move the to date values to from date values and to date value needs to be updated by the latest one for each load.
    Do you have any dependency on background job? Please let me know if my understanding is correct or specify your requirement in detail.

  • Different Subroutines in Background jobs and Dialog jobs

    Hi guys,
    I want to execute some subroutines when the program is running  using a background  job  , and some other subroutines completely different when the user use dialog job ( program -> execute in background ) . I know that sy-batch  = 'X'  in both cases  , but, there is something else to identify them ? , any ideas .
    thank you .

    It will be - he meant that they start the background job from SE38/SA38 not run it online.
    SY-SLSET is a starter point for checking the variant used - dynamic variants are used when you don't pick one from the list.  However, this would not help if the user picked a variant and then scheduled the job dynamically.  Another option is to use function GET_JOB_RUNTIME_INFO in your program.  Assuming your scheduled jobs are named differently, you can check for the condition by checking the name of the running job.  Dynamically created jobs will have the program name as the job name.

  • Error in Mass process chain DP background job for Deinitialize version

    Hi,
    When I execute the process chain for DP background job to delete the planning area version, it gives error message
    "Process DP Background Processing, variant DELETE XXXXXXX has status Ended with errors (instance D973YTQRSF0FRPV5TCR28L"
    It is working well, when I tried the same manually with the same input parameters used in background job variant.
    What could be the cause for the background job problem.
    Thanks and regards
    Murugesan

    Hi Datta,
    I am not deleting the planning version, I am using Macro in the DP background job to delete or make the key figure values to 0.
    Thanks and  regards
    Murugesan

  • Invoice creation by background job

    Hi experts,
    How to create invoices using a background job?
    Please provide the steps.
    Thanks

    Go to transaction VF06 - Background processing
    In the documents to be billed input the
    Sales orgn
    Dist channel
    Division
    shipping point
    In case you would like to further filter data, choose billing dates, billing types, customer data etc otherwise leave them blank
    Now from menu bar, select Program -> Execute in background
    Now, Print screen parameter screen opens
    click enter button
    Now, start time screen opens
    Select the appropriate button
    since you want to schedule a background job
    click date/time button and enter schedule start date and time information as per your requirement.

Maybe you are looking for

  • Risk Violation flag showing green even if risks are there in the request

    Hi Experts, We are working in demo systems with GRC AC 5.3_10.1. 1) when a user creates a request for new roles, the request after submission from the user goes to the manger as a part of approval process. The manager opens the request. At this stage

  • No data selected neither transfered

    hi, I am new to owb plz help me out of this. when i am mapping two tables,the source table t_date having date format 'ddmmyyy' and want to have the target table t1_date with date format 'mmddyyyy'. I have used an expression operator then right clicki

  • IE Z-index hell

    I have a horizontal spry drop down menu that works great in Firefox and Safari on the mac, but not Internet Explorer on the pc. I'm pretty sure it is a z-index issue. The drop down is hidden under the div tag below it. I was able to fix it and make i

  • Archive and metadata in Records Management

    Hi, Can you advise if it's possible to archive Digital Personnel File contents which is stored in Records Management? We've got a requirement to archive Digital Personnel File contents (HCM Processes and Forms (Adobe) and other stored office document

  • OA FRAME WORK MATERIAL

    Hello friends , I am new to oracle apps field...i didn't have any knowledge about OA Fram work.. Could you please give your valuable suggestions to learn OAF and please provide materials of OAF . Thank you, Durga.