Problem in Open dataset in background

Hi All,
Iam facing the problem in Open dataset in background. It is working fine in foreground.
Iam able to read only one line from the application server file in background.
Please find below the code.
  IF sy-batch = wl_x.
    OPEN DATASET pa_sfile FOR INPUT IN TEXT MODE encoding default. "    
   IF sy-subrc = 0.
      DO.
        READ DATASET pa_sfile INTO wf_string.
        IF sy-subrc <> 0.
          EXIT.
        ELSE.
          SPLIT wf_string AT cl_abap_char_utilities=>horizontal_tab INTO wa_upload-
                   field1 wa_upload-field2 wa_upload-field3
          wa_upload-field4 wa_upload-field5 wa_upload-field6 wa_upload-field7
         wa_upload-field8   wa_upload-field9 wa_upload-field10 wa_upload-field11 wa_upload-field12 wa_upload-field13 wa_upload-field14 wa_upload-field15 wa_upload-field16 wa_upload-field17 wa_upload-field18  wa_upload-field19 wa_upload-field20 wa_upload-field21 wa_upload-field22 wa_upload-field23
          wa_upload-field24 wa_upload-field25 wa_upload-field26 wa_upload-field27 wa_upload-field28  wa_upload-field29 wa_upload-field30 wa_upload-field31 wa_upload-field32 wa_upload-field33  wa_upload-field34 wa_upload-field35 wa_upload-field36 .
          APPEND wa_upload TO int_upload.
          CLEAR wa_upload.
        ENDIF.
      ENDDO.
      CLOSE DATASET pa_sfile.
Thanks in advance.
Quick suggestions are highly appreciated.
Best Regards,
Brahma Reddy

Thanks for the reply.
Here is the whole code.
Here iam submitting one job to the backgrond. But if iam executing it in debugging mode by changing the values of sy-batch( without submitting to background ) at run time, my program is working fine.
REPORT zvtraffic_carrier_upload
       NO STANDARD PAGE HEADING LINE-SIZE 255
              MESSAGE-ID zmmx.
*Data Declarations                                                     *
TABLES: vtrkh,
        vekp,
        zvship_non_pkgs.
declaration of data
DATA:
   wf_filename         LIKE ibipparms-path,  "file with path
   wf_file             LIKE ibipparms-path,        "file
   wf_extsn(3)         TYPE c ,              "file extension
   wf_recnt            TYPE i,
   wf_recok            TYPE i,
*+001 Begin
   wf_string           TYPE string,
   wf_mess             TYPE string,
   wf_field1       TYPE string,
   wf_field2(30)       TYPE c,
   wf_sum_source_file  TYPE rlgrap-filename ,
   wf_sum_dest_file    TYPE rlgrap-filename ,
  wf_path         LIKE   rlgrap-filename,
   wf_path TYPE salfile-longname
                    VALUE '/usr/sap/nfs/erp/UTL/',
*+001 End
   wf_complete_file    LIKE pcfile-path.     "total file path
declaration of counters
DATA:
   wc_rec(6)          TYPE c,                "total record counter
   wc_success_rec(6)  TYPE c,                "no of rec.having no errors
   wc_error_rec(6)    TYPE c,                "no of rec. having errors
   wc_rec_tot(6)      TYPE c.                "total records
Constants declarations
CONSTANTS:
   wl_x(1)         TYPE c VALUE 'X',          "X
   wl_1            TYPE i           VALUE '1',         "Integer value
   wl_e(1)         TYPE c           VALUE 'E',         "Char    value
   wl_mode         TYPE c           VALUE 'N',
   wl_update       TYPE c           VALUE 'S',
   wl_trackno(13)  TYPE c           VALUE 'Tracking No. ',
   wl_tcode(14)    TYPE c           VALUE 'ZVTRAFFICINPUT',
*+001 Begin:
   wl_id(11)       TYPE c           VALUE 'CARRIERFILE',
   wl_adm(100)     TYPE c           VALUE '[email protected]',
   wl_u(1)         TYPE c VALUE 'U',       " Email through Internet
   wl_int(3)       TYPE c VALUE 'INT',     " Communication method
   wl_urgent(6)    TYPE c VALUE 'Urgent',
   wl_raw(3)       TYPE c VALUE 'RAW',
   wl_descr(48)    TYPE c VALUE 'SAP Alert: Carrier upload',
   wl_file(128)    TYPE c VALUE '/usr/sap/nfs/erp/UTL/carrier.xls',
   wl_jobname LIKE tbtcjob-jobname VALUE 'ZVTRAFFIC_UP',
   wl_variant LIKE raldb-variant VALUE 'VMM01_ZVTRFFIC',
   wl_action  TYPE  zaction VALUE 'MOV', "For moving file to other dir
   wl_i       TYPE  c VALUE 'I',
   wl_cmd(50) TYPE c VALUE '/usr/sap/nfs/erp/UTL/',
   wl_57           TYPE i      VALUE 57,
   wl_m1(2)         TYPE c VALUE 'M1',                      "value M1
   wl_m2(2)         TYPE c VALUE 'M2',                      "value M1
*+001 End:
   wl_xls(3)       TYPE c           VALUE 'xls',       "Char value
   wl_value(1)     TYPE c           VALUE ','.         "Char value
*Internal Tables Declarations                                          *
internal table for holding data from excel file
*+001 begin
TYPES : BEGIN OF ty_dir,
         dir(132)  TYPE  c,
        END   OF ty_dir.
*internal table to get the files in the direactory
DATA : int_dir      TYPE ty_dir OCCURS 0 WITH HEADER LINE .
*work area for int_dir
DATA : wa_int_dir      LIKE LINE OF int_dir.
DATA: ifiles TYPE TABLE OF  salfldir WITH HEADER LINE.
*+001 end
TYPES: BEGIN OF int_upload,
         field1(30)   TYPE c,       "
         field2(30)   TYPE c,       "
         field3(30)   TYPE c,       "
         field4(30)   TYPE c,       "
         field5(30)   TYPE c,       "
         field6(30)   TYPE c,       "
         field7(30)   TYPE c,       "
         field8(30)   TYPE c,       "
         field9(30)   TYPE c,       "
         field10(30)  TYPE c,       "
         field11(30)  TYPE c,       "
         field12(30)  TYPE c,       "
         field13(30)  TYPE c,       "
         field14(30)  TYPE c,       "
         field15(30)  TYPE c,       "
         field16(30)  TYPE c,       "
         field17(30)  TYPE c,       "
         field18(30)  TYPE c,       "
         field19(30)  TYPE c,       "
         field20(30)  TYPE c,       "
         field21(30)  TYPE c,       "
         field22(30)  TYPE c,       "
         field23(30)  TYPE c,       "
         field24(30)  TYPE c,       "
         field25(30)  TYPE c,       "
         field26(30)  TYPE c,       "
         field27(30)  TYPE c,       "
         field28(30)  TYPE c,       "
         field29(30)  TYPE c,       "
         field30(30)  TYPE c,       "
         field31(30)  TYPE c,       "
         field32(30)  TYPE c,       "
         field33(30)  TYPE c,       "
         field34(30)  TYPE c,       "
         field35(30)  TYPE c,       "
         field36(30)  TYPE c,       "
        END OF int_upload.
