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.

Similar Messages

  • Submit Report (Regarding Background Processing)

    Hi Guru's,
    I want help regarding Background Processing.
    I have developed a program which is running fine in forground but in Background mode no values are comming.
    All values are becomig Zero.
    Plz help.
    *--- Submit Report for 'COGI' (Postprocessing of Error Records from Automatic Goods Movements)
      SUBMIT coruaffw USING SELECTION-SCREEN '1000'
                      WITH  r_cumul = 'X'
                      EXPORTING LIST TO MEMORY
                    AND RETURN.
    *---- Get the List
      CALL FUNCTION 'LIST_FROM_MEMORY'
        TABLES
          listobject = it_list_tab
        EXCEPTIONS
          not_found  = 1
          OTHERS     = 2.
      IF sy-subrc = 0.
    *--- Convert to Ascii
        CALL FUNCTION 'LIST_TO_ASCI'
          TABLES
            listobject         = it_list_tab
            listasci           = it_asci_tab
          EXCEPTIONS
            empty_list         = 1
            list_index_invalid = 2
            OTHERS             = 3.
        IF sy-subrc <> 0.
    *      MESSAGE i000 WITH 'Problem in converting LIST to ASCII'.
        ENDIF.
        DESCRIBE TABLE it_asci_tab LINES w_cogi.
        w_cogi = w_cogi - 5.
      CALL FUNCTION 'LIST_FREE_MEMORY'
        TABLES
          listobject = it_list_tab.

    Hi Arbind,
                  You have used return you need to add the addition with.Try this way hope it works
    SUBMIT zreport EXPORTING LIST TO MEMORY
                    AND RETURN
                    WITH P_1 = P_1
                    WITH P_2 = P_2
                    WITH P_3 = P_3
                    WITH S_4  IN S_4
                    WITH S_5 IN S_5
                    WITH S_6 IN S_6.

  • Problem in Submit Program in background

    Hi Expert,
    I have one progam which fetch the sales order data as per input selection and pass it to COOISPI  T.Code.
    Through the program
          SUBMIT PPIO_ENTRY
                  USING SELECTION-SCREEN '1000'
                      WITH P_TCODE = 'COOISPI'
                      WITH P_AUTYP = '40'
                      USING SELECTION-SET 'SAP&COOISPI'
                      WITH SELECTION-TABLE rspar_tab
                     AND RETURN.
    But when i schedule the job of program then it is not running.
    Submit statement is running in background mode or not.
    Is there any other way to doing this work.

    HI ,
      yes it works
    You check the statement SY-BATCH  ..
    Or u can call the transaction and pass the values...
    Please see the sample code :

  • IMPORT/EXPORT statement in Background Mode

    Hey dudes,
    I am facing a problem in my coding. I am dealing with coding in several events in IS-U, transaction FPY1.
    However, it's not so important ya. Now I am written some code on IMPORT and EXPORT some parameters between 2 program code. It's work very fine only in 'DEBUG MODE', but when it's running not debug mode (Is BACKGROUND MODE), coz it's massive run program.
    I suspect it's because of the background job. Does background job using ABAP Memory? IMPORT/EXPORT is only for dialog work process, not background work process?? I have a lot of question mark on my head now..
    Hope anyone facing dis issue before can help.
    Cheers,
    Isaac.

    Are you trying to pass data via EXPORT/IMPORT between two programs that are both running in background, or from an online session to a background process?... i.e. what are the two lots of program code that you are wanting to pass parameters between? 
    It would be fine for a background program to "export" data to a memory ID, then for the same batch program to submit another program that does the "import" from the same memory ID... but this method won't work for an online user doing an "export" and a batch job doing an "import" -> for this to work, you would need to persist the parameters so that the batch job can retrieve them.
    If you can explain the scenario a bit more, will try to offer more help...
    Jonathan

  • Using a report layout in background mode

    Is is possible to apply a saved report layout like you apply to the alv grid to a csv file run in background mode?

    Hi Cynthia ,
    I can figure out one way :
    SUBMIT ZREPORT TO SAP-SPOOL LAYOUT 'ZLAYOUT'
    VIA SELECTION-SCREEN
    DESTINATION 'locl'
    KEEP IN SPOOL 'X'
    IMMEDIATELY 'X'
    WITHOUT SPOOL DYNPRO
    AND RETURN.
    This will return the report in your layout to the spool and can be downloaded as well.
    Thanks
    Naresh

  • BTLE in Background Mode

    Hello,
    I’m developing a BTLE application with CoreBluetooth. If the iPhone is connected with the Bluetooth client, everything is fine, even if the application is running in the background the connection is kept alive. Is it possible to scan and connect to a Bluetooth client when the application is in the background? If the application does into background, the iPhone stops scanning, even if “bluetooth-central” is activated.
    Kind regards,
    _Stani

    Hi Patel,
    I will suggest you to use the BDC session method instead of using the Call Transaction. After creation of session in SM35 you can submit the session in background mode easily . We cannot submit the call transaction in background. You won't get any messages if you submit in background in session method.
    Three steps to follow if you want to create the session.
    1) BDC_OPEN
    2) BDC_INSERT
    3)BDC_CLOSE
    Thanks,
    Satheesh

  • 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

  • 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

  • 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

  • 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.

  • 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

  • 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.

  • 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