Executing a program in background is not creating spool

Hi all,
I am facing a small problem with one of the program. Below are the details.
Its a simple program of uploading file from local machine and displaying the output. when I am running in foreground, the contents of file are copied into internal table and getting displayed in List.
Where as when I run background, No spool is getting created. Also I found that, the internal table is getting cleared. I  have put an IF NOT INITIAL check and found that, Internal table is getting cleared and error message is written in the spool .
There is no problem with file upload in background or foreground.
Please advise.

Hi
What you means with "uploading file from local machine":
- Presentation Server or Application Server?
If u're using the fm as GUI_UPLOAD or WS_UPLOAD in order to upload the data from a file of Presentation Server u should consider those fms work foreground only.
So how do u upload the file?
Max

Similar Messages

  • Executing the program in Background

    Hi experts i'm trying to Execute the Program in background.
    Given the Input and output file locations and Press F9 for process the program in background from SE38. cause i want to run my program as a batch(Background)
    but its not accepting. can you please help me how to resolve this issue.
    i'm providing the code can you please verify that.
    Many Thanks
    SELECTION-SCREEN                                                     *
    selection-screen begin of block b1 with frame title text-001.
    *.. Filename
    PARAMETERS: f_name TYPE char100,     "Upload filename
                d_name TYPE char100.     " Download filename
    selection-screen end of block b1 .
    SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: p_serv radiobutton group RAD1,
                p_frnt radiobutton group RAD1 default 'X'.
    SELECTION-SCREEN: END OF BLOCK b2.
    AT SELECTION-SCREEN ON VALUE-REQUEST  FOR f_name.
    *.. Data Declaration
      DATA: lt_file TYPE filetable,
            lv_file TYPE LINE OF filetable,
            rc_i TYPE i,
            cl_gui TYPE REF TO cl_gui_frontend_services,
            w_path  LIKE dxfields-longpath.
    *.. Check if from server or frontend
      IF p_frnt = 'X'.
    *.. Create objects for method
      CREATE OBJECT cl_gui.
    *.. Clear the filename
      CLEAR f_name.
    *.. Call method to search for file
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title = 'Choose Input File'
        CHANGING
          file_table   = lt_file
          rc           = rc_i
        EXCEPTIONS
          OTHERS       = 4.
    *.. Check if file found
      IF sy-subrc EQ 0.
    *.. Check that file path not empty
        CHECK NOT lt_file[] IS INITIAL.
        LOOP AT lt_file INTO lv_file.
    *..   Set parameter to filename
          f_name = lv_file-filename.
        ENDLOOP.
      ENDIF.
    *.. Free object
      FREE cl_gui.
    *.. Upload from Server
      ELSE.
    Retrieve filename
        CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
          EXPORTING
            i_location_flag       = 'A'
            i_server              = ' '
            i_path                = '/sap_ftp/'
            filemask              = '**'
            fileoperation         = 'R'
          IMPORTING
      O_LOCATION_FLAG       =
      O_SERVER              =
            o_path                = w_path
      ABEND_FLAG            =
          EXCEPTIONS
           rfc_error             = 1
           error_with_gui        = 2
           OTHERS                = 3.
    Set file path
        f_name = w_path.
      ENDIF.
    *.. File selection for output file
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR d_name.
    *.. Only allow search for front-end
      IF p_frnt = 'X'.
    *.. Data Declaration
        DATA: lt_file TYPE filetable,
              lv_file TYPE LINE OF filetable,
              rc_i TYPE i,
              cl_gui TYPE REF TO cl_gui_frontend_services.
    *.. Create objects for method
        CREATE OBJECT cl_gui.
    *.. Clear the filename
        CLEAR d_name.
    *.. Call method to search for file
        CALL METHOD cl_gui_frontend_services=>file_open_dialog
          EXPORTING
            window_title = 'Choose Input File'
          CHANGING
            file_table   = lt_file
            rc           = rc_i
          EXCEPTIONS
            OTHERS       = 4.
    *.. Check if file found
        IF sy-subrc EQ 0.
    *.. Check that file path not empty
          CHECK NOT lt_file[] IS INITIAL.
          LOOP AT lt_file INTO lv_file.
    *..   Set parameter to filename
            d_name = lv_file-filename.
          ENDLOOP.
        ENDIF.
    *.. Free object
        FREE cl_gui.
      ENDIF.
    *.. General Checks for Selection screen
    AT SELECTION-SCREEN.
    *.. Check if program run in batch mode and ping directory
      IF sy-batch = 'X'.
    *.. Move filename to file_name
        file_name = d_name.
    *.. Check if path can be reached
        OPEN DATASET file_name FOR INPUT IN TEXT MODE.
        IF sy-subrc NE 0.
          MESSAGE e082(zsomerfield).
        ENDIF.
      ENDIF.
    NITIALIZATION.
    *.. ALV Variables
      variant_save = 'A'.
      w_repid   = sy-repid.
      w_variant_handle = c_handl.
    START-OF-SELECTION                                                   *
    START-OF-SELECTION.
    *.. Check if batch program running in batch mode or not
      IF sy-batch = 'X'.
    *.. Open file on application server for reading
      OPEN DATASET file_name FOR INPUT IN TEXT MODE.
      DO.
    *.. Upload entries
        READ DATASET file_name INTO zpernr.
    *.. IF end of file reached then exit DO statement
        IF sy-subrc = '4'.
          EXIT.
        ELSE.
    *.. IF entry found then add to employee table
          in_file-empnum = zpernr.
    *..     Add entries to table
          APPEND: in_file.
    *..     Clear header lines
          CLEAR: in_file, zpernr.
        ENDIF.
      ENDDO.
    *.. Close dataset
      CLOSE DATASET file_name.
    *.. Get file from frontend and run in foreground
      ELSE.
    *.. Upload from local machine.
    DATA: file_name TYPE string.  "LIKE rlgrap-filename,
    *.. Set filename to filename from screen
      file_name = f_name.
    *.. Upload the information from the file into the table in_file
      CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                filename                = file_name
           TABLES
                data_tab                = in_file
           EXCEPTIONS
                file_open_error         = 1
                file_read_error         = 2
                no_batch                = 3
                gui_refuse_filetransfer = 4
                invalid_type            = 5
                no_authority            = 6
                unknown_error           = 7
                bad_data_format         = 8
                header_not_allowed      = 9
                separator_not_allowed   = 10
                header_too_long         = 11
                unknown_dp_error        = 12
                access_denied           = 13
                dp_out_of_memory        = 14
                disk_full               = 15
                dp_timeout              = 16
                OTHERS                  = 17.
    *..   Make sure file uploaded correctly
      IF sy-subrc <> 0.
       MESSAGE E018(ZHR_MESSAGES).
      ELSE.
      MESSAGE i017(ZHR_MESSAGES).
      ENDIF.
      ENDIF.

    Hi Vamsi,
    <b>First Check in the Foreground your program is working for the application server file or not</b>
    When you will Execute your program in Background internal table "ZPERNR" will be populated from the file that is there on the application server.
    After that what you want to do with the internal table.I think you have not sent the whole code.
    In background FM GUI_UPLOAD willl not work.
    If you want to debug your code put wait for 100 seconds at the place where you want to dubug your code.Go to transaction code SM50 your job will be running there.
    Select Your job
    Go to  Menu Bar Program/Mode - > program - > Debugging.
    In this way you can debug your code.
    First Check in the Foreground your program is working for the application server file or not

  • BDC is not working in when executing the program in background

    Hi gurus,
    I have a problem that in BDC is not working when i'm executing the upload program in background thru scheduling(SM36) , while it works fine when i execute directly with NO screen display mode

    Many transactions behave differently when executed in foreground and background. The fields on the screen may be different.
    In transaction SHBD when starting a recording there is a checkbox where you can select 'Simulate Background Mode'. If you do your recording using this option you will get the code suitable for background mode. If you do not select this option you will get a code for foreground mode.
    By compairing the two codes you will know the changes required for background mode.
    Hope this helps you

  • Report in background not create spool when no data found

    Hello  ,
    I created simple rapport that should run in background. When I  execute background job (sm37) I noticed that the  spool exists only
    for when the some data is found. When data is not found for any reason I do not have spool , and I need one saying
    'records passed 0'. I am not sure what I can do about it. I saw insome programs that is possible but I cannot find how it was done.  Please advice .
    Krsto

    Hi,
    You might be checking if the Final Internal table has data in it or not (May be in END-OF-SELECTION). If you are not do have check on this and simple code a write statement like below.
    IF IT_FINAL IS NOT INITIAL.
    CREATING A SPOOL.
    ELSE.
    WRITE : / 'Records Passed are 0'.
    ENDIF.
    Let me know if you need any further help on this.
    Regards,
    SRinivas

  • Error in executing ABAP program. Error occurred when creating dataset

    hi,
    when I use LKM SAP ERP to Oracle (SQLLDR) to extract data from SAP ERP server. I execute my interface, and it's stop at extract data step.
    This is message:
    java.lang.RuntimeException: Error occured in open tool execute method...Error in executing ABAP program...Error in executing ABAP program...Error occurred when creating dataset/abc/ZODI_13001_6001_GLOBAL.txt
    I tried others path name, tried slash or backslash. This is content in code tab
    OdiSAPAbapExecute "-UPLOAD=1" "-EXECUTE=1" "-EXECUTEBASE_RKM=0" "-ZRFC_RUN_INSTALL=1" "-ABAP_PROGRAM_NAME=ZODI_13001_6001" "-HOST=10.86.87.24" "-USER=sv_hoa" "-PASSWORD=<@=snpRef.getInfo("SRC_PASS") @>" "-SAP_CLIENT=800" "-SAP_LANGUAGE=EN" "-SAP_SYSTEM_NUMBER=02" "-SAP_FUNCTION_GROUP_NAME=ZODI_FGR_13001" "-CONNECTION_POOL_NAME=SAP_ODI_ERP_POOL_10.86.87.24" "-CONNECTION_POOL_SIZE=10" "-FILE_DELIMITER=<@=""+(char)8@>" "-FILE_NAME=ZODI_13001_6001_GLOBAL.txt" "-FTP_HOST=10.86.82.108" "-FTP_USER=anh" "-FTP_PASSWORD=<@=sFtpPassword@>" "-FTP_PASSIVE_MODE=1" "-FTP_TRANSFER_TIMEOUT=100000" "-ODI_VARIABLE_NAMES=" "-ODI_VARIABLE_VALUES=" "-USER_ABAP_PARAMETER_NAMES=IV_DELIMITER,CHAR3;IV_FILENAME,CHAR255;IV_USER,CHAR35;IV_PWD,CHAR35;IV_HOST,CHAR35;IV_HASHVALUE,CHAR35;IV_PATH,CHAR35;IV_MAX_ROW_CNT,SYTABIX;IV_FETCH_BATCH_SIZE,SYTABIX;" "-USER_ABAP_PARAMETER_VALUES=<Value>" "-USER_ABAP_PARAMETER_SEPARATOR=<Value>" "-ABAP_TABLE_PARAMETERS=RETURN,BAPIRETURN;ET_FILE_RETURN,BAPIRET2" "-ABAP_EXPORT_PARAMETERS=ERRORMESSAGE;SY-MSGV1" "-LOG_FILE_NAME=C:\Users\anh\AppData\Local\Temp\SapAbapExecuteOpenTool_13001.log" "-FTP_PATH=/abc/" "-DEV_CLASS=ZODI_DEVCLASS" "-MAX_ROW_COUNT=" "-FETCH_BATCH_SIZE=100000" "-HASH_VALUE_MARKER=HVM" "-ABAP_PROGRAM_BODY=
    *Final Type declarations
    TYPES : BEGIN OF ty_final,
    Y03HOCSINH_HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID,
    Y03HOCSINH_MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH,
    Y03HOCSINH_TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH,
    Y03HOCSINH_GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH,
    Y03HOCSINH_DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI,
    Y03HOCSINH_GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU,
    END OF ty_final.
    *Final Temp Type Declarations
    TYPES : BEGIN OF ty_final_tmp,
    Y03HOCSINH_HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID ,
    Y03HOCSINH_MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH ,
    Y03HOCSINH_TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH ,
    Y03HOCSINH_GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH ,
    Y03HOCSINH_DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI ,
    Y03HOCSINH_GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU ,
    END OF ty_final_tmp.
    *Final Target Type Declarations
    TYPES : BEGIN OF ty_final_target,
    C0_Y03HOCSINH_HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID,
    C1_Y03HOCSINH_MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH,
    C2_Y03HOCSINH_TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH,
    C3_Y03HOCSINH_GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH,
    C4_Y03HOCSINH_DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI,
    C5_Y03HOCSINH_GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU,
    END OF ty_final_target.
    * Table type for Y03HOCSINH
    TYPES : BEGIN OF ty_Y03HOCSINH,
    HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID,
    MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH,
    TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH,
    GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH,
    DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI,
    GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU,
    END OF ty_Y03HOCSINH.
    TYPES: BEGIN OF gs_text,
    line(843) TYPE c,
    END OF gs_text.
    *Structure Declarations
    DATA: wa_final_string TYPE string,
    wa_final TYPE ty_final,
    wa_final_target TYPE ty_final_target,
    wa_Y03HOCSINH TYPE ty_Y03HOCSINH,
    *Table Declarations
    tt_final TYPE STANDARD TABLE OF ty_final,
    tt_Y03HOCSINH TYPE STANDARD TABLE OF ty_Y03HOCSINH,
    tt_final_target TYPE STANDARD TABLE
    OF ty_final_target,
    tt_final_tmp TYPE STANDARD TABLE OF ty_final_tmp,
    tt_final_tmp1 TYPE STANDARD TABLE OF ty_final,
    gt_result TYPE STANDARD TABLE OF gs_text,
    *Variable Declarations
    lv_path TYPE string,
    lv_flag TYPE char1,
    C0_Y03HOCSINH_HOCSINH_ID TYPE
    STRING,
    C1_Y03HOCSINH_MA_HOC_SINH TYPE
    STRING,
    C2_Y03HOCSINH_TEN_HOC_SINH TYPE
    STRING,
    C3_Y03HOCSINH_GIOI_TINH TYPE
    STRING,
    C4_Y03HOCSINH_DIA_CHI TYPE
    STRING,
    C5_Y03HOCSINH_GHI_CHU TYPE
    STRING,
    wa_final_tmp TYPE ty_final_tmp,
    lv_file TYPE string,
    lv_datum TYPE sy-datum,
    lv_date TYPE char10,
    wa_result TYPE string,
    lv_delimiter type string,
    lv_cnt TYPE sytabix,
    *-Cursor Declaration
    lv_Y03HOCSINH_dbcur TYPE cursor,
    lv_tabix_frm TYPE sy-tabix.
    lv_delimiter = iv_delimiter.
    IF iv_hashvalue = 'HVM'.
    *Open/delete output file
    CONCATENATE iv_path iv_filename INTO lv_path.
    *Check for file existence, if found, delete it
    OPEN DATASET lv_path FOR INPUT
    IN TEXT MODE
    ENCODING DEFAULT.
    IF sy-subrc EQ 0.
    DELETE DATASET lv_path.
    ENDIF.
    *Open/create output file
    OPEN DATASET lv_path FOR APPENDING
    IN TEXT MODE
    ENCODING DEFAULT.
    IF sy-subrc EQ 0.
    *Batch Processing
    OPEN CURSOR WITH HOLD lv_Y03HOCSINH_dbcur FOR
    SELECT HOCSINH_ID
    MA_HOC_SINH
    TEN_HOC_SINH
    GIOI_TINH
    DIA_CHI
    GHI_CHU
    FROM Y03HOCSINH.
    DO.
    *Check for the counter, only for first batch
    *process new line is required...
    lv_cnt = lv_cnt + 1.
    REFRESH tt_Y03HOCSINH.
    FETCH NEXT CURSOR lv_Y03HOCSINH_dbcur
    APPENDING TABLE tt_Y03HOCSINH
    PACKAGE SIZE IV_FETCH_BATCH_SIZE.
    IF NOT tt_Y03HOCSINH IS INITIAL.
    ELSE.
    EXIT.
    ENDIF.
    LOOP AT tt_Y03HOCSINH INTO wa_Y03HOCSINH.
    MOVE wa_Y03HOCSINH-HOCSINH_ID
    TO wa_final_tmp-Y03HOCSINH_HOCSINH_ID.
    MOVE wa_Y03HOCSINH-MA_HOC_SINH
    TO wa_final_tmp-Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_Y03HOCSINH-TEN_HOC_SINH
    TO wa_final_tmp-Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_Y03HOCSINH-GIOI_TINH
    TO wa_final_tmp-Y03HOCSINH_GIOI_TINH.
    MOVE wa_Y03HOCSINH-DIA_CHI
    TO wa_final_tmp-Y03HOCSINH_DIA_CHI.
    MOVE wa_Y03HOCSINH-GHI_CHU
    TO wa_final_tmp-Y03HOCSINH_GHI_CHU.
    APPEND wa_final_tmp TO tt_final_tmp.
    ENDLOOP.
    free : tt_Y03HOCSINH.
    LOOP AT tt_final_tmp INTO wa_final_tmp.
    MOVE wa_final_tmp-Y03HOCSINH_HOCSINH_ID
    TO wa_final_target-C0_Y03HOCSINH_HOCSINH_ID.
    MOVE wa_final_tmp-Y03HOCSINH_MA_HOC_SINH
    TO wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_final_tmp-Y03HOCSINH_TEN_HOC_SINH
    TO wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_final_tmp-Y03HOCSINH_GIOI_TINH
    TO wa_final_target-C3_Y03HOCSINH_GIOI_TINH.
    MOVE wa_final_tmp-Y03HOCSINH_DIA_CHI
    TO wa_final_target-C4_Y03HOCSINH_DIA_CHI.
    MOVE wa_final_tmp-Y03HOCSINH_GHI_CHU
    TO wa_final_target-C5_Y03HOCSINH_GHI_CHU.
    Append wa_final_target to tt_final_target.
    ENDLOOP.
    free : tt_final_tmp.
    Clear wa_final_target.
    IF NOT iv_max_row_cnt IS INITIAL.
    Loop at tt_final_target into
    wa_final_target TO iv_max_row_cnt.
    MOVE wa_final_target-C0_Y03HOCSINH_HOCSINH_ID
    TO C0_Y03HOCSINH_HOCSINH_ID.
    MOVE wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH
    TO C1_Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH
    TO C2_Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_final_target-C3_Y03HOCSINH_GIOI_TINH
    TO C3_Y03HOCSINH_GIOI_TINH.
    MOVE wa_final_target-C4_Y03HOCSINH_DIA_CHI
    TO C4_Y03HOCSINH_DIA_CHI.
    MOVE wa_final_target-C5_Y03HOCSINH_GHI_CHU
    TO C5_Y03HOCSINH_GHI_CHU.
    CONCATENATE
    C0_Y03HOCSINH_HOCSINH_ID
    C1_Y03HOCSINH_MA_HOC_SINH
    C2_Y03HOCSINH_TEN_HOC_SINH
    C3_Y03HOCSINH_GIOI_TINH
    C4_Y03HOCSINH_DIA_CHI
    C5_Y03HOCSINH_GHI_CHU
    INTO wa_final_string
    SEPARATED BY lv_delimiter.
    IF sy-tabix EQ 1 AND lv_cnt EQ 1.
    CONCATENATE wa_final_string
    lv_delimiter INTO wa_final_string.
    ELSE.
    CONCATENATE '<@=""+(char)8@>' lv_delimiter wa_final_string
    lv_delimiter INTO wa_final_string.
    ENDIF.
    APPEND wa_final_string TO gt_result.
    CLEAR : C0_Y03HOCSINH_HOCSINH_ID,
    C1_Y03HOCSINH_MA_HOC_SINH,
    C2_Y03HOCSINH_TEN_HOC_SINH,
    C3_Y03HOCSINH_GIOI_TINH,
    C4_Y03HOCSINH_DIA_CHI,
    C5_Y03HOCSINH_GHI_CHU.
    ENDLOOP.
    ELSE.
    Loop at tt_final_target into wa_final_target.
    MOVE wa_final_target-C0_Y03HOCSINH_HOCSINH_ID
    TO C0_Y03HOCSINH_HOCSINH_ID.
    MOVE wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH
    TO C1_Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH
    TO C2_Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_final_target-C3_Y03HOCSINH_GIOI_TINH
    TO C3_Y03HOCSINH_GIOI_TINH.
    MOVE wa_final_target-C4_Y03HOCSINH_DIA_CHI
    TO C4_Y03HOCSINH_DIA_CHI.
    MOVE wa_final_target-C5_Y03HOCSINH_GHI_CHU
    TO C5_Y03HOCSINH_GHI_CHU.
    CONCATENATE
    C0_Y03HOCSINH_HOCSINH_ID
    C1_Y03HOCSINH_MA_HOC_SINH
    C2_Y03HOCSINH_TEN_HOC_SINH
    C3_Y03HOCSINH_GIOI_TINH
    C4_Y03HOCSINH_DIA_CHI
    C5_Y03HOCSINH_GHI_CHU
    INTO wa_final_string
    SEPARATED BY lv_delimiter.
    IF sy-tabix EQ 1 AND lv_cnt EQ 1.
    CONCATENATE wa_final_string
    lv_delimiter INTO wa_final_string.
    ELSE.
    CONCATENATE '<@=""+(char)8@>' lv_delimiter wa_final_string
    lv_delimiter INTO wa_final_string.
    ENDIF.
    APPEND wa_final_string TO gt_result.
    CLEAR : C0_Y03HOCSINH_HOCSINH_ID,
    C1_Y03HOCSINH_MA_HOC_SINH,
    C2_Y03HOCSINH_TEN_HOC_SINH,
    C3_Y03HOCSINH_GIOI_TINH,
    C4_Y03HOCSINH_DIA_CHI,
    C5_Y03HOCSINH_GHI_CHU.
    ENDLOOP.
    ENDIF.
    free : tt_final_target.
    IF NOT gt_result IS INITIAL.
    CLEAR wa_result.
    LOOP AT gt_result INTO wa_result.
    TRANSFER wa_result TO lv_path.
    ENDLOOP.
    ENDIF.
    REFRESH gt_result.
    *End of main loop for batching
    ENDDO.
    *Close dataset
    CLOSE DATASET lv_path.
    CLOSE CURSOR lv_Y03HOCSINH_dbcur.
    ELSE.
    DATA: lv_mesg TYPE string.
    CLEAR et_file_return.
    et_file_return-type = 'E'.
    CONCATENATE
    'Error occurred when creating dataset' lv_path
    INTO lv_mesg.
    et_file_return-message = lv_mesg.
    Append et_file_return.
    ENDIF.
    ELSE.
    CLEAR et_file_return.
    et_file_return-type = 'E'.
    et_file_return-message =
    'Installed ABAP program does not match interface definition'.
    APPEND et_file_return.
    ENDIF.
    Thanks for help

    r u able to figure it out..........i got the same error .......can someone help me fix this issue

  • Payment Program F110 is not creating spool

    Hello experts,
    We are very close to the go-live and facing a major issue with Automatic Payment Program F110. We asked the dev to design Z check form for F110. Our form works well with manual Run ( F-58), we can see spool as well as print but when we Run the F110 the same form does not create any spool nor print anything. Even though its create the check, done the posting but no spool no print. The error we are getting it is  'No printer fonts maintained for Message no. TD327' . IT people sets all the fonts but no luck.
    appritiate the comments.
    Thanks

    Hi,
    take a look on this sap note.
    i hope it help you.
    Regds
    Note 391852 - Message TD327 (No printer fonts maintained for &)
    Summary
    Symptom
    The system displays error message TD327 (No printer fonts maintained for &) during the print although the device type of the printer has a base device type with printer fonts.
    Additional key words
    IW31, IW32, IW3D, IW21, IW22, IW23
    Cause and prerequisites
    The device type has not separate printer fonts but inherits them from the base device type.
    Solution
    Implement the program correction as specified in the

  • Submit statemet not creating spool in back ground

    Hi,
    My program works perfectly fine(creates spool) when I execute in foreground. But it doesn't create the spool when I execute in back ground. Pls help...
            SUBMIT rkaep000
                   WITH p_tcode = 'KOB2'
                   WITH aufnr   IN r_aufnr
                   WITH r_budat IN r_date
                   WITH p_disvar = '/SCORP 1404'
                   TO SAP-SPOOL SPOOL PARAMETERS params
                   WITHOUT SPOOL DYNPRO
                   AND RETURN .

    Hi Chesat bs,
    check demo program DEMO_LIST_SUBMIT_TO_SPOOL.
    Hope this helps.
    Thanks
    Lakshman

  • Sapscript not creating spool

    Hello gurus, is it possible to create a spool, when seeing and printing the sapscript at run-time?
    I am using FM GET_TEXT_PRINT_PARAMETERS but is not creating any spool.
    Thanks in advance!

    Hi,
    Try like this:
    FORM open_form.
      DATA : tmp_answer.
    itcpo-tdimmed = 'X' .
      perform fill_itcpo.
      itcpo-tdgetotf = 'X'.          
      itcpo-tdpreview = space.      
      CALL FUNCTION 'OPEN_FORM'
           EXPORTING
                form                        = layout
                language                    = sy-langu
                options                     = itcpo
                device                      = 'PRINTER'
               dialog                      = ' '
               options                     = it_itcpo
           EXCEPTIONS
                canceled                    = 1
                device                      = 2
                form                        = 3
                options                     = 4
                unclosed                    = 5
                mail_options                = 6
                archive_error               = 7
                invalid_fax_number          = 8
                more_params_needed_in_batch = 9
                OTHERS                      = 10.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.
    form fill_itcpo .
      REFRESH it_itcpo.
      CLEAR   it_itcpo.
      it_itcpo-TDPAGESLCT = SPACE.
      it_itcpo-TDCOPIES   = SPACE.
      it_itcpo-TDDEST     = 'LOCL'.
      it_itcpo-TDPRINTER  = SPACE.
      it_itcpo-TDPREVIEW  = SPACE.
      it_itcpo-TDNOPREV   = SPACE.
      it_itcpo-TDNOPRINT  = SPACE.
      it_itcpo-TDNEWID    = 'X'.
      it_itcpo-TDDATASET  = SPACE.
      it_itcpo-TDSUFFIX1  = SPACE.
      it_itcpo-TDSUFFIX2  = SPACE.
      it_itcpo-TDLIFETIME = SPACE.
      it_itcpo-TDSCHEDULE = SPACE.
      it_itcpo-TDSENDDATE = SPACE.
      it_itcpo-TDSENDTIME = SPACE.
      it_itcpo-TDTELELAND = SPACE.
      it_itcpo-TDTELENUM  = SPACE.
      it_itcpo-TDTITLE    = SPACE.
      it_itcpo-TDTEST     = SPACE.
      it_itcpo-TDPROGRAM  = 'Z_1IEWT_CERT_F01'.
      it_itcpo-TDSCRNPOS  = SPACE.
      it_itcpo-TDCOVER    = SPACE.
      it_itcpo-TDCOVTITLE = SPACE.
      it_itcpo-TDRECEIVER = SPACE.
      it_itcpo-TDDIVISION = SPACE.
      it_itcpo-TDAUTORITY = SPACE.
      it_itcpo-TDARMOD    = SPACE.
      it_itcpo-TDIEXIT    = SPACE.
    it_itcpo-TDGETOTF   = 'X'.
      it_itcpo-tdgetotf = space.
      it_itcpo-TDFAXUSER  = SPACE.
      it_itcpo-TDIMMED    = 'X'.
      it_itcpo-TDDELETE   = SPACE.
    endform.                    " fill_itcpo
    call function 'CLOSE_FORM'
    IMPORTING
       RESULT                         = LS_ITCPP
    TABLES
       OTFDATA                        = it_otfdata       
    EXCEPTIONS
       UNOPENED                       = 1
       BAD_PAGEFORMAT_FOR_PRINT       = 2
       SEND_ERROR                     = 3
       OTHERS                         = 4.
    if sy-subrc eq 0.
       submit rstxpdft4 with spoolno = ls_itcpp-tdspoolid and return. 
    endif.     
    Regards,
    Bhaskar

  • W2reprint not creating spool

    I am working on setting up the online W2 functionality for my client in USA. The W2 reprint request is not creating a spool in SP01.When I tried to debug the (W2FORM) object, the submit statement SUBMIT rpctrpu0 is returning with found = X.
    When I checked SP11, I see a temse file HRL*** and its content has the following lines:
    Main form not found in table T51T8
    No results exist in the cluster for the given criteria.
    While debugging I did see it picking up the values from T51T8, so I am at this point not sure how else to troubleshoot this.
    Can someone please help?
    Thanks,
    Maria.

    Hi Ameet.
    I deleted all the test PCL4 data in the sandbox client. The reprint method is taking the correct date for the W2 reprint by checking v_5uxy_a table. So, I tried this on our dev system. It created the HRL spool in SP11, and this time it has two lines in the content, which has the form number and control number with the date/year information of the W2 reprint. Again, no spool in SP01.
    I hope this might work in prod system. If you have any inputs for me please do comment below.
    Thanks,
    Gracias,
    Maria.

  • Executing a program in background is failed

    Hi Experts,
                    i am having a program while executing it in foreground its executing perfectly but while executing it in background, it is failed in job log its showing: this error:-Control Framework: Fatal error - GUI cannot be reached
    ABAP/4 processor: RAISE_EXCEPTION.
    While debugging i found the job is getting canceled at the statement
    SUBMIT rs_display_variant WITH SELECTION-TABLE i_params
                 EXPORTING LIST TO MEMORY
                 AND RETURN.
    RS_DISPLAY_VARIANT is not executimg while executing it in background. So if anybody knows how to resolve this or what i need to use instead of RS_DISPLAY_VARIANT . Please let me know.
    Thanks

    Hi,
    Use Offline method of CL_GUI_ALV_GRID
    Refer following documentation of the method.
    http://help.sap.com/saphelp_nw70/helpdata/EN/bf/3bd1369f2d280ee10000009b38f889/frameset.htm
    Regards,
    Mohaiyuddin

  • Need to execute a program in background

    Hello,
    I have a report program that has a checkbox option to 'Execute in background'. This should also generate a spool file in SAP. I would just like to ask for options on how to do about this.
    I have thought of using the SUBMIT command and I read that this command can also generate a spool file. So it is like calling the program itself. Is this possible? Or do I need to make a cloned program and call submit the parameters to the cloned program?
    Is there a function module that does this?
    I'd appreciate your help on this. Thanks in advance!
    Regards,
    Kristine

    Hello,
    To create a Job Step, the FM 'JOB_OPEN' could be used.
    To add a JOBSTEP, In your case an ABAP program, "SUBMIT" could be used.
    To close the job step, use FM "JOB_CLOSE".
    SAMPLE Code:
      CALL FUNCTION 'JOB_OPEN'
           EXPORTING
            DELANFREP        = ' '
            JOBGROUP         = ' '
               jobname          = 'XYZ'
               sdlstrtdt        = sy-datum "Current date
               sdlstrttm        = sy-uzeit
          IMPORTING
               jobcount         = g_jobcount
          EXCEPTIONS
               cant_create_job  = 1
               invalid_job_data = 2
               jobname_missing  = 3
               OTHERS           = 4
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      SUBMIT z_PROGRAM AND RETURN
         USER sy-uname      " User for runtime authorizations
         WITH p_para   EQ p_para
         "..... Selection screen parameters
         VIA JOB g_jobname NUMBER g_jobcount
                         " Job name and job number
                         " from JOB_OPEN
         TO SAP-SPOOL    " Print and archiving options from
                         " GET_PRINT_PARAMETERS
                         " Both sets of options come from
                         " GET_PRINT_PARAMETERS
            SPOOL PARAMETERS g_s_user_print_params
            ARCHIVE PARAMETERS g_s_user_arc_params
            WITHOUT SPOOL DYNPRO.
      CALL FUNCTION 'JOB_CLOSE'
           EXPORTING
            AT_OPMODE                   = ' '
            AT_OPMODE_PERIODIC          = ' '
            CALENDAR_ID                 = ' '
            EVENT_ID                    = ' '
            EVENT_PARAM                 = ' '
            EVENT_PERIODIC              = ' '
                jobcount                    = g_jobcount
                jobname                     = g_jobname
            LASTSTRTDT                  = NO_DATE
            LASTSTRTTM                  = NO_TIME
            PRDDAYS                     = 0
            PRDHOURS                    = 0
            PRDMINS                     = 0
            PRDMONTHS                   = 0
            PRDWEEKS                    = 0
            PREDJOB_CHECKSTAT           = ' '
            PRED_JOBCOUNT               = ' '
            PRED_JOBNAME                = ' '
               sdlstrtdt                   = g_datum
               sdlstrttm                   = g_uzeit
            STARTDATE_RESTRICTION       = BTC_PROCESS_ALWAYS
            STRTIMMED                   = ' '
            TARGETSYSTEM                = ' '
            START_ON_WORKDAY_NOT_BEFORE = SY-DATUM
            START_ON_WORKDAY_NR         = 0
            WORKDAY_COUNT_DIRECTION     = 0
            RECIPIENT_OBJ               =
            TARGETSERVER                = ' '
          IMPORTING
               job_was_released            = g_job_released
          EXCEPTIONS
               cant_start_immediate        = 1
               invalid_startdate           = 2
               jobname_missing             = 3
               job_close_failed            = 4
               job_nosteps                 = 5
               job_notex                   = 6
               lock_failed                 = 7
               OTHERS                      = 8
    You can get the Print Parameters from FM: 'GET_PRINT_PARAMETERS'.
    All the above FMs have detailed documentation which will help you.
    Hope this helps you.
    Regards, Murugesh AS

  • Error in executing a program in background?

    Hi all,
    I have one report , which is alv grid display using Oops.
    it is going to be executed in online but when we are try to execute this in background through path
    Program->Execute in background.
    the job is going to be canceled with error "Control Framework: Fatal error - GUI cannot be reached" and also i am getting one popup message like " format set to x_65_132"
    how can we rectify this error , what we have to code in program to overcome this problem.....
    thanks in advance

    Hi,
    1)Goto SM36,
    2)Enter all the options
    3)Click step,
    4)If the job is being scheduled to run an ABAP program, follow the directions mentioned below. Else, jump to Step 5.
    Fill the “User” field . This is very important,     Put the program name in the “NAME” field,Put the variant name in the “VARIANT” field and save.
    5)If the job executes an external command, then follow the steps below:Click on “External Command” and fill the fields and click save.
    Reward if useful

  • Background job not generating spool

    Hi all,
          I am calling a report from another report. The called report will display the final output list.
    Here, the called report will be executed in background.
    here the job is completing but the spool is not generated.

    Hi,
    It seems that the final internal table which has the output data is empty & hence write statements are not executed ( assuming all the write statements are inside a loop).
    Place one write statement outside loop like
    write :/ 'Following is the result :'.
    & check whether spool is generated. If yes, then the problem is of empty internal table.
    You can select the job in SM37 & type JDBG in command prompt to debug a background job.
    Debug & check the issue.
    Best regards,
    Prashant

  • Saving a delivery, does not create spool request

    Hi,
    I have a delivery and 2 output types. The print program of first output type already exists and I created one for the second one.
    When I save the delivery, spool request gets created for the first output type but doesn for the one I created. Can anyon tell why?

    hi,
    It has to be assigned to the second output type, the first one is for a different purpose.
    Is there any change need to be done in program to correct it?
    But, It does work when run through transaction.

  • How to create a variant and execute a Z-program in background

    Hello,
    I have created a specific transaction to update relationships between partners (BP).
    For this i have create a screen painter, but as the run time is long i want to execute the program in background.
    How to save a variant and to execute the report in background ?
    Thanks in advance
    Christophe

    Hi,
    Please go to your z-transaction.
    Enter your selection criteria. & click on save button to save your your selection criteria as a variant.
    Now go to tcode SM36 to shedule your program with saved variant.
    Regards,
    Narendra