DATA: int_upload   TYPE STANDARD TABLE OF int_upload.
declaring bdc table
DATA: int_bdcdata LIKE STANDARD TABLE OF bdcdata
      INITIAL SIZE 0 WITH HEADER LINE.
DATA:   wa_bdcdata LIKE bdcdata.
DATA:int_messages TYPE
     STANDARD TABLE OF bdcmsgcoll INITIAL SIZE 0.
TYPES: BEGIN OF ty_error_data,
       errtext(500) TYPE c,
       END OF ty_error_data.
DATA: wa_messages LIKE LINE OF
      int_messages.
DATA: wa_error_data TYPE
      ty_error_data .
DATA: int_error_data TYPE
      STANDARD TABLE OF ty_error_data INITIAL SIZE 0.
*Work Area declarations
Work area
DATA:
wa_upload    LIKE LINE OF int_upload.      "work area for int_upload
Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : pa_foreg RADIOBUTTON GROUP g1 USER-COMMAND rad DEFAULT 'X', " user command rad,
             pa_backg RADIOBUTTON GROUP g1 .
SELECTION-SCREEN: SKIP.
Input File Location Specification
SELECTION-SCREEN BEGIN OF BLOCK b11 WITH FRAME TITLE text-002.
PARAMETERS pa_file LIKE rlgrap-filename
           MODIF ID m1. "OBLIGATORY.     "Input File -001
SELECTION-SCREEN END OF BLOCK b11.
*+001 Begin
SELECTION-SCREEN BEGIN OF BLOCK b12 WITH FRAME TITLE text-006.
PARAMETERS pa_sfile LIKE rlgrap-filename DEFAULT '/usr/sap/nfs/erp/UTL/carrier2'
           LOWER CASE MODIF ID m2. " server filename
*PARAMETERS pa_batch AS CHECKBOX DEFAULT ' ' MODIF ID m2.    "Background job
*+001 End
SELECTION-SCREEN END OF BLOCK b12.
SELECTION-SCREEN END OF BLOCK b1.
Event: INITIALIZATION
INITIALIZATION.
clear variables
refresh internal tables
  REFRESH:int_upload.
clear Work areas
  CLEAR:  wa_upload.
A T  S E L E C T I O N - S C R E E N
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_file.           "-001
subroutine to display the batch data input file location
  PERFORM f_get_filename.
*+001 Begin:
AT SELECTION-SCREEN OUTPUT.
  IF pa_backg = wl_x.
    LOOP AT SCREEN.
      IF screen-group1 = wl_m2.
        screen-invisible = space.
        screen-active = '1'.
        MODIFY SCREEN.
      ELSE.
        IF screen-group1 = wl_m1.
          screen-input = '0'.
          MODIFY SCREEN.
        ENDIF.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 = wl_m2.
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_sfile.
subroutine to display list of files in application server
  PERFORM f_get_server_file.
*+001 End:
At Selection-Screen Event: validations check                        *
AT SELECTION-SCREEN .
validates the Selection Screen input
  PERFORM f_check_input.
Event TOP-OF-PAGE
TOP-OF-PAGE.
Event: START-OF-SELECTION
START-OF-SELECTION.
*+001 Begin :
get the path for all files from the directory
PERFORM f_get_path.
set up background job
  PERFORM f_background_job.
*+001 End:
*-001
  CHECK pa_backg EQ ' '.
*-001
LOOP AT ifiles.
clear itab. refresh itab.
   CONCATENATE wf_path ifiles-name INTO pa_sfile.
upload PC file to internal table int_UPLOAD
  PERFORM f_upload_excel_file.
reformat data
  PERFORM f_format_data.
upload formatted data into SAP system
  break breddy.
  PERFORM f_upload_data.
Event: END-OF-SELECTION
*END-OF-SELECTION.
display summary report
  PERFORM f_display_report.
*+001 Begin
  IF sy-batch = wl_x.
  CONCATENATE '/usr/sap/trans/carrier2' '_'
              sy-datum '_' sy-uzeit
              INTO wf_sum_dest_file.
    wf_sum_source_file = '/usr/sap/nfs/erp/UTL/carrier2'.
   wf_sum_dest_file = '/usr/sap/trans/carrier2'.
ELSE.
   wf_sum_source_file = pa_file.
   wf_sum_dest_file = '/usr/sap/trans/carrier2'.
To move the processed file to Completed directory
  PERFORM f_move_file_to_other_dir USING
               wf_sum_source_file
               wf_sum_dest_file.
  ENDIF.
*+001 End
  wait up to 60 seconds.
*&      Form  f_get_filename
      Display the File Location
      Called by:  Main Program (AT SELECTION-SCREEN on VALUE-REQUEST)
      Calls:
FORM f_get_filename.
  CLEAR wf_filename.
  CALL FUNCTION 'F4_FILENAME'
       EXPORTING
            program_name  = syst-cprog
            dynpro_number = syst-dynnr
           field_name    = wf_fieldname
       IMPORTING
            file_name     = wf_filename.
If the user press cancel button without selecting file name
then the file name will be initial and raise the error message
  IF wf_filename IS INITIAL.
    MESSAGE i000 WITH 'No File selected'(012).
    LEAVE LIST-PROCESSING.
  ENDIF.
  pa_file = wf_filename.
ENDFORM.                    " f_get_filename
Form: F_CHECK_INPUT                                                **
Description:
This subroutine is used to validate the Selection Screen inputs.
Called By:  ZMISOPPLAN01                                            *
Calls:      None                                                    *
FORM f_check_input.
  if pa_foreg eq wl_X.
    if sy-batch ne wl_X.  " IF pa_foreg EQ wl_x.                                      " +001
check file type
    IF pa_file NS '.xls'.
      MESSAGE e106.
    ENDIF.
  ENDIF.              "+001
  endif.
