BAPI in background

Hi all,
  i have a report which uses a bapi to upload data .
  data is taken from a file on the pc.
  i have given the provision to provide the file path
  on the selection screen
  The report is running properly
  only problem is when running in the background it says
" front end function not possible in batch input mode "
  pls hlp
Regards,
tarang

Hi
U've to transfer the file to a path of Application Server and use statament OPEN DATASET/READ DATASET/CLOSE DATASET to read the file.
U can't run your report in background if you need to read the file from the pc (Presentation Server).
Max

Similar Messages

  • BAPI in Background mode

    Hi,
    How to schedule BAPI in Background mode.
    Thanks in advance.
    Regards,
    Madhavi

    Hi,
    When you create a batch input session, it remains in the batch input queue until it is explicitly started. Session processing can be started in two ways:
    An on-line user can start the session using the batch input menu options. (To access the batch input options, choose System>Services>Batch Input.)
    You can submit the background job RSBDCSUB to start a session in background processing. If several sessions have the same name, RSBDCSUB starts them all.
    It's possible to coordinate the generation and execution of a session in the background processing system.
    You can, for example, schedule both the batch input program and RSBDCSUB in the background. If you designate the batch input job as the predecessor for RSBDCSUB, then RSBDCSUB will be started automatically when the batch input job successfully completes.
    Alternatively, you can schedule both the batch input program and RSBDCSUB as job steps in a single background job. In this case, however, RSBDCSUB is started even if the batch input program should terminate abnormally.
    Hope this will help you.
    Regards:
    Alok

  • Can we execute BAPI in background?

    Hi All,
    I have a report in which i have used BAPI . I need to execute that report in background via a variant.
    Is it possible to run a BAPI in background ?
    Please suggest ?
    Thanks,
    Srinivas

    Hello Srinivas,
    BAPI is not standalone entity it has to be called by some other entity for e.g. report, function module, object method etc.
    So, it is not possible to run BAPI in background. Workaround to this problem is to create report calling BAPI and then schedule
    that report in background.
    For more information on JOB scheduling see following link:
    https://wiki.sdn.sap.com/wiki/display/Snippets/HowtocreateandreleaseaJob
    Thanks,
    Augustin.

  • Error in Check in of Originals by BAPI In background

    Hi Friends
    We have requirement to check in the documents in DMS in background mode using  BAPI_DOCUMENT_CHECKIN_REPLACE2 . Original files are stored on
    application server in folder G: drive . When I run this BAPI  in foreground mode it runs
    fine. But in background mode it gives error u2018Program no longer
    started via RFCu2019. No return possible.u2019 I debugged the BAPI and found that error occurs at
    function module 'CV120_FTP_START_REG_SERVER in include LCV120F06.
    Error occurs when it calls SYSTEM_START_REG_SERVER.
    When this program runs in background it is unable to find SAPGUI.
    That is why it fails while calling  function module RFC_PING inside function module
    CV120_FTP_START_REG_SERVER at line 28.
    I have referred note 505891 for DMS related issues.
    But when this BAPI runs in background it fails to check in.
    We have also requirement to check in files located at remote FTP location.
    Whether this is possible or not.
    With Regards
    Mangesh Pande

    Hi Mangesh,
    I'm facing the same problem, could you please give us some further explanations?
    ->Files are on the same server
    ->Checkin always fails (RFC-Callback not allowed)
    ->online works always fine (sure: with gui-download instead of FTP->No probs)...
    Does it mean, i need a special Storage category? the one i have has the vault-Indicator...
    Thanks in advance for any information and greetings from France...
    Guillaume Delorme
    Edited by: Guillaume Delorme on May 5, 2010 10:15 AM

  • How to run a BAPI in background mode?

    Dear friends,
    I have a requirement [In the UI user can choose two options - run online or run backgroud] to run a BAPI (BAPI_SALESORDER_CHANGE) in background mode (background job)  , does anybody know how to implement it?
    Thanks a lot!!

    Hi
    You can define 2 radio button one foreground and otherfor background then
    for background use FM BP_JOB_CREATE or BKK_UPT_DISP_JOBS_START  or DB2_SCHEDULE_JOB_IMMED
    Regards
    Shiva

  • Return Messages for a BAPI run in Background

    Hi all,
    I am running a BAPI( BAPI_SALESORDER_CHANGE ) in Background task, It works fine and updates the Sales order but i dont get any return messages.But based on the return messages i need to show up on the report which orders got updated and which are not.....
    Can anyone help me how can i get the return messages when i run a BAPI in background task......

    Thanks for the quick response....I think you got me wrong...I am not running the program as a background job....I am running only the bapi in background task as below.....
                CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
                   IN BACKGROUND TASK AS SEPARATE UNIT
                     EXPORTING
                          salesdocument    = v_vbeln
                          order_header_in  = it_bapisdh1
                          order_header_inx = it_bapisdh1x
                     TABLES
                          return           = it_return
                          partnerchanges   = it_bapiparnrc.
    When the bapi runs as a background task i dont get any return messages in it_return but the sales order gets updated....
    But i will have to capture the return messages as well....How can i achieve that ?

  • BAPI_DOCUMENT_CREATE2 fails in Background

    Hi everyone,
    I wrote an ABAP-report calling BAPI 'BAPI_DOCUMENT_CREATE2'.
    This ABAP has to create a document and upload files per FTP into DMS (Checkin)
    Works Online fine (cause the BAPI avoids FTP as a GUI is online available)  but miserably fails in background:
    Message: RFC callback calls are not allowed in the ABAP...
    This message comes from a failed call of the FM 'SYSTEM_START_REG_SERVER'
    in the FM  'CV120_FTP_START_REG_SERVER' as described in an old thread (Error in Check in of Originals by BAPI In background)
    Sample of the BAPI-call:
      CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
        EXPORTING
          documentdata         = documentdata
          pf_ftp_dest          = 'SAPFTPA'
        IMPORTING
          documenttype         = documenttype
          documentnumber       = documentnumber
          documentpart         = documentpart
          documentversion      = documentversion
          return               = return
        TABLES
          documentdescriptions = documentdescriptions
          objectlinks          = objectlinks
    *      documentstructure    = documentstructure.
    *      documentfiles        = documentfiles
    *      documentstructure    = documentstructure.
          documentfiles        = documentfiles.
    I tried a lot, even in 2 steps (first create the doc per BAPI, second checkin per call of CVAPI_DOC_CHECKIN)
    but in everycase, i always get the same problem...
    Any help will greatly be appreciated : i daily and manually (ok, even if 1 report launch per day is sufficent) have to upload aprox.
    2000 PDFs ...
    Thanks in advance for answering...
    Edited by: Guillaume Delorme on May 5, 2010 11:08 AM

    Hi everyone,
    Due to holidays, i gotta  post under another account...
    There was a logical mistake in my problem:
    -> i thought i had to do the physical checkin of the files while or after the BAPI_DOCUMENT_CREATE2-call.
    In my case, the content-server is reachable from the app-server as it's been defined in the AL11.
    The content-server is directly defined in table TDWD with complete directorypath as a vault-server (NO DVA-VAULT).
    The SAP-FBs do actually handle two cases for file-checkin that can suit my concern::
    -> DVA-Vault?->FTP-Connect for filetransfer
    -> No DVA-Vault? ->Local GUI-Upload  for filetransfer
    For background-processing fails always the GUI-Upload -> normal
    I don't use any DVA-Vault -> i must do something else.
    Solution: Ridiculously easy...
    *-> FIRST :Physical Checkin over a stupid TRANSFER DATASET for the file.
    *If OK:
    *->SECOND: Call of  BAPI_DOCUMENT_CREATE2 with reference to the transferred File
    *      ->Structure BAPI_DOC_DRAW2:
    *          -> Short Dataname in BAPI_DOC_DRAW2-docfile1
    *          -> Datacarrier in BAPI_DOC_DRAW2-datacarrier1 (actually the key for the VAULT-server)
    *          -> App.type in BAPI_DOC_DRAW2-wsapplication1.
    *          -> Description, Documentype, username, laboratory are must-fields with my customizing too.
    *       ->Internal Table BAPI_DOC_FILES2:
    *          -> Short Dataname in BAPI_DOC_FILES2-docfile
    *          -> Datacarrier in  BAPI_DOC_FILES2-storagecategory (actually the key for the VAULT-server)
    *          -> App.type in BAPI_DOC_FILES2-wsapplication.
    *          -> no other fields required for this table
    *       ->(...)
    *endif.
    Now it runs fine every 5 minutes and i handle about 3000 documents a day...
    I give points to Phillip van den Heever who reminded me the AL11-Setting and i mark this topic solved as soon as i can...
    Thanks to everyone and greets,
    Guillaume Delorme

  • 'BAPI_DOCUMENT_CREATE2' in background

    I am trying to call 'BAPI_DOCUMENT_CREATE2' in background mode. I need to check in documents from application server, but I am getting "File cannot be opened" error.
    I am populating the following fields
    bapi_doc_files2-FILE_ID
    bapi_doc_files2-wsapplication
    bapi_doc_files2-storagecategory
    bapi_doc_files2-checkedin
    bapi_doc_files2-active_version
    bapi_doc_files2-description
      CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
        EXPORTING
          documentdata               = pa_doc_data
          pf_ftp_dest = 'SAPFTPA'
          pf_http_dest = 'SAPHTTPA'
       IMPORTING
            documenttype         = l_documenttype
            documentnumber       = l_documentnumber
            documentpart         = l_documentpart
            documentversion      = l_documentversion
            return               = la_return
       TABLES
            characteristicvalues = pt_characteristicvalues
            documentfiles        = pt_documentfiles.
    What should I consider if I wanted to call this bapi in background?

    Hai..
    These are the some some links 
    Running a BAPI in background..
    BAPI in Background..Urgent Pls
    BAPI in background processing
    BAPI in Background mode
    hope this may help you.
    KHS

  • BAPI_DOCUMENT_CHECKOUTVIEW in background

    Hello,
    I want to copy an original file from a document info record to a server.
    I tried to use BAPI_DOCUMENT_CHECKOUTVIEW.
    (I also tried BAPI_DOCUMENT_CHECKOUTVIEW2 and CV120_DOC_CHECKOUT_VIEW.)
    I use the BAPI in a workflow. When i call the workflow in dialog, it works (the files is copied). But when i call the workflow in background, it doesn't work.
    Does anybody know why or does anybody have experience with this??
    Thanks in advance!
    Werner.

    Hai..
    These are the some some links 
    Running a BAPI in background..
    BAPI in Background..Urgent Pls
    BAPI in background processing
    BAPI in Background mode
    hope this may help you.
    KHS

  • Excel file upload in background

    Hi
    any one inform me how to Excel file will be Executed as a background job.
    The Excel file will be executed as a background job.
    This will eliminate issues related to network speed,
    time-outs,user logging off,ect;
    and the need for the user to remain logged in to the transaction till it finishes
    execution. After the background job completes the output report will be sent to the
    user via email as an attachment.
    Regards
    Gopal
    Duplicate thread.
    Edited by: kishan P on Aug 24, 2010 10:39 AM

    hi,
    function module for email attachment  -
    function module SO_DOCUMENT_SEND_API1
    function module for background schedule - u2018ALSM_EXCEL_TO_INTERNAL_TABLEu2019
    When scheduling a job in the background the appropriate statement to read in your file is OPEN DATASET, and the file must be on the file system that the SAP server can see.
    At anytime, a user can switch of the Personal Computers even though the job is still running in the background.  Therefore GUI_* and WS_* function modules are not designed to work in that way, as they need to access your personal computer  file.
    To choose the correct download method to used, you can check the value of SY-BATCH in your code,
    if it is 'X' use OPEN DATASET and if it is ' ' use WS_UPLOAD.
    link for help -
    Re: Excel file upload through BAPI in BACKGROUND
    Rgds
    Raj

  • How to prevent plant locking issue while calling a BAPI? Please help!

    Hi Experts,
       I have following scenario:
       BizTalk sends 4B2 PIP to XI via JMS adapter. XI then sends the same to ECC system via ABAP Proxy.
       4B2 PIP in our case contains one PO header and one line item.
       In ECC, ABAP proxy calls BAPI to process the GR (Goods Receipt).
       The problem is BizTalk can send many 4B2 PIPs simultaneously (Parallel). When The first PIP is getting processed in ECC the BAPI locks some plant data till it completes the GR. But if second PIP request comes when the first once is still getting processed then we get "plant is locked" error.
       How can we avoid this plant locking error? What is the best option to solve this?
      While calling BAPI in my ECC ABAP Proxy if I use qRFC as given by the code below then will it solve the problem?
      Will this use only one queue "QUEUE01" for all the 4B2 PIP requests?
      Will it create a new queue for every request?
      If we assume that there are 3 PIP requests already in a queue. If the GR processing for the first PIP returns some data error (not the locking error) in the BAPIRETURN then will the second PIP gets processed or will it wait till the first one is successfully processed?
       CALL FUNCTION 'TRFC_SET_QUEUE_NAME'
          IMPORTING
             QNAME = 'QUEUE01'.
      CALL FUNCTION '<CREATE GR BAPI>'
      IN BACKGROUND TASK
      EXPORTING
         TABLES ....
      COMMIT WORK.
    Thanks & Regards
    Gopal

    Man, you guys/gals are great! You notice everything...I sure appreciate all the help so far. I've updated a few things, but I still can't get x1 in the method to pass the right input to line 39. For instance, if I set a=2, b=4, and c=-30, then x1 should = 3 and x2 should =-5, but both keep showing -5. They are always equal for some reason, even when they are not supposed to be.
    I see what you were saying with d always equalling zero. I was looking in the main where it doesn't always = zero, but in the method it was always set to zero. Thanks...good eye!
    num1 = quad(a, b, c, 1);                              //line 39
    num2 = quad(a, b, c, 2);                              //line 40
    JOptionPane.showMessageDialog(null, "There are two real roots. They are root 1 = "+ num1 + " , and root 2 = " + num2 + ".");I also added this to the method so d won't always = zero
    d = (Math.pow(b,2) - (4 * a * c));I also have all of the variables declared at the top, but I forgot to copy and paste all of them and I updated the System.exit(0) to close the JOptionPane along with extra } 's to close the program correctly.
    Again, thanks a bunch.

  • BAPI bapi_doc_draw2

    Hi Gurus,
    I am using bapi "bapi_doc_draw2" to pass data for a new document. and using bapi "BAPI_DOCUMENT_CREATE2" to create a new document.
    But i am getting an error - "Class type T01 : class T_CLASS_MAINT_WI not found"
    Please help me with this error
    Thanks,
    Aditya

    Hi Shruti,
    please note that DMS BAPIs require always a SAPGUI channel or open RFC    
    connection to start the SAPHTTP/SAPFTP program that is used to up- or     
    download files to the client. If the BAPI ist executed in background      
    mode, the system doesn't know from where to get the original file.                                                                               
    Please do not use BAPIs in background mode, use APIs instead. They are    
    more flexible regarding RFC calls (background processing). I hope the
    SAP note 504692, which contains sample programs for special          
    checkin/checkout cases could be useful for you. Please read this note and use the sample          
    programs as a basis for your own coding. Further please see also note     
    796709 which also might contain useful information for such cases.        
    Best regards,
    Christoph

  • Run bapi_bus2054_create_multi in background

    Hi,
    I'm able to run this BAPI bapi_bus2054_create_multi in foreground but unable to run in background while creating a session.
    Can anyone let me know how I can run this bapi in background.
    Regards,
    Yahya

    hello you
    you could create your own program (zprogram) calling the following sequence
    Call BAPI_PS_INITIALIZATION
    Call BAPI_BUS2054_CREATE_MULTI
    Call BAPI_PS_PRECOMMIT
    Call BAPI_TRANSACTION_COMMIT
    and the run the Zprogram in the background ?
    Ger

  • Bapi......... removed_by_moderator

    HI,
    Is it possible to scedule BAPI in background job scedule if possible how?
    and what is CPIC it is the term related to user ID's.
    Thanks in advance,
    Das................
    Edited by: Julius Bussche on Jul 15, 2008 6:44 AM

    Das,
    Urgent?
    pls do not use this kind of word in subject line before post yout thread just read rule of posting.we have our work also at our desk.it is not must to reply to you questions.
    any ways yes you can run bapi in BG.just use your bapi in z program and than press F9 instead of F8.
    foir your second qns just refer:
    CPIC users
    Amit.

  • Print in background

    Hi all,
    Iam using the Goods movement bapi 'BAPI_GOODSMVT_CREATE' which runs in the background. Iam not able to get the printout for the goods movement in background. But when i run the foreground iam getting printout for each and every movement created.
    How to trigger printing of material documents using BAPI _ GOODSMVT _ CREATE bapi in background
    Please send your suggestions,
    Rajesh.
    Message was edited by:
            Rajesh Kumar

    how u  are getting the print out ? its Immediate Printouts ?
    Regards
    Prabhu

Maybe you are looking for

  • My brand new iPod Touch 4th Generation, just isn't functioning correctly.

    Recently, I bought a brand new iPod 4th gen. Since, it has gone haywire and refuses to function correctly. It is 16 gb and operating on iOS 6.0.1. On many apps, especially games, it can get really laggy at times, for no discernable reason. I have ver

  • Problems with string comparing

    I have a function, getPlayerName() that returns the contents of a text field, but i want the dialog box to check and see if there was anything typed in there, so i have done things like if(this.getPlayerName() != null), if(this.getPlayerName() != "")

  • Problem in Selecting the data from EKPO and KONV tables

    Hi Experts, Presently I am working on Report with Comparision-Sheet Between the vendor's Quotations. I have to display the Discount, Freight, Packing and Forwarding, Vat in Item level data based on the conditions made in PO. As per my Knowledge, Cond

  • New Motion Supplemental Content

    check Software Update - 1.13GB of Motion templates and Motion library content.

  • Variant creation - RBDOCTBL

    Dear experts, I need to create a background job that will run on daily basis, and will delete some data older than XX days. I will be deleting monitoring data from BDOC_TRACK table, using RBDOCTBL program. I need your help to suggest ... how can I cr