Maybe you are looking for

  • T.CODE:OB52 Problem

    Hi Now you at Quality server for Unit testing and Integration testing but problem is when you are using T.Code:-OB52 its showing display mode so you cannot open and closed posting periods. What is the problem is in fianance moduel or basis module cou

  • Save dialog box for text and pdf files

    Hi, I am using CRM UI framework for developing my components. Currently i have a hyperlink for a file. On click of the hyperlink i want the Save dialog box to appear with SAVE/OPEN/CANCEL options. For Word/Excel/PPT files, dialog box appears. However

  • InDesign CC 2014 crashes on startup

    I am encountering an odd error every time I try and start inDesign CC 2014. It starts loading and then an APPCRASH error occurs. The log suggests the problem lies with PlugPlugOwl.dll If I uninstall inDesign and remove the preferences and then reinst

  • PO Approval based on Vendor Category.

    Hi There is a typical scenario in my client's system. Now we need to implement SAP PO approval process is there. There are two major characteristics 1. PO value 2. Vendor's present category. Vendor's present grade : During vendor evaluation, vendor a

  • Create link which returns true or false

    i need something that allows the server to send a message to the client asking them if they wish to acept a file. Idealy i would like it to be a link similar to that of msn messenger. but i cant seem to find something similar.. any sugestions as to w