*+001 Begin:
wf_file = pa_sfile.
EXPORT wf_file TO MEMORY ID wl_id.
ENDIF.  " Commented by Br
*+001 Begin
  IF pa_backg EQ wl_x.
    pa_sfile = '/usr/sap/nfs/erp/UTL/carrier2'.
    OPEN DATASET pa_sfile FOR INPUT IN TEXT MODE ENCODING  DEFAULT MESSAGE wf_mess.
    IF sy-subrc NE 0.
      MESSAGE e000(zmmx) WITH 'File not present in path /usr/sap/nfs/erp/UTL'.
      LEAVE LIST-PROCESSING.
      STOP.
    ELSE.
      CLOSE DATASET pa_sfile.
    ENDIF.
ELSE.
   OPEN DATASET pa_sfile FOR INPUT IN TEXT MODE ENCODING  DEFAULT MESSAGE wf_mess.
   IF sy-subrc NE 0.
     MESSAGE e000(zmmx) WITH 'File not found:' pa_sfile.
     LEAVE LIST-PROCESSING.
     STOP.
   ELSE.
     CLOSE DATASET pa_sfile.
   ENDIF.
  ENDIF.
*+001 End:
ENDFORM.                                            "f_check_input
*&   Form  f_upload_excel_file
   Uploads an excel file from the workstation. The file is loaded  *
   into the internal table specified by int_out_tab.               *
-->  PA_FILE       The name and path of the excel file to upload  *
<--  int_UPLOAD    Internal table that that will contain the data *
                    loaded from the excel file.                    *
FORM f_upload_excel_file.
*-001
  TYPES truxs_t_text_data(4096) TYPE c OCCURS 0.
  DATA: int_tab_input_data TYPE truxs_t_text_data.
*+001
  IF sy-batch IS INITIAL.
*+001
uploading data into internal table int_upload from excel file
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
        i_tab_raw_data       = int_tab_input_data[]
        i_filename           = pa_file                      "-001
      TABLES
        i_tab_converted_data = int_upload
      EXCEPTIONS
        conversion_failed    = 1
        OTHERS               = 2.
problems occur in file uploading
    IF int_upload[] IS INITIAL.
      MESSAGE i000 WITH 'No data uploaded from input file'(005).
      LEAVE LIST-PROCESSING.
    ENDIF.
*+001
  ENDIF.
*+001
  IF sy-batch = wl_x.
    OPEN DATASET pa_sfile FOR INPUT IN TEXT MODE encoding default. " ENCODING  DEFAULT MESSAGE wf_mess.
    IF sy-subrc = 0.
      DO.
        READ DATASET pa_sfile INTO wf_string.
        IF sy-subrc <> 0.
          EXIT.
        ELSE.
          SPLIT wf_string AT cl_abap_char_utilities=>horizontal_tab INTO wa_upload-field1 wa_upload-field2 wa_upload-field3
          wa_upload-field4 wa_upload-field5 wa_upload-field6 wa_upload-field7 wa_upload-field8
          wa_upload-field9 wa_upload-field10 wa_upload-field11 wa_upload-field12 wa_upload-field13
          wa_upload-field14 wa_upload-field15 wa_upload-field16 wa_upload-field17 wa_upload-field18
          wa_upload-field19 wa_upload-field20 wa_upload-field21 wa_upload-field22 wa_upload-field23
          wa_upload-field24 wa_upload-field25 wa_upload-field26 wa_upload-field27 wa_upload-field28
          wa_upload-field29 wa_upload-field30 wa_upload-field31 wa_upload-field32 wa_upload-field33
          wa_upload-field34 wa_upload-field35 wa_upload-field36 .
          APPEND wa_upload TO int_upload.
          CLEAR wa_upload.
        ENDIF.
      ENDDO.
      CLOSE DATASET pa_sfile.
    ELSE.
      MESSAGE i000(zmmx) WITH 'File not found'.
      LEAVE LIST-PROCESSING.
      STOP.
    ENDIF.
  ENDIF.
+001
ENDFORM.                                  "f_upload_excel_file
*&      Form  f_format_data
      format the data to be uploaded
      Called by:  ZMISOPPLAN01
      Calls: N/A
FORM f_format_data.
delete the header lines
  DELETE int_upload WHERE
  field1 CS 'SCAC' OR field1 CS 'Scac' OR field1 CS 'Carrier'.
delete lines with no carrier info
  DELETE int_upload WHERE
  field1 IS INITIAL OR field2 IS INITIAL.
  SORT int_upload BY field2.
ENDFORM.                    " f_format_data
*&      Form  f_upload_data
      Description:upload the data
FORM f_upload_data.
  DATA: loc_priceperlb LIKE zvship_trk_data-act_per_lb,
        loc_charprice(10) TYPE n,
        loc_size TYPE i,
        loc_pickupdate(10) TYPE c,
        loc_totalwt    LIKE zvship_trk_data-pkg_wgt.
  CHECK NOT int_upload[] IS INITIAL.
  DESCRIBE TABLE int_upload LINES wf_recnt.
  LOOP AT int_upload INTO wa_upload.
    SELECT COUNT(*) FROM zvship_trk_data WHERE trackn = wa_upload-field2.
    IF sy-subrc = 0.
tracking no. exists in carrier database
      CONCATENATE wl_trackno wa_upload-field2
      ' already exists in carrier tracking database'  INTO
      wa_error_data-errtext. "Error text of int_error_data
      APPEND wa_error_data TO int_error_data.
    ELSE.
      SELECT SINGLE * FROM vtrkh WHERE trackn = wa_upload-field2.
      IF sy-subrc <> 0.
tracking no. not in tracking database
        CONCATENATE wl_trackno wa_upload-field2
        ' not found in tracking database'  INTO
        wa_error_data-errtext. "Error text of int_error_data
        APPEND wa_error_data TO int_error_data.
      ELSE.
must have freight charge
        IF wa_upload-field20 IS INITIAL.
          CONCATENATE wl_trackno wa_upload-field2
          ' has no total net charges'  INTO
          wa_error_data-errtext. "Error text of int_error_data
          APPEND wa_error_data TO int_error_data.
          CONTINUE.
        ENDIF.
must have final delv. date
        IF wa_upload-field25 IS INITIAL.
          CONCATENATE wl_trackno wa_upload-field2
          ' has no final delivery date'  INTO
          wa_error_data-errtext. "Error text of int_error_data
          APPEND wa_error_data TO int_error_data.
          CONTINUE.
        ENDIF.
all checks ok, build BDC for ZVTRAFFICINPUT
get total weight and compute price/lb
        IF vtrkh-uevbtyp EQ wl_x.
          SELECT SINGLE  brgew INTO loc_totalwt
          FROM zvship_non_pkgs
            WHERE venum = vtrkh-vbeln.
        ELSE.
          SELECT SINGLE brgew INTO loc_totalwt
          FROM vekp WHERE venum = vtrkh-vbeln.
        ENDIF.
        IF sy-subrc NE 0.
          CONCATENATE wl_trackno wa_upload-field2
          ' has no total weight'  INTO
          wa_error_data-errtext. "Error text of int_error_data
          APPEND wa_error_data TO int_error_data.
          CONTINUE.
        ENDIF.
