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

Similar Messages

  • 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

  • Calling a function from a DLL, exectution in background mode.

    Dear Experts,
    We have created an ABAP report the calls a function from a DLL file. If the report is executed in on-line mode the program calls and executes the function from the DLL, but if the ABAP programa is executed in background mode it doesnt calls the DLL function.
    Do you know a way to solve the problem when executing in background mode?
    Best regards.
    Antonio

    Hi Gabriel,
    Let me explain in details about my DLL function.
    We are importing the business partners from legacy system into the SAP CRM system, so at the moment we created the BP master data via BAPI, I get the name of the BP and this moment I call the function in the DLL file. I export the parameter name and I receive back a simplified string with the name reduced to a code. This code I get back from the dll it is insert in a Z table, so there is no interaction in the screen, all must be executed in background mode, because there are a lot of business partners to be converted in SAP system.
    I am sending my code for your considerations.
    Instancia a DLL
      CREATE OBJECT dll 'MTCODE.CPFONET'.
      IF sy-subrc NE 0.
        RAISE without_dll.
      ENDIF.
    Move para a tabela interna IT_NAME os valores recebidos na TI_NAME
      it_name[] = ti_name[].
    Para cada registro importado
      LOOP AT it_name.
        CLEAR v_string_ret.
        wa_matchcode-zregid     = it_name-zregid.
        wa_matchcode-name1_text = it_name-name1_text.
        v_string = it_name-name1_text.
        CONDENSE  v_string.
        TRANSLATE v_string TO UPPER CASE.
        CALL METHOD  OF dll 'SetNome' EXPORTING #1 = v_string.
        CALL METHOD  OF dll 'ExecMatch'.
        CALL METHOD  OF DLL 'GetMCData' = v_string_ret.
        FREE OBJECT dll.
      Preenche os campos do match-code de acordo com o retorno da DLL
        SPLIT v_string_ret
        AT '|'
        INTO wa_matchcode-zparmcln
             wa_matchcode-zparmcfn
             v_empty
             wa_matchcode-name_first
             wa_matchcode-name_last
             wa_matchcode-namemiddle.
      Adiciona o registro com o match-code correspondente na TE_MATCHCODE
        APPEND wa_matchcode TO te_matchcode.
      ENDLOOP.

  • Create Quality Management view for a Material in background mode

    I want to know if there is a way to create a Quality Management View (Quality Management tab) on Material Master (material already extended to plant ) in background mode.
    The requirement is to add inspection setup data for a material extended to a particular plant in background. I tried using 'BAPI_MATINSPCTRL_SAVEREPLICA' to add the data and it works perfect as required. Now the problem is this BAPI is creating the inspection setup data only for the material which has QM tab in MM02 for e.g. I manually created the inspection setup for a Material from MM01 and then deleted it , now the BAPI works fine for this material because when I created an inspection setup from MM01 it created the QM tab and after i deleted the entry the tab was still there with no entry in inspection setup.
    I want to create inspection setup for a material which does not have QM tab.
    I have to create everything is background mode. BDC is one option which I am list interested in.
    Thank you for helping in advance.

    Thank you for looking into my issue. I have to do the inspection setup in background without using any front end transaction.

  • Call transaction KB21N processed by a program in background mode

    Hi to all,
    I call transaction KB21N using BDCDATA in a custom program. If I process this program in foreground mode all it's OK, but if I process the program in background mode, I have a runtime error with DUMP: RAISE EXCEPTION with exception condition CNTL_ERROR. This program has to be executed in background so a bapi exist to use instead of call transaction or something else?
    Thank you very much,
    regards
    Antonio

    HI Antonio,
    The transaction you are dealing with is an SAP Enjoy transaction and for such transactions it is not recommended to do a BDC. YOu should search for  a BAPI for the same as you have already identified. Basically the enjoy transactions uses GUI controls which cannot be handled by BDC.
    BAPI_ACC_ACTIVITY_ALLOC_POST may serve your purpose.
    Regards,
    ravi
    Message was edited by:
            Ravi Kanth Talagana

  • 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

  • FM not executing in background mode sometimes

    Hi,
    I'm using one Z function module for Production order confirmations which inturn calls 'BAPI_PRODORD_COMPLETE_TECH'.
    There is 'BAPI_TRANSACTION_COMMIT' and 'BAPI_TRANSACTION_ROLLBACK' also present.
    My issue is, this functionality works perfectly fine when I execute the program in foreground mode, but does not go through sometimes when I schedule it in background.
    Note : Its not completely skiping the entries in background mode. It works sometimes and sometimes doesn't.
    Can anyone comment if they have faced similar issues ?
    Regards,
    Shiva

    Hi !
    In my opinion it fails, when there is a popup coming from the BAPI.
    We have the issue that when we process in background the orders where a popup should be shown (e.g. the popup asking if setting TECO is OK although reprocessing records exist).
    When we reprocess our IDOC (which are calling that BAPI) in BD87, the popup is even shown in BD87 !
    Any idea how to tell the BAPI to ignore such messages and still set the TECO ?
    Any other way to set the TECO ?
    thx a lot !

  • CJIC/CJ88 : How to simulate this flow in background mode without CT

    Hi everybody,
    I would like to know if it exists some FM, BAPI or Idoc to implement CJIC and CJ88 tcode.
    My requirement is the following :
    "From the input CSV file, the transaction CJIC must be executed to settle rule and after the transaction CJ88 must be executed by external document number to generate a posting document to capitalize asset project."
    So I try to find any solution for the background mode.
    Thank in advance
    Edited by: LudovicBento on Dec 17, 2010 4:09 PM

    check the value of sy-BINPT

  • XLS from Application server in background mode to internal table

    Hi,
    I need to transfer the content of an excel file in the application server to an internal table while running my program in background. My file is xls, cant use csv. For dataset bin mode, I need to know how to transfer the data to my internal table, already searched on forum but didnt find answer, at least not for background..
    ow, I am using v6 here
    about the ALSM_EXCEL_TO_INTERNAL_TABLE, I get the upload_ole error all the time, and with TEXT_CONVERT_XLS_TO_SAP, conversion_failed all the time too...
    here is the code, just the load part and data declaration:
    REPORT zbeto.
    TYPE-POOLS: truxs.
    TYPES:
    BEGIN OF y_cot,
    text1(12) TYPE c,
    text2(12) TYPE c,
    text3(12) TYPE c,
    text4(12) TYPE c,
    text5(12) TYPE c,
    END OF y_cot.
    DATA: it_datatab TYPE STANDARD TABLE OF y_cot,
    wa_datatab TYPE y_cot,
    it_raw TYPE truxs_t_text_data.
    DATA:
    v_file TYPE rlgrap-filename,
    begin_col TYPE i VALUE '1',
    begin_row TYPE i VALUE '2',
    end_col TYPE i VALUE '5',
    end_row TYPE i VALUE '102',
    t_ctmp TYPE y_cot OCCURS 0 WITH HEADER LINE,
    t_xls TYPE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    START-OF-SELECTION.
    PERFORM f_load_xls.
    FORM : f_load_xls
    FORM f_load_xls.
    v_file = '
    ZSAPDEV\SAPDEVINTERF$\COTACAO\TESTE.XLS'.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    filename = v_file
    i_begin_col = begin_col
    i_begin_row = begin_row
    i_end_col = end_col
    i_end_row = end_row
    TABLES
    intern = t_xls
    EXCEPTIONS
    inconsistent_parameters = 1
    upload_ole = 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.
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
    I_FIELD_SEPERATOR =
    i_line_header = 'X'
    i_tab_raw_data = it_raw " WORK TABLE
    i_filename = v_file
    TABLES
    i_tab_converted_data = it_datatab[] "ACTUAL DATA
    EXCEPTIONS
    conversion_failed = 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.
    t_ctmp[] = it_datatab[].
    ENDFORM. "f_load_xls
    both FM arent working, and when I try to execute in background mode, before anything, I recieve the following error:
    Message text:
    Error during import of clipboard contents
    Message class:
    ALSMEX
    Message no.:
    037
    Message type:
    A
    and without the ASLM FM, the TEXT_CONVERT give me the conversion_failed exception...
    the directories are right, that I am sure, because I just copy&paste it from CG3Z/CG3Y when I uploaded and downloaded to
    check the file in the server...
    am I missing something?
    thanks again,
    Roberto Macedo
    (PS: I made another topic because none replied the other in 4 days and wasnt solved yet)

    Hi!
    You didn't find answer for this, because it is not possible. If you run your program in background, it is running on the server, and does not have any connection to your local machine. That's why you can't upload/download in background mode.
    You might try to address somehow your local PC, with its IP or MAC address, but I don't think does this task worth so much time.
    Run your program in online mode, or if you want to run it in background, then upload your file into the SAP server.
    Regards
    Tamá

  • BDC Program is not working in background mode

    Hi All,
             I hv one bdc program for tcode fb02 which is working fine in foreground mode and data is updated to each screen properly. While running the same program in Background mode data is not updated. Can u seggust the solution.
    Regards,
    Rahul S

    Hi ,
    Remove the break point in the BDC performs.
    put the break point once u complete the BDC.... otherwise execute the BDC in MODE 'E'.. error mode.
    regards,
    Rama Reddy
    Edited by: ram reddy on Nov 16, 2009 5:37 AM

  • BDC is not working in background mode and working fine in Foreground mode

    Hi Experts,
    I have created a BDC in SHDB for the transaction code:CWBQM for creating and deleting the record and converted the BDC recording into the program using call transaction. It is working fine in both foreground and background. When I given the same program for users testing one for the user was able to delete the records but Creation is not working in the same BDC. He is able to create the same records in another PC and the problem is only in that PC and only during the creation of the record. When I change the mode to 'A' mode for testing and request the user to execute and it is working fine the records created successfully. What could be the issue ?
    Thanks,
    Hema

    Hello,
    While recording BDC in SHDB try setting "Simulate background mode" flag and give a try.
    Cheers,
    Nag

  • Submit + LIST_FROM_MEMORY in background mode

    Hi,
    I need to capture the output results from standard program RFKORK00 and hence I designed a wrapper program that calls the standard program.
    RFKORK00 generates a report output and I am able to capture the results correctly using the FM LIST_FROM_MEMORY and FM LIST_FROM_ASCI in foreground mode. But when I try to run the same job in background, the FM LIST_FROM_MEMORY does not return any results (I have checked the log by inserting information messages at various points in the program).
    I have searched for similar contexts here on SDN and everyone is in agreement that LIST_FROM_MEMORY would work well even in the background mode too but I am unable to find the fault in this case. Could you please help, attached is the code -
    SUBMIT RFKORK00
          USING SELECTION-SET c_variant
          EXPORTING LIST TO MEMORY
          AND RETURN.
        CALL FUNCTION 'LIST_FROM_MEMORY'
          TABLES
            listobject = lt_abaplist
          EXCEPTIONS
            not_found  = 1
            OTHERS     = 2.
        IF sy-subrc = 0.
          CALL FUNCTION 'LIST_TO_ASCI'
            EXPORTING
              list_index         = '-1'
              with_line_break    = ' '
            TABLES
              listasci           = lt_vlist[]
              listobject         = lt_abaplist[]
            EXCEPTIONS
              empty_list         = 1
              list_index_invalid = 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.
          MESSAGE i099(z1) WITH 'LIST TO ASCI CALL'.
       ENDIF.

    Well, RFKORK00 is indeed a print program that triggers spool in the background.
    I gave up playing around memory id, instead I am using the following code to check whether a spool was created in table TSP03.
    CLEAR r_rqcretime[].
        r_rqcretime-sign    = 'I'.
        r_rqcretime-option  = 'BT'.
        CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
          EXPORTING
            i_datlo     = sy-datlo
            i_timlo     = sy-uzeit
            i_tzone     = 'EST'
          IMPORTING
            e_timestamp = v_tzntstmps.
        r_rqcretime-low = v_tzntstmps.
    **Submit job with changed variant
        SUBMIT (p_prog)
          USING SELECTION-SET c_variant
          EXPORTING LIST TO MEMORY
          AND RETURN.
        WAIT UP TO 5 SECONDS.
    **Fetch the spool number generated by the program
        CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
          EXPORTING
            i_datlo     = sy-datlo
            i_timlo     = sy-uzeit
            i_tzone     = 'EST'
          IMPORTING
            e_timestamp = v_tzntstmps.
        r_rqcretime-high = v_tzntstmps.
        CONDENSE: r_rqcretime-low,r_rqcretime-high.
        CONCATENATE r_rqcretime-low   '00' INTO r_rqcretime-low.
        CONCATENATE r_rqcretime-high  '00' INTO r_rqcretime-high.
        APPEND r_rqcretime.
        SELECT SINGLE rqident FROM tsp01
                      INTO v_rqident
                     WHERE rqowner = sy-uname
                       AND rqcretime IN r_rqcretime.

  • Can we schedule BDC in Background Mode - SM37

    Hi Guru,
    Can we schedule our BDC in background - SM37 . Upload file will be on Local Sustem - C drive.
    Regards
    Durgesh
    Moderator message: background/GUI problems = FAQ, please search before posting.
    locked by: Thomas Zloch on Oct 6, 2010 2:14 PM

    GUI functions (like GUI_UPLOAD) will not work in background, they need an actual Gui active.
    There are plenty of threads on  this subject, search also in the wiki for threads/guide like [Working with files |http://wiki.sdn.sap.com/wiki/display/ABAP/Workingwithfiles] or [Communication to Presentation Server in Background Mode|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2&overridelayout=true] or [Working with FTP Server |http://wiki.sdn.sap.com/wiki/display/ABAP/WorkingwithFTP+Server]
    (To execute a BDC in background use report RSBDCSUB.)
    Regards,
    Raymond

  • Running a Dynpro-based Report as a Job/in Background mode

    Hello,
    i've got a report which hasn't got a selection-screen as its startscreen, but a complex dynpro and is based on different start-buttons and not only the "basic" F8/Run-Button. the users still would like to be able to run the report in background mode and as an automated weekly job. moreover they want to use their own configuration/variant for date-fields etc., just like they are used from a selection-screen. is this possible "out of the box" with a dynpro-based report or how can i archive this through my own programming logic?
    thanks for your help,
    dsp

    Hi,
    I guess yes, but since you seem to have several processes possible at startup (those buttons), you will have to code a new bit of code at the start of your application. This to choose the correct process... you should have a new statement like
    IF sy-batch IS NOT INITIAL.
         "Perform batch process
    ELSE.
         "Perform normal run
    ENDIF.
    For the variant, I'm not sure to really get the idea... Do the users already use variants with the actual version? or is there no selection screen at all? If not, you should use one and set-up parameters to pre-fill your dynpro fields...
    Kr,
    Manu

  • Error in batch session processing in background mode

    Hi ,
    I am trying to do data transfer using batch session for transaction FD32.
    Here the batch session is executing when I am processing the session in foreground.
    Whereas in background mode it is failing.
    Please check and assit.
    Regards
    Kishore

    Hi Kishore,
    Probably it will be some information or warning message which is coming in the background execution of the session.
    That is the reason your session is going into error. Run the errored out session once again in foreground mode. You will get to know the reason of failure.
    Please let us know of any doubts.
    Cheers
    VJ

Maybe you are looking for

  • Error in creation of custom function module.

    hi,           i am trying to create custom rfc enabled function module by copying the standard function module prgn_profile_name_get. in the export parameter PROFILE_FROM_TPRPROF what is the type i have to associate for this parameter. when i try to

  • How do you compile multiple class files in a unix cmd prompt?

    I have been using Java for a few years now, but for some reason I have a course that requires us to compile/run and hand-in our java assignments using Unix... I know how to compile a simple program on unix with a single source file, but how the heck

  • DAQ collecting finite samples despite being set to continuous acquisition mode

    Hello, I've created a vi which reads data from one channel on my USB 6225 OEM device, displays the data to a chart, and writes the data to a .csv file using the write to spreadsheet file vi. The DAQ acquisition mode is set to Continuous Samples; howe

  • Order with reference to schedule agreeemtn

    Hi, can somebody tell me how do i need to copy control from schedule agreement to order, i am using lz i want to keep option of taking reference from schedule agreement and also directly delivering from the order can somebody suggest me the copy cont

  • Error Transaction 'Function code' doesn't exist.

    hi ppl, i have a screen in which i am calling a subscreen.In the Subscreen there is button and i have given its function code as 'SSR'. Now when i execute the transaction the subscreen with all the data is appearing on the screen.When i press the but