Files on application server problem.

Hi Gurus,
I am facing a problem in creadting dataset whose details is as below.
Dataset path:
idir = '/usr/DEV/local/tmp/200/brcd/idir/odr00023.txt'.
OPEN DATASET idir FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
This command is giving sy-subrc = 8.
because of this file is not opening in write mode but available for reading.
What may be the problem.
right solution will be awarded with points.
Regards
Rajesh

Hi,
that means u r unable to write in application server the path u mentioned...try with other path and see....
basically the below code is used ,whcih u have done.plz have a look ..Try with other path and see if it is working for u..
  Download internal table to Application server file(Unix)
DATA: e_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.
  open dataset e_file for output in text mode.
  lOOP AT it_datatab......
    transfer it_datatab to e_file.
  ENDLOOP.
  close dataset e_file
Regards,
Nagaraj

Similar Messages

  • Problem in uploading file from Application Server

    Hi everyone,
    i got a problem in uplaoding a file from application server.i am having two folder (one folder name is current and another one is processed)in application server. In current folder i am having N no of files.I want to upload all the files names into one internal table and i want to process one by one file.After processing each file the file should be moved to processed folder and the files should not exist in current folder.All these process must be done everyday.Please rectify my problem asap.

    Ramesh,
    Take authorization from basis guy.
    Use the below code to get the list of files from require directory
    *& Report  ZDIRFILES                                                   *
    REPORT  ZDIRFILES    .
    PARAMETER: p_fdir            type pfeflnamel DEFAULT '/usr/sap/tmp'.
    data: begin of it_filedir occurs 10.
            include structure salfldir.
    data: end of it_filedir.
    *START-OF-SELECTION
    START-OF-SELECTION.
    Get Current Directory Listing for OUT Dir
      call function 'RZL_READ_DIR_LOCAL'
           exporting
                name     = p_fdir
           tables
                file_tbl = it_filedir.
    Now in internal table "it_filedir"  will have all your files.
    For moving and deleting
    report zrich_0001.
    Parameters: d1 type localfile default '/usr/sap/TST/SYS/fld1/Data1.txt',
                d2 type localfile default '/usr/sap/TST/SYS/fld2/Data1.txt'.
    data: begin of itab occurs 0,
          rec(20) type c,
          end of itab.
    data: wa(20) type c.
    start-of-selection.
      open dataset d1 for input in text mode.
      if sy-subrc = 0.
        do.
          read dataset d1 into wa.
          if sy-subrc <> 0.
            exit.
          endif.
          itab-rec = wa.
          append itab.
        enddo.
      endif.
      close dataset d1.
      open dataset d2 for output in text mode.
      loop at itab.
        transfer itab to d2.
      endloop.
      close dataset d2.
      delete dataset d1.
    Check below FM if required
    To move the file to archive directoryuse FMs 'PFL_COPY_OS_FILE'
    To Delete 'EPS_DELETE_FILE'.
    Don't forgot to reward if useful

  • Problem  in reading file from application server

    while reading the file from application server i am succesful in reading from dataset but the program gets terminated giving a runtime error "CONVT_CODEPAGE".
    the code written is as below :
    open dataset d1 for input in text mode encoding default.
    IF sy-subrc NE 0.
    EXIT.
    ENDIF.
    do.
                    Read dataset d1 into btab.
         if sy-subrc <> 0.
         exit.
                   else.
                   condense btab NO-GAPS.
                   wtt_text-text1 = btab-wa+0(10).
                   wtt_text-text2 = btab-wa+10(1).
                   wtt_text-text3 = btab-wa+11(3).
                  append wtt_text.
                  clear wtt_text.
                  wt_counter = wt_counter + 1.
                  ENDIF.
    enddo.
    write : /10 ' number of records :'.
    write :  wt_counter.
    kindly help me asap.
    regards,
    rachu.

    If I am not wrong you are working on a Unicode enabled system. That is why this error is coming.
    Look at the link below, where the solution is provided.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/79/c554dcb3dc11d5993800508b6b8b11/content.htm
    open dataset DSN in text mode for output encoding utf-8.
    Regards,
    Ravi
    Note - Please close the thread by selecting PROBLEM SOLVED against the answer which helped your most, if the issue is resolved.

  • Problem of Delete and Overwrite XLS file on Application Server

    Hi Experts,
         I want to transfer file on application server using below code and try to delete after successfully transfer on application file to other location.
    I have problem during deleting file and overwrite file.
    DATA: G_S_FILE TYPE EPSFILNAM,
          G_S_DIR  TYPE EPSDIRNAM,
          G_T_FILE TYPE EPSFILNAM,
          G_T_DIR  TYPE EPSDIRNAM.
    DATA : DELFILE(60).
      G_S_FILE = '1400000051.XLS'.
      G_S_DIR  = '\\Dev\PO\'.
      G_T_FILE = '1400000051.XLS'.
      G_T_DIR  = '\\Dev\PO\bkup'.
      DELFILE = '\\Dev\PO\1400000051.XLS'.
      CALL METHOD CL_CTS_LANGUAGE_FILE_IO=>COPY_FILES_LOCAL
        EXPORTING
          IM_SOURCE_FILE           = G_S_FILE
          IM_SOURCE_DIRECTORY      = G_S_DIR
          IM_TARGET_FILE           = G_T_FILE
          IM_TARGET_DIRECTORY      = G_T_DIR
          IM_OVERWRITE_MODE        = 'S'
        EXCEPTIONS
          OPEN_INPUT_FILE_FAILED   = 1
          OPEN_OUTPUT_FILE_FAILED  = 2
          WRITE_BLOCK_FAILED       = 3
          READ_BLOCK_FAILED        = 4
          CLOSE_OUTPUT_FILE_FAILED = 5
          OTHERS                   = 6.
      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 DELFILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF SY-SUBRC = 0.
        DELETE DATASET DELFILE.
      ELSE.
        WRITE / 'File not found'.
      ENDIF.
    Thanks,
    Himanshu Patel.

    Write a Java program using Apache POI that reads in a tab delimited file and outputs an xls file (in what they call Horrible Spread Sheet Format. Create your tab delimited file and then run your Java program using appropriate OS commands.
    Jelena Perfiljeva wrote:
    In all honesty, I find it hard to believe other application can't accept any other format. It's actually seems rather unreasonable to expect an ERP system to create a file in an outdated format of a desktop software. Even Excel itself can open many formats, so this just doesn't make any sense.
    This.
    Unless you can explain exactly why the destination must be xls and no other format is acceptable, I'm going to close the thread. What is this third party tool? Why can it only read the obsolete xls file format.
    I'm going through this thread and rejecting all the responses that attempt a solution that isn't xls.
    I'm surprised that the OP thought that simply saving with an xls file extension would cause some magic to happen and produce an actual Excel file.

  • Problem while dowloading the file from Application Server

    Dear Experts,
                 I am facing the Problem while downloading the file from Application server.
    We done the automatic function while saving the invoice, this will create an idoc, and this idoc is written in the Application Server.
    I am running the Transaction AL11 and select the record, and from menu --> List, i am downloading into TXT format.
    But for some segments, the length is long, and so the last 3 to 4 fields values are not appearing in the File. Even though i am unable to view the values in the file before downloading. But i can view in IDOC.
    Please help me to solve this issue.
    Thanks & Regards,
    Srini

    but our user will use the Txn. AL11 and they will download from there
    Educate the user On a serious note, tell him this is not how data from app server should be downloaded. You can ask him to talk to the basis team to provide him access to the app server folder where the file is being stored.
    I can set the Variant and put this in background, But always the file name will be change, Like we use Time stamp in the File name.
    You can't automate this process by scheduling in BG mode. This is because the in BG mode you can't dwld the file to presentation server.
    Hope i'm clear.
    BR,
    Suhas

  • Japanese character problem while downloading file to application server

    Hello All,
    We are facing a strange problem while downloading a file to application server when file contains japanese text.
    We are downloading vendor and customer information in a flat file format on application server. When the login language is EN program show ouput in a properly formatted manner.
    When the login language is JA (japanese) program does download file with customer vendor data. I can see the description is japanese language but the formatting is gone for a toss.
    We are facing similar issue with other programs downloading files on the application server.
    I am using OPEN DATASET........ENCODING DEFAULT. and working on unicode enabaled ECC 6.0 system
    Quick help appriciated.
    Thanks!

    Hi
    Sometimes this also happens because of your desktop setting.Make sure that your OS also supports the JAPANESSE language.
    Ask your technical support team to enable them in your desktop.
    Thanks & Regards
    Jyo

  • Problem during retriving file from application Server

    Hi all,
    i am trying to upload a world file (from desktop ) on application server and
    retrieve it back on local desktop.
    during retrieval of file from application server i am getting all the data in encoded format .
    i am using -
    open DATASET p_fpath for output in text mode encoding UTF-8 WITH SMART LINEFEED.
    plz help.

    Hi,
    use the tcodes CG3Y and
    CG3Z
    Or
    try with this command
    open DATASET p_fpath for output in text mode encoding default.
    Regards,
    nagaraj

  • Problem while uploading file from application server to internal tab in BG

    Hi all,
    When i see the file  in application server.data is like this
    #################00\);_(#####}#-#}###############################00\);_(#####}#-#}###############################00\);_(*#####}#-#}#########
    ###################}###}#############A#############???#00\);_(*#################;_(@_)  ########???#        ########???#        ########???###
    #######???#########}###}#############)##############}##00\);_(*#################;_(@_)  ############        ############        ##############
    ###################}#A#}#############:##############}##00\);_(#################;_(@_)  }###}##############################00\);_(*##########
    #######???#########}#-#}#############F#################00\);_(#####}###}#############@#################00\);_(#################;_(@_)  #####
    ###################}#-#}#############3#################00\);_(#####}#U#}#############E#################00\);_(#################;_(@_)  #####
    Because the csv which is uploaded has dropdowns and some formattings.
    when download from tcode cg3y i am getting correct file
    When try to use open(binary mode) and read dataset i getting data as it is (junk).
    i need to process in background.
    Any help.
    Rhea.

    upload file to string format
    begin of ty_tab,
    string type char200,
    end of ty_tab.
    loop at ty_tab into string
    use statement replace string into tab deliminated fromat(particular occurance in string)
    now call class to break string at tab into fields
    endloop.
    DATA : BEGIN OF i_data OCCURS 0,
            data(200)    TYPE c,       "To hold Upload file data
           END OF i_data.
    OPEN DATASET v_str FOR INPUT
                              IN TEXT MODE
                              ENCODING DEFAULT IGNORING CONVERSION ERRORS.
        IF sy-subrc EQ 0.
          DO.
    *Read a line from input file
            READ DATASET v_str INTO i_data-data.
            IF sy-subrc NE 0.
              EXIT.
            ENDIF.
    *Append record to an internal table
            APPEND i_data.
            CLEAR: i_data.
          ENDDO.
    *Close the file
          CLOSE DATASET v_str.
    *---Start of inserti
    LOOP AT i_data.
            REPLACE ALL OCCURRENCES OF '"' IN i_data WITH '#'.
            SPLIT i_data AT cl_abap_char_utilities=>horizontal_tab
                                INTO i_doc-pvaudt
                                     i_doc-pvpate
                                     i_doc-vecatc
                                     i_doc-vhvend
                                     i_doc-vhidt8
                                     i_doc-vhinvn
                                     i_doc-vhhexp
                                     i_doc-vhiref.

  • Problem with saving data in text file in Application server

    Hello Experts,
    I am trying to save a text file in application server.When I text file have less that 60000 (i.e 59999) records, it saves the file successfully, but if records in text file (saved in application server) is more than 60000 (i.e 60002), it creates a new file at the 60000th record with the continued records.
    Can anyone please advise, why it is creating a new file if records are more that 60000. I tested it with 59000 records in my internal table and it is working fine. I have not given any restriction in my program to create a new file if records are more than 60000.
    The logic I implemented is the following:
    *Open file
      open dataset g_accnt_file for output in text mode encoding utf-8.
      if sy-subrc = 0.
        clear g_header_record.
    *Building header record for Accounting Validation file
        concatenate gc_hdr_desc
                    gc_filetype
                    gc_sequence
                    gc_idntf_refresh
                    gc_cmpny_idntf
                    gc_accnt_id
                    sy-datum
                    sy-uzeit
                    gc_linde_group
                    sy-sysid
                    gc_not_used into g_header_record separated by
                                               gc_deliminator.
        transfer g_header_record to g_accnt_file.
    *Move Cost center data to file to create a detail record for Accounting
    *Validation file
        loop at gt_csks into gs_csks.
    *Remove leading Zeros
          call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
            exporting
              input  = gs_csks-kostl
            importing
              output = gs_csks-kostl.
    *      Overlay gs_csks-kostl with space.
    *      SHIFT gs_csks-kostl RIGHT DELETING TRAILING gc_space.
    *Prepare Cost Centre String
          perform prepare_costcentre_string.
    *Prepare detail record with Company Code & Cost Centre
          perform prepare_detail_record.
          clear:g_detail_record,gs_csks,g_coa.
        endloop.
    *Move Order data to file to create a detail record for Accounting
    *Validation file
        loop at gt_aufk into gs_aufk.
    *Remove leading Zeros
          call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
            exporting
              input  = gs_aufk-aufnr
            importing
              output = gs_aufk-aufnr.
    *      SHIFT gs_aufk-aufnr RIGHT DELETING TRAILING gc_space.
    *Prepare Order String
          perform prepare_order_string.
    *Prepare detail record with Company Code & Order
          perform prepare_detail_record.
          clear:g_detail_record,gs_aufk,g_coa.
        endloop.
    *Move WBS data to file to create a detail record for Accounting
    *Validation file
        loop at gt_prps into gs_prps.
          call function 'CONVERSION_EXIT_ABPSP_OUTPUT'
            exporting
              input  = gs_prps-pspnr
            importing
              output = g_wbs_element.
    *      SHIFT g_wbs_element RIGHT DELETING TRAILING gc_space.
    *Prepare WBS Element String
          perform prepare_wbs_string.
    *Prepare detail record with Company Code & WBS Element
          perform prepare_detail_record.
          clear:g_detail_record,gs_prps,g_coa.
        endloop.
    *Building trailer record for Accounting Validation file which will
    *contain the total number of detail records in file
        concatenate gc_trail_desc
                    g_total_count
                    into g_trailer_record
                    separated by gc_deliminator.
        transfer g_trailer_record to g_accnt_file.
    *Close file
        close dataset g_accnt_file.
        if sy-subrc = 0.
          message s036(/lig/fi).
        endif.
      endif.
    endform.                    " SELECT_DATA
    Edited by: Matt on Sep 30, 2010 11:02 AM - added   tags

    Hi Pankaj,
    Can u check the concatenate statement with one more data. Check the no of lines for a single file.
        concatenate gc_hdr_desc
                    gc_filetype
                    gc_sequence
                    gc_idntf_refresh
                    gc_cmpny_idntf
                    gc_accnt_id
                    sy-datum
                    sy-uzeit
                    gc_linde_group
                    sy-sysid
                    sy-subrc
                    gc_not_used into g_header_record separated by
                                               gc_deliminator.
    Regards,
    Amitava

  • Problem opening file in application server received by FTP.

    Hi,
    I am using FTP_COPY to receive file in application server.
    I am receiving file from FTP but I am unable to open them because the mode was set as 640 as in attributes.
    Could you please help me in how to receive in readable format...
    Any suggestions to use FTP commands?
    Thanks in advance.

    If you do not have authorizations to open the file its easy: there is nothing you can do except contact the ftp admin.

  • Problem in French translation while writing a file on application server

    I am writing some text symbols to a file on application server using Transfer statement. But for some french characters the data is not transleted correctly. I have maintained the french translation for these text symbols.

    Hi,
    Make sure you use the correct encoding while writing your file.
    Regards.

  • How to upload a file in application server to an internal table

    Hi,
          I am asked to upload a file from application server to internal table. Can you please suggest me the ways to do it or the function module which helps to browse the application server file names.
      I have done a program. But its giving problem in searching the files from application server. I am pasting my code for ur review. Please tell me which part i have to correct or suggest me some other ways to do it.
    *& Report  ZUPLOAD1
    REPORT  ZUPLOAD1.
    type-pools: truxs.
    parameters: p_upl_ps radiobutton group g1 default 'X', "upload from pres. server
                 p_path type rlgrap-filename, 
                 p_upl_as radiobutton group g1,   "upload from appln server
                 <b>p_dir LIKE filepath-pathintern DEFAULT 'Y_ABAP', 
                 p_file LIKE filepath-pathintern lower case,</b>      
                 p_test as checkbox.
    constants: c_x value 'X',
               c_tab type c value cl_abap_char_utilities=>horizontal_tab.
    types: ty_data(1000) type c.    "structure to hold legacy data
    data: i_data type standard table of ty_data. "internal table of ty_data
    types: begin of stritab,
          land1 type v_t604-land1,  "structure of legacy file.
          stawn type v_t604-stawn,
          bemeh type v_t604-bemeh,
          impma type v_t604-impma,
          minol type v_t604-minol,
          end of stritab.
    data: gi_itab type standard table of stritab, "internal table of legacy file
          gw_itab type stritab.  "work area
    data: i_raw type truxs_t_text_data,
          v_fullpath type string.
    at selection-screen on value-request for p_path.
    if p_upl_ps = c_x. "if presentation server is selected
    perform get_file.
    else.            "if application server is selected
    perform set_file_path.      
    perform upload_from_server.
    perform split_data.
    endif.
    form get_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      PROGRAM_NAME        = SYST-CPROG
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
    IMPORTING
       FILE_NAME           = p_path.     "getting the file name of pres server
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
      I_FIELD_SEPERATOR          =
        I_LINE_HEADER              = 'X'              "converting excel to sap and filling in
        I_TAB_RAW_DATA             = i_raw      "internal table
        I_FILENAME                 = p_path
      TABLES
        I_TAB_CONVERTED_DATA       = gi_itab
    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.
    endform.
    form set_file_path.                 "Getting the file path of application server
    data: lv_file type p_file.
          lv_file = p_file.
          CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
            EXPORTING
            CLIENT                           = SY-MANDT
              LOGICAL_PATH                     = p_dir
            OPERATING_SYSTEM                 = SY-OPSYS
            PARAMETER_1                      = ' '
            PARAMETER_2                      = ' '
            PARAMETER_3                      = ' '
            USE_BUFFER                       = ' '
              FILE_NAME                        = lv_file
            USE_PRESENTATION_SERVER          = ' '
            ELEMINATE_BLANKS                 = 'X'
           IMPORTING
             FILE_NAME_WITH_PATH              = v_fullpath
           EXCEPTIONS
             PATH_NOT_FOUND                   = 1
             MISSING_PARAMETER                = 2
             OPERATING_SYSTEM_NOT_FOUND       = 3
             FILE_SYSTEM_NOT_FOUND            = 4
             OTHERS                           = 5
          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 upload_from_server.
    data: lv_msg type string,
          lw_data type ty_data.
    open dataset v_fullpath for input message lv_msg in text mode encoding default.
    if sy-subrc <> 0.
    message lv_msg type 'i'.
    stop.
    endif.
    do.
    read dataset v_fullpath into lw_data.
    if sy-subrc <> 0.
    write:/5 'Error in processign data set'.
    exit.
    endif.
    append lw_data to i_data.
    enddo.
    close dataset v_fullpath.
    if sy-subrc <> 0.
    write: /5 'Error closing dataset'.
    endif.
    endform.
    form split_data.
    data: lw_data type ty_data.
    data: lw_itab type stritab.
    data: begin of ty_itab,
          land1 type v_t604-land1,
          stawn type v_t604-stawn,
          bemeh type v_t604-bemeh,
          impma type v_t604-impma,
          minol type v_t604-minol,
          end of ty_itab.
    loop at i_data into lw_data.
    split lw_data at c_tab into
          ty_itab-land1
          ty_itab-stawn
          ty_itab-bemeh
          ty_itab-impma
          ty_itab-minol.
    lw_itab-land1 = ty_itab-land1.
    lw_itab-stawn = ty_itab-stawn.
    lw_itab-bemeh = ty_itab-bemeh.
    lw_itab-impma = ty_itab-impma.
    lw_itab-minol = ty_itab-minol.
    append lw_itab to gi_itab.
    endloop.
    endform.
    start-of-selection.
    loop at gi_itab into gw_itab.
    write: /5 'COUNTRY', 'IMPORT CODE', 'SUP UNIT', 'FIRST UOM', 'SECOND UOM',
           /5 gw_itab-land1, gw_itab-stawn,gw_itab-bemeh,gw_itab-impma,gw_itab-minol.
    endloop.
    end-of-selection.
    I hope problem must be in p_dir and p_file which are in bold.. Kindly help me out. Thanks in advance.

    see the following ex:
    *&      Form  SUB_GET_FILEPATH
          text
    -->  p1        text
    <--  p2        text
    FORM SUB_GET_FILEPATH .
        GFILE = 'D:\SAP_INT\INBOUND\INBOX'.  "Path
    ENDFORM.                    " SUB_GET_FILEPATH
    *&      Form  SUB_GET_FILE
          text
    -->  p1        text
    <--  p2        text
    FORM SUB_GET_FILE .
      DATA: P_FDIR(200) TYPE C.
      DATA: IT_FILEDIR1 TYPE STANDARD TABLE OF TY_FILEDIR WITH HEADER LINE.
      P_FDIR = GFILE.
      CALL FUNCTION 'RZL_READ_DIR_LOCAL'
        EXPORTING
          NAME     = P_FDIR
        TABLES
          FILE_TBL = IT_FILEDIR.
      REFRESH : IT_FILEDIR1.
      LOOP AT IT_FILEDIR.
        IF IT_FILEDIR-NAME(4) = 'ZINC' OR IT_FILEDIR-NAME(4) = 'zinc'.
          MOVE IT_FILEDIR-NAME TO IT_FILEDIR1-NAME.
          APPEND IT_FILEDIR1.
        ENDIF.
      ENDLOOP.
      IF IT_FILEDIR1[] IS INITIAL.
        STOP.
      ENDIF.
      LOOP AT IT_FILEDIR1.
        REFRESH: I_TAB.
        CLEAR: I_TAB.
        NAME = IT_FILEDIR1-NAME.
        CONCATENATE: GFILE '\' NAME INTO G_FILE.
        OPEN DATASET G_FILE FOR INPUT IN TEXT MODE
                                         ENCODING DEFAULT
                                         IGNORING CONVERSION ERRORS.
        IF SY-SUBRC EQ 0.
          CONCATENATE 'FILENAME  : ' G_FILE INTO I_MSG1.
          APPEND I_MSG1.
          DO.
            READ DATASET G_FILE INTO RECORD.
            IF SY-SUBRC = 0.
              SPLIT RECORD AT ',' INTO I_TAB-BUKRS  I_TAB-EBELN
                  I_TAB-BLDAT  I_TAB-XBLNR I_TAB-LIFNR I_TAB-AMOUNT
                  I_TAB-CURR  I_TAB-BUSAREA
                  I_TAB-BKTXT I_TAB-DMBTR I_TAB-MENGE I_TAB-SRNO.
              MOVE-CORRESPONDING I_TAB TO I_TAB1.
            ELSE.
              EXIT.
            ENDIF.
            APPEND I_TAB1.
            CLEAR: I_TAB, I_TAB1.
          ENDDO.
        ENDIF.
        CLOSE DATASET G_FILE.

  • File from application server-- Email ?

    Hi,
    I need to pickup a file from application server and Email the same to the intended receipents through ABAP program
    For that i had used the following code:
    REPORT  ZEMAIL_APP_SER_FAIL.
    DATA :is_doc_chng        TYPE sodocchgi1,
          it_objtxt          TYPE STANDARD TABLE OF solisti1,
          is_objtxt          TYPE solisti1,
          it_objpack         TYPE STANDARD TABLE OF sopcklsti1,
          is_objpack         TYPE sopcklsti1,
          it_objbin          TYPE STANDARD TABLE OF solisti1,
          is_objbin          TYPE solisti1,
          it_reclist         TYPE STANDARD TABLE OF somlreci1,
          is_reclist         TYPE somlreci1,
          w_lines_tx         TYPE i.
    ** Create Message Body
    **   Title and Description
    *is_doc_chng-obj_name  = 'MAIL'.
    is_doc_chng-obj_descr = 'Auto genareted Mail from Application server'.
    ** main text
    is_objtxt-line = 'This is an automatically generated mail. Please do not reply  to it.'(028).
    APPEND is_objtxt TO it_objtxt.
    is_objtxt-line = space.
    APPEND is_objtxt TO it_objtxt.
    *   write packing list (main)
    DESCRIBE TABLE it_objtxt LINES w_lines_tx.
    READ     TABLE it_objtxt INTO is_objtxt INDEX w_lines_tx.
    is_doc_chng-doc_size = ( w_lines_tx - 1 ) * 255 + STRLEN( is_objtxt ).
    CLEAR is_objpack-transf_bin.
    is_objpack-head_start = 1.
    is_objpack-head_num   = 0.
    is_objpack-body_start = 1.
    is_objpack-body_num   = w_lines_tx.
    is_objpack-doc_type   = 'CVS'.
    is_objpack-OBJ_NAME   = 'GIND_EXP'.
    is_objpack-Obj_langu  = 'E'.
    APPEND is_objpack TO it_objpack.
    is_reclist-receiver = 'XXX'@'YYY'.COM'.
    is_reclist-rec_type = 'A'.
    Break-point.
    *is_reclist-REC_ID   =  'XXX@YYY'.COM'.
    APPEND is_reclist TO it_reclist.
    CLEAR is_reclist.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
       document_data              = is_doc_chng
       put_in_outbox              = 'X'
       commit_work                = 'X'
    TABLES
       packing_list               = it_objpack
       contents_txt               = it_objtxt
       receivers                  = it_reclist
    EXCEPTIONS
       too_many_receivers         = 1
       document_not_sent          = 2
       document_type_not_exist    = 3
       operation_no_authorization = 4
       parameter_error            = 5
       x_error                    = 6
       enqueue_error              = 7
       OTHERS                     = 8.
    IF sy-subrc NE 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    when i execute this program:
    I get the following error msg:
    Activation setting not yet maintained
    May i know what is the problem?

    If you are sending an email, the receiver type should be U (internet mail address type). From your code it appears that you have input it as 'A'. I am not sure if the error message is related to this. Have you checked in transaction SOST, whether an email has been triggered from your program? At what point of execution is this error message triggered?

  • How to delete the Generated files from application server(open hub)?

    hi experts,
    when i try to execute process chain the DTP it is giving below dump. Exception CX_RSBK_REQUEST_LOCKED logged.
    when i execute the DTP manually and trying to delete the previous request, it is giving for dump ITAB_DUPLICATE_KEY.
    so to delete the generated file from application server, how to delete it for specific dates?
    Information on where terminated
    Termination occurred in the ABAP program "GPD6S3OE0BCVGC6L9DBNVYQARZM" - in
    "START_ROUTINE".
    The main program was "RSBATCH_EXECUTE_PROZESS ".
    In the source code you have the termination point in line 2874
    of the (Include) program "GPD6S3OE0BCVGC6L9DBNVYQARZM".
    The program "GPD6S3OE0BCVGC6L9DBNVYQARZM" was started as a background job.
    and when i check the dump it is point out at below code
    " Populate the lookup table for 0STOR_LOC
    SELECT * from /BI0/TSTOR_LOC
    into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
    FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
    STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
    but the programme is syntactically correct only.
    how to rectify the issue.
    regards
    venuscm
    Edited by: venugopal vadlamudi on Sep 28, 2010 1:59 PM

    hi experts,
    We have written start routine to get the storage location text and sending to File located at Application server through OPEN HUB.
    here is the code written in the Transformations
    In the global section
    Text for 0STOR_LOC
        DATA: l_0stor_loc_text TYPE HASHED TABLE OF /bi0/tstor_loc
              WITH UNIQUE KEY stor_loc.
        DATA: l_0stor_loc_text_wa TYPE /bi0/tstor_loc.
    and in the code to get the text
    " Populate the lookup table for 0STOR_LOC
        *SELECT * from /BI0/TSTOR_LOC*
          into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
          FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
                  STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
    im sure there is problem with the Routine only. i think i need to change the code if so please provide me the modified one.
    thanks
    venuscm
    Edited by: venugopal vadlamudi on Sep 29, 2010 9:37 AM

  • File from application server -Read and process and delete the file .

    Hi All,
             I writing a ZEE program which will read the file from application server(file will be in text delimat format) and moving the data to internal table and uploadind data base.The part which iam facing problem is -
    > I hve read the file from application server like below ,
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    EXIT.
    ELSE.
      DO.
        CLEAR: wa_string, wa_uploadtxt.
        READ DATASET ld_file INTO wa_string.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
                                          wa_uploadtxt-name2
                                          wa_uploadtxt-age.
    Spliting part i having problem .i need to seperate each field which is seperate from tab delimite and pass it into respective fields of internal table .
    Second if another file come to the appicaltion server , wether my first file will be there ? or should i need to delete the first file after redaing how should i proceed further ?.
    Regards
    SRIRAM...
    THANKS In ADVANCE

    HI,
    1.
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    EXIT.
    ELSE.
    DO.
    CLEAR: wa_string, wa_uploadtxt.
    READ DATASET ld_file INTO wa_string.
    IF sy-subrc NE 0.
    EXIT.
    ELSE.
    SPLIT wa_string AT cl_abap_char_utilities=>horizontal_tab INTO wa_uploadtxt-name1
    wa_uploadtxt-name2
    wa_uploadtxt-age.
    APPEND  wa_uploadtxt TO itab.
    ENDDO.
    CLOSE DATASET ld_file.
    ENDIF.
    2. If the another file get's generated in the application server with same file name then the data in old file get's over written with the new data. You are not required to delete the file.

Maybe you are looking for

  • Problem with set-up: Blackberry ID- country and language

    Hello, I am setting up my Playbook tablet for the first time and have hit a snag on the third or fourth screen. I am supposed to enter my country and language for Blackberry ID, but I see only 'No country indicated' and I find no way to enter a count

  • The images in my html widget look blurry!

    Hey there, I'm making some html widgets for my book using HYPE. When I insert this into the ibooks the program shows the preview image in crisp high quality but when I preview it on the iBook, the figure looks somewhat blurred. When I tap on the figu

  • Can I mass-change file associations?

    On a Win7 I installed CS4 and CC. However, Bridge CC (although installed last) has *all* files associated with CS4. Which of course makes my life very difficult right now. Is there a way to massively change file associations in Bridge CC? I've done i

  • Can I dynamically control the position of objects on a printed page?

    Forum: Oracle Developer Reports Builder (10g) I have a need to control the position of printing on a peel off label in my report. I currently am forced to represent a complex object three times , i.e. LEFT, RIGHT and CENTER, printing whichever is con

  • Displaying Metadata in ATV2

    The only information that I can see or display on the TV is: the name of movie, genre: length: Before the latest update I could see info that I put into Video/Description (in iTunes). So now all I have is the name of the movie and not the actors, dir