price/lb = total net charges / total wt
        loc_priceperlb = wa_upload-field20 / loc_totalwt.
        WRITE loc_priceperlb TO loc_charprice LEFT-JUSTIFIED.
if no pickup date from VTRKH, use date from file
        IF vtrkh-routeldat IS INITIAL.
          loc_pickupdate = wa_upload-field23.
        ELSE.
          CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
            EXPORTING
              input  = vtrkh-routeldat
            IMPORTING
              output = loc_pickupdate.
        ENDIF.
        PERFORM f_set_bdc_val
        USING :
        '1' 'SAPLZVSHIP_TRAK' '0001',
        ' ' 'BDC_CURSOR' 'VIM_POSITION_INFO',
        ' ' 'BDC_OKCODE' '=AEND'.
        PERFORM f_set_bdc_val
        USING :
        '1' 'SAPLZVSHIP_TRAK' '0001',
        ' ' 'BDC_CURSOR' 'ZVSHIP_TRK_DATA-EOD_DATE(01)',
        ' ' 'BDC_OKCODE' '=NEWL'.
        PERFORM f_set_bdc_val
        USING :
        '1' 'SAPLZVSHIP_TRAK' '0002',
        ' ' 'BDC_CURSOR' 'ZVSHIP_TRK_DATA-TRACKN',
        ' ' 'ZVSHIP_TRK_DATA-TRACKN' wa_upload-field2,
        ' ' 'BDC_OKCODE' '/00'.
        PERFORM f_set_bdc_val
        USING :
        '1' 'SAPLZVSHIP_TRAK' '0002',
        ' ' 'ZVSHIP_TRK_DATA-EOD_DATE' loc_pickupdate,
        ' ' 'ZVSHIP_TRK_DATA-ACT_DATE' wa_upload-field25.
   IF NOT wa_upload-field15 IS INITIAL.
     PERFORM F_SET_BDC_VAL
     USING :
     ' '  'ZVSHIP_TRK_DATA-PKG_WGT' wa_upload-field15.  "Total Wt.
   ENDIF.
        PERFORM f_set_bdc_val
        USING :
        ' ' 'ZVSHIP_TRK_DATA-ACT_FRT' wa_upload-field20,"Total Net charges
        ' ' 'ZVSHIP_TRK_DATA-ACT_SURCH' wa_upload-field18,"Fuel surcharge
        ' ' 'ZVSHIP_TRK_DATA-ACT_ACC' wa_upload-field19,  "Accessorial ch.
        ' ' 'ZVSHIP_TRK_DATA-ACT_TOTAL' wa_upload-field16,"Gross Charges
        ' ' 'ZVSHIP_TRK_DATA-ACT_PER_LB' loc_charprice.  "Price/LB
   IF NOT wa_upload-field13 IS INITIAL.
     PERFORM F_SET_BDC_VAL
     USING :
     ' ' 'ZVSHIP_TRK_DATA-PKG_PAL' wa_upload-field13.  "Pallet count
   ENDIF.
   IF NOT wa_upload-field14 IS INITIAL.
     PERFORM F_SET_BDC_VAL
     USING :
     ' ' 'ZVSHIP_TRK_DATA-PKG_PCS' wa_upload-field14.  "Case count
   ENDIF.
        PERFORM f_set_bdc_val
        USING :
        ' ' 'BDC_OKCODE' '=SAVE'.
        PERFORM f_set_bdc_val
        USING :
        '1' 'SAPLZVSHIP_TRAK' '0002',
        ' ' 'BDC_OKCODE' '=UEBE'.
        PERFORM f_set_bdc_val
        USING :
        '1' 'SAPLZVSHIP_TRAK' '0001',
        ' ' 'BDC_OKCODE' '=BACK'.
call transaction ZVTRAFFICINPUT
        PERFORM f_call_zvtrafficinput.
      ENDIF.
    ENDIF.
  ENDLOOP.
ENDFORM.                    " f_upload_data
      FORM F_SET_BDC_VAL                                            *
-->  WG_DYNBEGIN                                                   *
-->  WF_FIELDNAME                                                  *
-->  WF_FIELDVAL                                                   *
FORM f_set_bdc_val  USING
      locf_dynbegin
      locf_fieldname
      locf_fieldval.
  CLEAR wa_bdcdata.
  IF locf_dynbegin = wl_1.                                  "'1'.
    wa_bdcdata-program = locf_fieldname.
    wa_bdcdata-dynpro = locf_fieldval.
    wa_bdcdata-dynbegin = wl_x. "'X'.
  ELSE.
    wa_bdcdata-fnam = locf_fieldname.
    wa_bdcdata-fval = locf_fieldval.
  ENDIF.
  APPEND wa_bdcdata TO int_bdcdata.
ENDFORM.                    "F_SET_BDC_VAL
*&      Form  F_CALL_ZVTRAFFICINPUT
      text
-->  p1        text
<--  p2        text
FORM f_call_zvtrafficinput .
  DATA: locf_last_rec TYPE sy-index,
        wf_msgstring(128)                TYPE c.
  DATA: loc_mode TYPE c.
  loc_mode = 'N'.      "+001 needs to be changed
  CALL TRANSACTION wl_tcode
    USING int_bdcdata
    MODE 'A'
    MODE wl_mode  "In Backgrnd(N)
      MODE loc_mode
    UPDATE wl_update              "(S)ynchr mode "+001
    MESSAGES INTO int_messages.
In case there are errors in call transaction
  IF sy-subrc <> 0.
    DESCRIBE TABLE int_messages LINES locf_last_rec.
    READ TABLE int_messages INTO wa_messages
          INDEX locf_last_rec.
    PERFORM f_fill_bdc_error USING wa_upload-field2 wf_msgstring.
  ELSE.
Keep count of successfully process records
    wf_recok = wf_recok + 1.
    PERFORM f_fill_bdc_success USING wa_upload-field2.
  ENDIF.
  REFRESH: int_bdcdata, int_messages.
ENDFORM.                    " F_CALL_ZVTRAFFICINPUT
*&      Form  f_fill_bdc_success
      text
     -->P_WA_UPLOAD_FIELD2  text
FORM f_fill_bdc_success  USING    p_wa_upload_field2.
  CONCATENATE wl_trackno p_wa_upload_field2 '- Entry added'
  INTO
  wa_error_data-errtext. "Success message
  APPEND wa_error_data TO int_error_data.
ENDFORM.                    " f_fill_bdc_success
*&      Form  f_fill_bdc_error
      text
     -->P_WA_UPLOAD_FIELD2  text
     -->P_WF_MSGSTRING  text
FORM f_fill_bdc_error  USING    p_wa_upload_field2
                                p_wf_msgstring.
  CONCATENATE wl_trackno p_wa_upload_field2
  '- Error : ' p_wf_msgstring
  INTO
  wa_error_data-errtext. "Error text of int_error_data
  APPEND wa_error_data TO int_error_data.
ENDFORM.                    " f_fill_bdc_error
*&      Form  f_display_report
      text
FORM f_display_report.
*+001 Begin:
  DATA: reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
        doc_chng LIKE sodocchgi1,
        objcont LIKE solisti1 OCCURS 0 WITH HEADER LINE.
  DATA: loc_recnt(4) TYPE c,
        loc_recok(4) TYPE c.
*+001 End:
    if sy-batch ne wl_x.  "+001
    ULINE /1(175).
    WRITE:/ 'Date/Time: '(006) COLOR COL_HEADING,
            sy-datum DD/MM/YYYY, '/',sy-uzeit,
            40 'Uploading of Carrier Information to ZVTRAFFIC'.
    ULINE /1(175).
    SKIP.
    WRITE:/ 'Following File Has Been Processed'.
         / pa_file.    "-001
    SKIP.
    WRITE:/ 'Number of records read:', wf_recnt.
    WRITE:/ 'Number of records processed successfully:', wf_recok.
    SKIP.
    LOOP AT int_error_data INTO wa_error_data.
      WRITE :/ wa_error_data-errtext.
    ENDLOOP.
*+001 Begin:
  ELSE.
   IMPORT wf_file FROM MEMORY ID wl_id.
    reclist-receiver = wl_adm.
    reclist-rec_type = wl_u.
    reclist-com_type = wl_int.
    APPEND reclist.
    doc_chng-obj_name = wl_urgent.
    doc_chng-obj_descr = wl_descr.
    CONCATENATE 'Date/Time: ' sy-datum '/' sy-uzeit
            'Uploading of Carrier Information to ZVTRAFFIC'
            INTO objcont SEPARATED BY space.
    APPEND objcont.
*-001
   CONCATENATE 'Following File Has Been Processed' pa_file
             INTO objcont SEPARATED BY space.
   APPEND objcont.
*-001
    loc_recnt = wf_recnt.
    CONCATENATE 'Number of records read:' loc_recnt
      INTO objcont SEPARATED BY space.
    APPEND objcont.
    loc_recok = wf_recok.
    CONCATENATE 'Number of records processed successfully:' loc_recok
      INTO objcont SEPARATED BY space.
    APPEND objcont.
    LOOP AT int_error_data INTO wa_error_data.
      MOVE wa_error_data-errtext TO objcont.
      APPEND objcont.
    ENDLOOP.
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
      EXPORTING
        document_type              = wl_raw
        document_data              = doc_chng
        put_in_outbox              = wl_x
        commit_work                = wl_x
      TABLES
        object_content             = objcont
        receivers                  = reclist
      EXCEPTIONS
        too_many_receivers         = 1
        document_not_sent          = 2
        operation_no_authorization = 4
        OTHERS                     = 99.
    IF sy-subrc EQ 0.
      MESSAGE s205. "email sent
    ELSE.
      MESSAGE i206. "email not sent
    ENDIF.
  ENDIF.
*+001 End:
ENDFORM.                    " f_display_report
*&      Form  f_background_job
      text
-->  p1        text
<--  p2        text
FORM f_background_job .
  DATA: loc_jobcount LIKE btch1150-jobcount.
  IF pa_backg = wl_x.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = wl_jobname
        jobclass         = 'A'
      IMPORTING
        jobcount         = loc_jobcount
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.
    IF sy-subrc <> 0.
      MESSAGE i000(zmmx) WITH 'JOB_OPEN failed.' 'sy-subrc =' sy-subrc.
      LEAVE LIST-PROCESSING.
    ENDIF.
    CALL FUNCTION 'JOB_SUBMIT'
         EXPORTING
           extpgm_param            = pa_file
              authcknam               = sy-uname
              jobcount                = loc_jobcount
              jobname                 = wl_jobname
              report                  = sy-repid
              variant                 = wl_variant
         EXCEPTIONS
              bad_priparams           = 1
              bad_xpgflags            = 2
              invalid_jobdata         = 3
              jobname_missing         = 4
              job_notex               = 5
              job_submit_failed       = 6
              lock_failed             = 7
              program_missing         = 8
              prog_abap_and_extpg_set = 9
              OTHERS                  = 10.
    IF sy-subrc <> 0.
      MESSAGE i000(zmmx) WITH 'JOB_SUMBMIT failed.' 'sy-subrc =' sy-subrc.
      LEAVE LIST-PROCESSING.
    ENDIF.
    CALL FUNCTION 'JOB_CLOSE'
      EXPORTING
        jobcount             = loc_jobcount
        jobname              = wl_jobname
        strtimmed            = 'X'
      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.
    IF sy-subrc <> 0.
      MESSAGE i000(zmmx) WITH 'JOB_CLOSE failed.' 'sy-subrc =' sy-subrc.
      LEAVE LIST-PROCESSING.
    ELSE.
      MESSAGE i000(zmmx) DISPLAY LIKE wl_i WITH 'Background job submitted'.
      LEAVE LIST-PROCESSING.
      wait up to 60 seconds.
      STOP.
    ENDIF.
  ENDIF.
ENDFORM.                    " f_background_job
*&      Form  f_get_server_file
      text
-->  p1        text
<--  p2        text
FORM f_get_server_file .
  CLEAR: wf_filename.
following function module display the list of application file and
directories in a pop up window
  CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
    IMPORTING
      serverfile       = wf_filename
    EXCEPTIONS
      canceled_by_user = 1
      OTHERS           = 2.
If the user press cancel button without selecting file name
then the file name will be initial and raise the error message
  IF wf_filename IS INITIAL.
    MESSAGE i000 WITH 'No File selected'(012).
    LEAVE LIST-PROCESSING.
  ENDIF.
  pa_sfile = wf_filename.
ENDFORM.                    " f_get_server_file
*&      Form  f_move_file_to_other_dir
      To move the
FORM f_move_file_to_other_dir  USING   locf_source_file
                                       locf_dest_file.
  CALL FUNCTION 'Z_FILE_HANDLING_UTILITY'
    EXPORTING
      action                    = wl_action  "VALUE 'mov'
      source_physical_file_name = locf_source_file
      dest_physical_file_name   = locf_dest_file
    EXCEPTIONS
      invalid_action            = 1
      invalid_file_type         = 2
      file_type_missing         = 3
      file_type_not_required    = 4
      source_file_missing       = 5
      source_filename_error     = 6
      destination_not_required  = 7
      destination_missing       = 8
      multiple_file_names       = 9
      file_deletion_error       = 10
      invalid_source_file       = 11
      file_read_error           = 12
      file_write_error          = 13
      file_rename_error         = 14
      file_move_error           = 15
      destination_file_exists   = 16
      OTHERS                    = 17.
  IF sy-subrc <> 0.
    MESSAGE i000(zmmx) WITH 'Error in Moving Process directory to completed Directory'(004).
   LEAVE LIST-PROCESSING.
  ENDIF.
ENDFORM.                    " f_move_file_to_other_dir
*&      Form  f_get_path
      text
-->  p1        text
<--  p2        text
FORM f_get_path .
  CALL FUNCTION 'RZL_READ_DIR_LOCAL'
    EXPORTING
      name           = wf_path
    TABLES
      file_tbl       = ifiles
    EXCEPTIONS
      argument_error = 1
      not_found      = 2
      OTHERS         = 3.
  DELETE ifiles WHERE name+0(1) = '.'.
  DELETE ifiles WHERE name+0(1) NE 'w'.
ENDFORM.                    " f_get_path
Regards,
Brahma Reddy

Similar Messages

  • Weird problem in open dataset

    Hi mate,
    I have strange problem with open dataset. I try to download data to server and hit by shortdump telling me that file is not yet opened. I have checked SY-SUBRC (equals zero) after statement open dataset.
    It just happened today, previously i never encounter these problem before.
    Can someone point out me what the problem is? is it because of some delay in opening dataset or system performance issue? Production is running pretty slow in peak hours around 10-13PM.
    Thanks for your input.
    alia

    Hi Alia,
    Please check SAP OSS Note <b>733626</b>. It seems you don't have enough space in application server when the system tries to generate the input file. Perhaps you may need to archive production files.
    <b>Symptom</b>
    Report RCCLBI03 classifies all objects that are contained in an input file. Incorrect records from the input file are written into an error file.
    The report generates a termination with error code DATASET_CANT_OPEN if an object must be really written into the error file.
    <b>Other terms</b>
    Classification, dump
    <b>Reason and Prerequisites</b>
    The check whether the error file can be opened is insufficient. In the standard case this is RCCLBI03.ERROR on the application server.
    <b>Solution</b>
    If the error file cannot be opened, the report now ends with error message LX105 ("Unable to open file &1"). Then the input file is no longer imported.
    Hoep this will help.
    Regards,
    Ferry Lianto

  • Problem in open dataset

    Hi Friends
    Earlier I used FTP option for picking and transferring files, now Instaed of FTP I am going with application server concept.
    while receving, there is no problem between two types.But while transfrring the XML file from SAP to application server it generated some error, the format is not correect like that.But if I pass the same value in foreground its working fine.
    here I am attaching the coding for application server and foreground method
    open dataset filename for output in binary mode.
    *open dataset filename for output in TEXT MODE Encoding UTF-8.
    loop at it_xml.
      transfer it_xml to filename.
    endloop.
      close dataset filename.
    foreground coding
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
        bin_filesize = l_xml_size
        filename     = 'C:\Delete_Parked_data.xml'
        filetype     = 'BIN'
      CHANGING
        data_tab     = l_xml_table
      EXCEPTIONS
        OTHERS       = 24.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    I dont know how to convert this binary file into xml format in Application server concept.
    please help me to resolve this.
    Thanks
    Gowrishankar

    HI,
        YOu can use CALL TRANSFORMATION for converting into XML format .
    CALL TRANSFORMATION id SOURCE root = lt_TABLE
                RESULT XML it_xml.
    Then call DATASET
    Regards,
    Seema

  • Problem using open dataset

    Hi All,
      I am trying to upload flat file data into appl server.but it is uploading some unwanted characters at the end.The code and data is given below.plz let me know the solution.
    DATA : file type rlgrap-filename.
    data : begin of itab occurs 0,
             rec(500) type c,
           end of itab.
    file = '/lz01/fin/in/bop_Checkrecon1.txt'.
    clear : itab.
    refresh : itab.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'C:\bop3.txt'
       FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = ' '
       HEADER_LENGTH                 = 0
       READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = itab
    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
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    open dataset file for input in text mode encoding default.
    clear itab.
    loop at itab.
       transfer itab-rec to file.
       clear itab.
    endloop.
    close dataset file.
    The exact structure and the data present in the flat file is as follows:
      078041953      0000000001000000052507       0000070000                   R   
      078041953      0000000003000000052507       0000199500                   R   
      078041953      0000000005000000052507       0000530000                   R   
      078041953      0000000007000000052507       0000005000                   R   
      078041953      0000000008000000052507       0000004000                   R   
      078041953      0001000000000000052507       0000058250                   R   
      029005582      0001000000000000052507       0000012300                   R   
      029005582      0001000001000000052507       0009438200                   R   
      030404975      0001000000000000052507       0000056700                   R   
      030404975      0001000001000000052507       0000004500                   R   
      314018577      0001000002000000052507       0000001500                   R   
      314018577      0001000003000000052507       0000435300                   R   
      314018577      0001000007000000052507       0000066600                   R   
    Thanks,
    Rakesh.

    Hello Rakesh
    If you display your flat file using an editor (like Notepad) then the file may look ok. However, there may be special characters at the end of every line that are not displayed.
    Use the following approach to analyze your flat file:
    (1) Start Microsoft Excel
    (2) Open your flat file from with Excel. Be careful to choose the right <b>Codepage</b> in the <i>Text Converter Assistent</i>. For example, located in Switzerland I would most like choose Codepage = Windows(ANSI) or  1250 Middle European (Windows)
    (3) Scroll to the end of lines and check if there are special characters
    Regards
      Uwe

  • File transfer Problem with open dataset

    I am transfering file in ECC6.0 unicode system to nonsap.In al11 transaction the file has the '#' symbol in the text field.But while downloading to local system to upload other legasy it is taking as Tab.so the file is corrupting.I have tried with field symbols also it is not working.Can any one help on this..
    Thanks in advance,
    Bhagya

    Hi Bhagya,
    in Unicode systems, AL11 expects files to contain data encoded in UTF-8 - hence if the file contains UTF-8, the transaction will work. In case of Non-Unicode, special characters will be displayed as '#'.
    One workaround could be  to convert the data to UTF-8 e.g. with tools described in 747615.
    Best regards,
    Nils Bürckel
    Solution Management
    Globalization Services
    SAP AG

  • OPEN DATASET - new line

    Hi Friends,
    I am facing a problem with OPEN DATASET to transfer data from XSTRING field to the text file.
    Then problem is like this I have a internal table type XSTRING. Which will have

    hi suresh,
    check this,
    data:
      begin of STRUC2,
        F1 type c,
        F2(20) type c,
      end of STRUC2.
    Put data into text format
    move-corresponding STRUC to STRUC2.
    Write data to file
    open dataset DSN in text mode for output encoding utf-8.
    transfer STRUC2 to DSN.
    close dataset DSN.
    Read data from file
    clear STRUC.
    open dataset DSN in text mode for input encoding utf-8.
    read dataset DSN into STRUC2.
    close dataset DSN.
    move-corresponding STRUC2 to STRUC.
    write: / STRUC-F1, STRUC-F2.
    The textual storage in UTF-8 format ensures that the created files are platform-independent.
    Case 2: Old non-Unicode format must be retained
    Write data to file
    open dataset DSN in legacy text mode for output.
    transfer STRUC to DSN.
    close dataset DSN.
    read from file
    clear STRUC.
    open dataset DSN in legacy text mode for input.
    read dataset DSN into STRUC.
    close dataset DSN.
    write: / STRUC-F1, STRUC-F2.

  • OPEN Dataset - Peculiar problem

    Hello experts!
    I am facing a peculiar problem with ABAP keyword OPEN DATASET.
    I have a directory to which I am adding new files using OPEN DATASET FOR OUTPUT.. this works perfectly fine in the Consolidation system. But the same thing does'nt work in the Production system! It return SY-SUBRC = 8
    After reading several other posts on SDN and other forums, the following causes were touted.
    1) Path incorrect 
    2) No Authorization
    But upon checking, neither of the wo are possible because the path is maintained properly and the authorizations at OS level are given (R/W) to this folder. Moreover, the user has S_DATASET auth object!!
    Then I read somewhere else that having multiple Application Servers could be a possible cause and that running the code as a background job would be afix.. Is it so?
    Even if it is, the application is in ABAP Web Dynpro and is launched from the portal.. hence launching it as a background job is not an option... Any solutions?????
    Any help on this would be appreciated...
    Thanks in advance, Amith

    Hi,
    Yes this is true that if we are having the multiple application server then this kind of error occures if your specified directory is not mapped on the alll the avaiable sAP application servers.
    I guess when ever you are running your application then system will pick the appkication server based on the present load. Hence if your directory is not mapped in that application server then you wil get this kind of issues,
    so i guess check with you basis team that spctified path is avaiable in all the application server.

  • Ole objects,background and open dataset

    Hi,
    I want to read ms access files on background using ole objects. Is it possible to apply open dataset operation for mdb files? As known, text files can be get into application server using open dataset. But I need to get mdb file to application server.
    On the other way I can simulate my problem as, is it possible to read excel files(for example) using <b>ole object</b> in background? If I can get an aswer, maybe I can simulate it as reading mdb files.
    Thanks.

    OPEN DATASET is meant for the flat text files, you won't be able to open an mdb file with it. Once I've tried using OLE objects to obtain the file modification date and, even though it worked great in foreground, it didn't work in the background mode.
    This thread on reading MS Access files in SAP might be helpful:
    Re: download table from ms-access

  • Open dataset is not working in background in PRD

    Dear All,
    Open dataset is not working in background in PRD .
    OPEN DATASET filepath FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    Whike running in foregroundits working dev as well as prd.
    but when i am running in background  its giving error like file not found .
    but al11 is working (i mean my file path is working ).
    Thanks N Regards,
    Srinivasa Reddy

    your authority team shall check the batch user of that abap!
    Could you please tell us the detailed error message?
    grx
    Andreas

  • Problem writing file ANSI to UTF-8. OPEN DATASET FOR OUTPUT IN TEXT MODE

    Hello everybody,
    My report needs  to create a file in ANSI so I am using this sentence: * "OPEN DATASET p_dir_a FOR OUTPUT IN TEXT MODE ENCODING DEFAULT."*  almost all charters in the file are well generating excepting for this two: ( Á ) & ( Í ) because SAP assigns the same code to both characters ( Ã? ) = 'xC3'  which is not correct, the right code should be ( Á ) = 'xC1'  ( Í ) = 'xCD' respectively
    from this string = ( ÁÉÍÓÚáéíóúàèìòùÀÈÌÒÙ ) only those two characters are wrong converted.
    Also I tray to catch a conversion error with this sentence:
              TRY.
                TRANSFER <field> TO p_dir_a NO END OF LINE.
              CATCH cx_sy_conversion_codepage.
                MESSAGE 'error' type 'I'.
            ENDTRY.
    but never enters in it.
    Does anyone know where I can configure SAP to SET this value correctly?
    Thanks for your help.

    was a server problem, not SAP

  • Open dataset in UTF8. Problems between Unicode and non Unicode

    Hello,
    I am currently testing the file transfer between unicode an non unicode systems.
    I transfered some japanese KNA1 data from non unicode system (Mandt,Name1, Name2,City) to a file with this option:
    set local language pi_langu.
      open dataset pe_file in text mode encoding utf-8 for output with byte-order mark.
    Now I want to read the file from a unicode system. The code looks like this:
    open dataset file in text mode encoding utf-8 for input skipping byte-order mark.
    The characters look fine but they are shifted. name1 is correct but now parts of the city characters are in name2....
    If I open the file in a non unicode system with the same coding the data is ok again!
    Is there a problem with spaces between unicode an non-unicode?!

    Hello again,
    after implementing and testing this method, we saw that the conversion is always taken place in the unicode system.
    For examble: we have a char(35) field in mdmp with several japanese signs..as soon as we transfer the data into the file and have a look at it the binary data the field is only 28 chars long. several spaces are missing...now if we open the file in our unicode system using the mentioned class the size is gaining to 35 characters
    on the other hand if we export data from unicode system using this method the size is shrinking from 35 chars to 28 so the mdmp system can interprete the data.
    as soon as all systems are on unicode this method is obselete/wrong because we don't want to cut off/add the spaces..it's not needed anymore..
    the better way would be to create a "real" UTF-8 file in our MDMP system. The question is, is there a method to add somehow the missing spaces in the mdmp system?
    so it works something like thtat:
          OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING UTF-8 WITH BYTE-ORDER MARK.
    "MDMP (with ECC 6.0 by the way)
    if charsize = 1.
    *add missing spaces to the structure
    *transfer strucutre to file
    *UNICODE
    else.
    *just transfer struc to file -> no conversion needed anymore
    endif.
    I thought mybe somehow this could work with the class CL_ABAP_CONV_OUT_CE. But until now I had no luck...
    Normally I would think that if I'am creating a UTF-8 file this work is done automatically on the transfer command

  • OPEN DATASET not working in background

    Hi all,
               I have created a file succesfully in app server ,which I try to read later through a backgroung job using statement
    OPEN DATASET w_infile FOR INPUT IN TEXT MODE ENCODING DEFAULT  IGNORING CONVERSION ERRORS.
              But I am getting OS(UNIX) level error message "No such file or directory" When I try to run the program in foreground it works perfectly.
             Please help.

    >            I have created a file succesfully in app server ,which I try to read later through a backgroung job using statement
    >  OPEN DATASET w_infile FOR INPUT IN TEXT MODE ENCODING DEFAULT  IGNORING CONVERSION ERRORS.
    >           But I am getting OS(UNIX) level error message "No such file or directory" When I try to run the program in foreground it works perfectly.
    Are your background processes running on the same server as you're logged on?
    Markus

  • Problem in file format OPEN DATASET

    Hi all,
       i am upgrading the systemm 4.7 to ECC6.0
      In one of the programs OPEN dataset statement is being used to download the file to unix server, but when i run the same program in ECC6.0 version an try to opn in notepad the same file it is coming in single line (i.e end of line delimiter is being ignored.)
    Hence I tried using WITH WINDOWS LINEFEED addition
    it is displayed correctlyin notepad but when i see thru
    transaction AL11 character'#' is displayed after every end of line also when i take a printout now one extra new line is added
    the delimiter which i have used here is
    C type c value CL_ABAP_CHAR_UTILITIES=>CR_LF
    Can anyone suggest a better method to solve the problem?

    DATA L_MSG1 TYPE STRING.
    CONSTANTS: C_TAB1 TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
    *-- Open Dataset
        OPEN DATASET p_aosvr FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc EQ 0.
          DO.
    *-- Read Dataset and Populate Input file data to Internal Table
            READ DATASET unix_filename INTO L_MSG1.
            IF sy-subrc EQ 0.
              SPLIT L_MSG1 AT C_TAB1 INTO it_final-field1
                        it_final-field2
                        it_final-field3
                        it_final-field4
                        it_final-filed5.
              APPEND it_final.
              CLEAR  it_final.
            ELSE.
              EXIT.
            ENDIF.
          ENDDO.
        ELSE.
          MESSAGE e000 WITH 'Error while uploading data'(013).
        ENDIF.
    *-- Close Dataset
        CLOSE DATASET p_aosvr.

  • After updating my iphone3gs and ipod touch 4g to ios 6, the auto lock fuction doesn't work always , especially if passbook is left open in the background! i have also restored both the devices but the problem still persists and is affecting the battery li

    After updating my iphone3gs and ipod touch 4g to ios 6, the auto lock fuction doesn't work always , especially if passbook is left open in the background!
    i have also restored both the devices but the problem still persists and is affecting the battery life!

    Same problem here, after istalling ios 6 on my iphone 4s my auto lock didnt work, but when i closed my assistive touch it worked again..I didnt have this problem in the 5.1.1 version. I dont wanna close the assistive touch tough....annoying problem !!!
    Another problem occured in the settings of alarm clock. The sensivity of the on-off button is not as good as in the 5.1.1 version...
    Hope they will fix this problem soon !!!
    Is there anyone else who hava the same problems??
    Best regards...

  • File transfer Open dataset CSV file Problem

    Hi Experts,
    I have an issue in transferring Korean characters to a .CSV file using open dataset.
    data : c_file(200) TYPE c value '
    INTERFACES\In\test8.CSV'.
    I have tried
    open dataset  c_file for output LEGACY TEXT MODE CODE PAGE '4103'.
    open dataset  c_file for output    in TEXT MODE ENCODING NON-UNICODE.
    open dataset  c_file for output    in TEXT MODE ENCODING Default.
    Nothing is working.
    But to download to the presentation server the below code is working. How can the same be achieved for uploading the file to application server.
    CALL METHOD cl_gui_frontend_services=>gui_download
          EXPORTING
            filename                = 'D:/test123.xls'
            filetype                = 'ASC'
            write_field_separator   = 'X'
            dat_mode                = 'X'
            codepage                = '4103'
            write_bom               = 'X'
          CHANGING
            data_tab                = t_tab
          EXCEPTIONS
            file_write_error        = 1
            no_batch                = 2
            gui_refuse_filetransfer = 3
            invalid_type            = 4
            no_authority            = 5
            unknown_error           = 6
            header_not_allowed      = 7
            separator_not_allowed   = 8
            filesize_not_allowed    = 9
            header_too_long         = 10
            dp_error_create         = 11
            dp_error_send           = 12
            dp_error_write          = 13
            unknown_dp_error        = 14
            access_denied           = 15
            dp_out_of_memory        = 16
            disk_full               = 17
            dp_timeout              = 18
            file_not_found          = 19
            dataprovider_exception  = 20
            control_flush_error     = 21
            not_supported_by_gui    = 22
            error_no_gui            = 23
            OTHERS                  = 24.

    Hi,
    I would recommend to use OPEN DATASET ... ENCODING UTF-8 ...
    If your excel version is unable to open this format, you can convert from 4110 to 4103 with report RSCP_CONVERT_FILE.
    Please also have a look at
    File upload: Special character
    Best regards,
    Nils Buerckel

Maybe you are looking for

  • Looking for a Programmer to Create An Acrobat Pro "Embed" Plug In

    Hello everyone, I am Looking  for a Programmer to Create An Acrobat Pro "Embed" Plug In. The purpose of this is to be able to easily embed YouTube  Video's within Acrobat documents so that It can stream the content into  the PDF file. Many  have sugg

  • Safari crashes when I try to print

    Every time time I try to print, Safari shuts down. For example, when I select File/Print, Safari shuts down completely. Any suggestions? Thanks.

  • Suppress the Page Header section on a specific Section

    Hello, I have a single page word document I want to append to the end of a report I have, so I placed it in Report Footer b. The word document fits perfectly on a single page without any header. I tried simply supressing the Page Header on the last p

  • Need reimbursement for game not working

    on the email receipt i clicked report a problem which gets me to the apple website but then where do i go from there? I reported a game proble to the  vendor who after saying that there was no fix, offered to reimbursement me. thanks for you help

  • Executing code from a Bean only once when page loads

    Hi all, I have a method in a BackingBean which access UI Bindings from my fragment: xxx.jsff. So that method has to be invoked from a inside that fragment since access Bindings from xxxPageDef.xml I need to execute that code one and only one time whe