Fetching of multiple files from Application Server into SAP Program

Hi All,
I have a issue related <b>Fetching of multiple files from Application Server into SAP Program</b>.
Actual issue is as below.
In the <b>selection screen</b> of <b>my program</b> i will give <b>Application Server Path</b> as :
<b>/PW/DATA/SAP/D1S/PP/DOWN/eppi0720*</b>
Then the based on above input it should pick up all the files that are matching <b>eppi0720*</b> criteria.
Suppose if i am having <b>5</b> files with above scenario, i have to fetch all those <b>5</b> files at a time and place in my SAP Program.
All those 5 file's data should come into SAP at a time.
Can anybody tell me how can we solve above issue.
If any body has come across same issue please provide me with solution.
Thanks in advance.
Thanks & Regards,
Rayeez.

If you want to get around the authorization check, you can do something like this.
report zrich_0001 .
parameters: p_path type epsf-epsdirnam
                  default '/usr/sap/TST/SYS/global'.
parameters: p_file type epsf-epsfilnam default 'CO*'.
start-of-selection.
perform get_file_list.
*       FORM get_file_list                                            *
form get_file_list.
  types: name_of_dir(1024)        type c,
         name_of_file(260)        type c,
         name_of_path(1285)       type c.
  data: begin of file_list occurs 100,
          dirname     type name_of_dir,  " name of directory. (possibly
                                         " truncated.)
          name        type name_of_file, " name of entry. (possibly
                                         " truncated.)
          type(10)    type c,            " type of entry.
          len(8)      type p,            " length in bytes.
          owner(8)    type c,            " owner of the entry.
        mtime(6)    type p, " last modification date, seconds since 1970
          mode(9)     type c, " like "rwx-r-x--x": protection mode.
          useable(1)  type c,
          subrc(4)    type c,
          errno(3)    type c,
          errmsg(40)  type c,
          mod_date    type d,
          mod_time(8) type c,            " hh:mm:ss
          seen(1)     type c,
          changed(1)  type c,
        end of file_list.
  data: begin of file,
          dirname     type name_of_dir,  " name of directory. (possibly
                                         " truncated.)
          name        type name_of_file, " name of entry. (possibly
                                         " truncated.)
          type(10)    type c,            " type of entry.
          len(8)      type p,            " length in bytes.
          owner(8)    type c,            " owner of the entry.
        mtime(6)    type p, " last modification date, seconds since 1970
          mode(9)     type c, " like "rwx-r-x--x": protection mode.
          useable(1)  type c,
          subrc(4)    type c,
          errno(3)    type c,
          errmsg(40)  type c,
          mod_date    type d,
          mod_time(8) type c,            " hh:mm:ss
          seen(1)     type c,
          changed(1)  type c,
        end of file.
  call 'C_DIR_READ_FINISH'             " just to be sure
       id 'ERRNO'  field file_list-errno
       id 'ERRMSG' field file_list-errmsg.
  call 'C_DIR_READ_START' id 'DIR'    field p_path
                          id 'FILE'   field p_file
                          id 'ERRNO'  field file-errno
                          id 'ERRMSG' field file-errmsg.
  if sy-subrc <> 0.
    sy-subrc = 4.
    exit.
  endif.
* Read the file list and add to internal table.
  do.
    clear file.
    call 'C_DIR_READ_NEXT'
      id 'TYPE'   field file-type
      id 'NAME'   field file-name
      id 'LEN'    field file-len
      id 'OWNER'  field file-owner
      id 'MTIME'  field file-mtime
      id 'MODE'   field file-mode
      id 'ERRNO'  field file-errno
      id 'ERRMSG' field file-errmsg.
    if sy-subrc =  1.
      exit.
    endif.
    append file to file_list.
  enddo.
* Write out the file list
  loop at file_list.
    write:/ file_list-name.
  endloop.
endform.
Regards,
Rich Heilman

Similar Messages

  • Error while reading excel file from application server into internal table.

    Hi experts,
    My requirement is to read an excel file from application server into internal table.
    Hence I have created an excel file fm_test_excel.xls in desktop and uploaded to app server using CG3Z tcode (as BIN file type).
    Now in my program I have used :
    OPEN DATASET v_filename FOR INPUT IN text mode encoding default.
    DO.
    READ DATASET v_filename INTO wa_tab.
    The statement OPEN DATASET works fine but I get a dump (conversion code page error) at READ DATASET statement.
    Error details:
    A character set conversion is not possible.
    At the conversion of a text from codepage '4110' to codepage '4103':
    - a character was found that cannot be displayed in one of the two
    codepages;
    - or it was detected that this conversion is not supported
    The running ABAP program 'Y_READ_FILE' had to be terminated as the conversion
    would have produced incorrect data.
    The number of characters that could not be displayed (and therefore not
    be converted), is 445. If this number is 0, the second error case, as
    mentioned above, has occurred.
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_CONVERSION_CODEPAGE', was not
    caught and
    therefore caused a runtime error.
    The reason for the exception is:
    Characters are always displayed in only a certain codepage. Many
    codepages only define a limited set of characters. If a text from a
    codepage should be converted into another codepage, and if this text
    contains characters that are not defined in one of the two codepages, a
    conversion error occurs.
    Moreover, a conversion error can occur if one of the needed codepages
    '4110' or '4103' is not known to the system.
    If the conversion error occurred at read or write of  screen, the file
    name was '/usr/sap/read_files/fm_test_excel.xls'. (further information about
    the file: "X 549 16896rw-rw----201105170908082011051707480320110517074803")
    Also let me know whether this is the proper way of reading excel file from app server, if not please suggest an alternative .
    Regards,
    Karthik

    Hi,
    Try to use OPEN DATASET v_filename FOR INPUT IN BINARY mode encoding default. instead of OPEN DATASET v_filename FOR INPUT IN text mode encoding default.
    As I think you are uploading the file in BIN format to Application server and trying to open text file.
    Regards,
    Umang Mehta

  • File from Application server into BW

    Hi All,
    I have a urgent requirement and I do not know much of ABAP
    The requirement is
    selecting existing file from application server Dynamically in BW server. This will be done by writing an ABAP code at the InfoPackage level in the External Data Tab but I am in need some ABAP code for the same
    Also let me know which table stores AL11 files
    I know USER_DIR stores directories but I required the table for the files within the directories.
    Any help is appreciated

    Hi DPN,
    If we have a condition like depending on System Date we have to get a file some thing like that then we can do that by using the ABAP Routine. But in your Scenario there are no specific conditions to select a file.
    If we have some variable which stores the value which we give and gets the specified file... That Would be Great.
    But in Routine we can not use Variables..(As Far As I Know)
    So better Select manually every time...
    Hope This Helps.
    Regards,
    rik.

  • Issue with uploading XML file from application server into internal table

    i Need to fetch the XML file from the application server and place into internal table and i am getting error message while using the functional module   SMUM_XML_PARSE and the error message is "line   1 col   1-unexpected symbol; expected '<', '</', entity reference, character data, CDATA section, processing instruction or comment" and could you please let me know how to resolve this issue?  
        TYPES: BEGIN OF T_XML,
                 raw(2000) TYPE C,
               END OF T_XML.
    DATA:GW_XML_TAB TYPE  T_XML.
    DATA:  GI_XML_TAB TYPE TABLE OF T_XML INITIAL SIZE 0.
    DATA:GI_STR TYPE STRING.
    data:  GV_XML_STRING TYPE XSTRING.
    DATA: GI_XML_DATA TYPE  TABLE OF SMUM_XMLTB INITIAL SIZE 0.
    data:GI_RETURN TYPE STANDARD TABLE OF BAPIRET2.
        OPEN DATASET LV_FILE1 FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        IF SY-SUBRC NE 0.
          MESSAGE 'File does not exist' TYPE 'E'.
        ELSE.
          DO.
    * Transfer the contents from the file to the work area of the internal table
            READ DATASET LV_FILE1 INTO GW_XML_TAB.
            IF SY-SUBRC EQ 0.
              CONDENSE GW_XML_TAB.
    *       Append the contents of the work area to the internal table
              APPEND GW_XML_TAB TO GI_XML_TAB.
            ELSE.
              EXIT.
            ENDIF.
          ENDDO.
        ENDIF.
    * Close the file after reading the data
        CLOSE DATASET LV_FILE1.
        IF NOT GI_XML_TAB IS INITIAL.
          CONCATENATE LINES OF GI_XML_TAB INTO GI_STR SEPARATED BY SPACE.
        ENDIF.
    * The function module is used to convert string to xstring
        CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
          EXPORTING
            TEXT   = GI_STR
          IMPORTING
            BUFFER = GV_XML_STRING
          EXCEPTIONS
            FAILED = 1
            OTHERS = 2.
        IF SY-SUBRC <> 0.
          MESSAGE 'Error in the XML file' TYPE 'E'.
        ENDIF.
      ENDIF.
      IF GV_SUBRC = 0.
    * Convert XML to internal table
        CALL FUNCTION 'SMUM_XML_PARSE'
          EXPORTING
            XML_INPUT = GV_XML_STRING
          TABLES
            XML_TABLE = GI_XML_DATA
            RETURN    = GI_RETURN.
      ENDIF.
      READ TABLE GI_RETURN TRANSPORTING NO FIELDS WITH KEY TYPE = 'E'.
      IF SY-SUBRC EQ 0.
        MESSAGE 'Error converting the input XML file' TYPE 'E'.
      ELSE.
        DELETE GI_XML_DATA WHERE TYPE <> 'V'.
        REFRESH GI_RETURN.
      ENDIF.

    Could you please tel me  why the first 8 lines were removed, till <Soap:Body and also added the line <?xml version="1.0" encoding="UTF-8"?> in the beggining .
    Becuase there will be lot of  XML files will be coming from the Vendor daily and that should be uploaded in the application server and should update in the SAP tables based on the data in the XML file.
    what information i need to give to vendor that do not add the first 8 lines in the XML file and add the line in the beggining <?xml version="1.0" encoding="UTF-8"?>   ??????
    Is there any other way we can do with out removing the lines?

  • Reading XML file from application server and  put into internal table-4.6C

    Dear All,
    Is there any way of reading XML file from application server to SAP? I am using 4.6C. Function module SCMS_STRING_TO_XSTRING function module is not available. Please suggest.
    Thanks and regards,
    Atanu

    Hi Atanu!
    Simply use the XSLT transformation 'ID'.
    FIELD-SYMBOLS <ls_result> TYPE ANY.
    CREATE DATA lref_data TYPE (your_structure).
    ASSIGN lref_data->* TO <ls_result>.
    CALL TRANSFORMATION id
                        SOURCE XML xmlstr
                        RESULT result = <ls_result>.
    "xmlstr" contains your XML file. Just read it into it via standard I/O operations. "<ls_result>" will contain your DDIC formatted content.
    Best regards
    Torsten

  • Function module to read xml files from application server

    Hi experts,
            I need to read  xml files from application server to sap. Is the any siutable function moldule for that?

    Hi Cenosure,
    Donno about FM which will upload data directly to SAP, I think you have to do some mapping for it so that it will suit the SAP format. Again it depends on your requirement..
    Please elaborate more about your requirement.
    Please have a look on below FM
    TEXT_CONVERT_XML_TO_SAP
    Also search on SCN there are many threads on the same topic available.
    http://abapreports.blogspot.com/2008/09/upload-xml-file-from-application-server.html
    This is the link which will give you the Code
    http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/Codes/Report/Z_RMTIWARI_XML_TO_ABAP_46C.html
    Use this XML file to Upload the same, this Program will work for your XML file also,
    http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/Codes/Report/input_xml.xml
    See the below thread also
    Upload XML to internal table and vice versa in SAP 4.6C
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • Is there any way to upload Tariff Code (with multiple XML files) from application server?

    Hi All,
    Is there any way to upload Tariff Code (with multiple XML files) from application server?. Its urgent.
    Regards,
    Jatin

    Hi Jatin,
    Yes, of course you can upload multiple files for tariff codes.
    This can be done by the below path:-
    SAP GTS Cockpit(tcode-/sapsll/menu_legal)-->Customs Management-->Classification-->Classification Master Data-->Upload Tariff Code Numbers from XML file(tocde- /SAPSLL/LLNS_UPL101).
    In the above area after browsing and choosing the first file, please select multiple check box to choose more files as well. Then you can further select your application server and upload all those files in one go.
    PS:- Although, we have an option to upload multiple such files but actually we should avoid multiple file uploads due to various reasons. Hence, please take utmost care during such procedure.
    Regards,
    Aman

  • Reading of File from legacy system into SAP Application Server using SAP XI

    Hi All,
      I have a file in <b>Legacy System with Exchange rates information data</b> i have to read that file using SAP XI process and put that file in SAP Application Server in SAP Specific Format and latter i have to use program RFTBFF00 to upload the file in the Application Server into SAP Tables.
      Can anybody tell me how can i do this with some example of same scenario.
      It would be better if anybody provides code example as i am new to SAP XI.
    Thanks in advance.
    Warm Regards,
    Rayeez.

    Hi Shaik,
    You need the access to the file system of ur legacy application and then you can follow this link for the required ifnormation
    File & Header
    Regards
    Vishnu

  • Uploading xml file from application server

    HI everybody guys having promblem reading xml file from application server.Here is the solution. the sample program is below.
    TYPE-POOLS: ixml. "iXML Library Types
    *TABLES : rbkp.
           TYPE DECLERATIION
    TYPES: BEGIN OF type_tabpo,
           ebeln  TYPE ekko-ebeln,         "PO document number
           ebelp TYPE ekpo-ebelp,          "PO line item
           END OF type_tabpo.
    TYPES: BEGIN OF type_ekbe,
           belnr TYPE rbkp-belnr,          "Invoice document
           gjahr TYPE rbkp-gjahr,          "fiscal year
           END OF type_ekbe.
    TYPES: BEGIN OF type_invoice,
           belnr TYPE rbkp-belnr,          "PO document number
           gjahr TYPE rbkp-gjahr,          "Fiscal Year
           rbstat TYPE rbkp-rbstat,        "invoice status
           END OF type_invoice.
    TYPES: BEGIN OF t_xml_line,            "Structure for holding XML data
            data(256) TYPE x,
            END OF t_xml_line.
         INTERNAL TABLE DECLERATIION
    DATA: gi_tabpo TYPE STANDARD TABLE OF type_tabpo,
          gi_ekbe TYPE STANDARD TABLE OF type_ekbe,
          gi_invoice TYPE STANDARD TABLE OF type_invoice,
          gi_bapiret2 TYPE STANDARD TABLE OF bapiret2.
    DATA: l_ixml TYPE REF TO if_ixml,
          l_streamfactory TYPE REF TO if_ixml_stream_factory.
         l_parser TYPE REF TO if_ixml_parser,
         l_istream TYPE REF TO swif_ixml_istream,
         l_document TYPE REF TO if_ixml_document,
         l_node TYPE REF TO if_ixml_node,
         l_xmldata TYPE string.
    *DATA: l_elem TYPE REF TO if_ixml_element,
         l_root_node TYPE REF TO if_ixml_node,
         l_next_node TYPE REF TO if_ixml_node,
         l_name TYPE string,
         l_iterator TYPE REF TO if_ixml_node_iterator.
    DATA: l_xml_table TYPE TABLE OF t_xml_line, " XML Table of the structure
          l_xml_line TYPE t_xml_line, " Record of structure t_xml_line
          l_xml_table_size TYPE i. " XML table size
    DATA: l_filename TYPE string.
          WORK AREA DECLARATION
    DATA: gw_tabpo TYPE type_tabpo,
          gw_ekbe TYPE type_ekbe,
          gw_invoice TYPE type_invoice,
          gw_bapiret2 TYPE bapiret2.
       BEGIN OF SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    PARAMETERS: p_file TYPE pathintern LOWER CASE DEFAULT '/usr/sap/tmp/'.
    Validation of XML file: Only DTD included in XML document is supported
    SELECTION-SCREEN END OF BLOCK blk1.
      INTIALISATION.
    INITIALIZATION.
      SELECTION SCREEN VALIDATION
    AT SELECTION-SCREEN.
    To validate p_file is not initial
      PERFORM sub_validate_file.
    PERFORM sub_validate_path.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Request for filename for xml file from the application server
      PERFORM sub_get_filename_appl USING  p_file.
      START OF SELECTION SCREEN
    START-OF-SELECTION.
      PERFORM sub_fetch_po_details.
      PERFORM sub_get_invoice.
      PERFORM sub_rel_invoice.
      END OF SELECTION SCREEN
    END-OF-SELECTION.
    *&      Form  sub_validate_file
         To Validate the file
    FORM sub_validate_file .
      IF p_file IS INITIAL.
        MESSAGE e000.           "specify the file path
      ENDIF.
    ENDFORM.                    " sub_validate_file
    *&      Form  sub_get_filename_appl
    form sub_get_filename_appl  USING  l_fname TYPE any.
    DATA:  l_fname TYPE filename-fileintern.        " File name
    *GET THE FILENAME FROM THE APPLICATION SERVER
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = l_fname
          filemask         = '*'
        IMPORTING
          serverfile       = l_fname
        EXCEPTIONS
          canceled_by_user = 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.                    " sub_get_filename_appl
    *&      Form  sub_fetch_po_details
         To fetch the PO details from the application server
         Format of file is XML
    FORM sub_fetch_po_details .
          TYPE DECLERATIION
      l_ixml = cl_ixml=>create( ).
    Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
      PERFORM get_xml_table.
      LOOP AT gi_tabpo INTO gw_tabpo.
        WRITE:/ gw_tabpo.
      ENDLOOP.
    ENDFORM.     " sub_fetch_po_details
    *&      Form  get_xml_table
          Read from the xml file
    FORM get_xml_table .
    Local variable declarations
      DATA: l_len TYPE i,
      l_len2 TYPE i,
      l_tab TYPE tsfixml,
      l_content TYPE string,
      l_str1 TYPE string,
      c_conv TYPE REF TO cl_abap_conv_in_ce,
      l_itab TYPE TABLE OF string.
      l_filename = p_file.
    code to upload data from application server
      OPEN DATASET l_filename FOR INPUT IN BINARY MODE.
      IF sy-subrc <> 0.
        WRITE:/ 'invalid file path'.
      ENDIF.
      DO.
        READ DATASET l_filename INTO l_xml_line.
        IF sy-subrc EQ 0.
          APPEND l_xml_line TO l_xml_table.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET l_filename.
    code to find the table size
      DESCRIBE TABLE l_xml_table.
      l_xml_table_size = ( sy-tleng ) * ( sy-tfill ).
    *code to convert hexadecimal to XML
      LOOP AT l_xml_table INTO l_xml_line.
        c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data
    replacement
        = space ).
        c_conv->read( IMPORTING data = l_content len = l_len ).
        CONCATENATE l_str1 l_content INTO l_str1.
      ENDLOOP.
      l_str1 = l_str1+0(l_xml_table_size).
      SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
      LOOP AT l_itab INTO l_str1.
        REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN
        l_str1 WITH space.
      ENDLOOP.
      CALL TRANSFORMATION ('ID')    " code to put in internal table
      SOURCE XML l_str1
      RESULT tab = gi_tabpo[].
    ENDFORM. " get_xml_table

    Hi Raja,
    I tried the same. But it not populating the table and giving an error message in the return table "line   1 col   1-unexpected symbol; expected '<', '</', entity reference, charac".
    I can't find any ' ; ' in the XML file. What could be the possible reason of error?

  • Reading File from Application Server using Read Dataset

    Hi,
    i am trying to read excel file from Application Server and has multiple records in that based on structure below. but when i execute its giving me error message.here is the code, can sumone suggest me on this please ??
    FORM f_data_upload .
      DATA:
         l_filename TYPE string,   "file name
         l_wa_string TYPE string.  "file record
        l_filename = p_inp_as. "File path from Application Server
        OPEN DATASET l_filename FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        DO.
          IF sy-subrc <> 0.
            EXIT.
          ENDIF.
    Read the data from the file in Application server.
          READ DATASET l_filename INTO l_wa_string.
          IF sy-subrc = 0.
            SPLIT l_wa_string AT cl_abap_char_utilities=>horizontal_tab
                  INTO w_data-tcode
                       w_data-matnr
                       w_data-mtart
                       w_data-werks
                       w_data-vkorg
                       w_data-vtweg
                       w_data-lgort
                       w_data-meins
                       w_data-maktx
                       w_data-spart
                       w_data-kosch
                       w_data-mstae
                       w_data-brgew
                       w_data-ntgew
                       w_data-groes
                       w_data-matkl
                       w_data-prdha
                       w_data-mstde
                       w_data-mtpos_mara
                       w_data-gewei
                       w_data-spart
                       w_data-mstav
                       w_data-mstdv
                       w_data-dwerk
                       w_data-taxkm
                       w_data-versg
                       w_data-kondm
                       w_data-ktgrm
                       w_data-mtpos
                       w_data-mtvfp
                       w_data-tragr
                       w_data-ladgr
                       w_data-herkl
                       w_data-ekgrp
                       w_data-webaz
                       w_data-dismm
                       w_data-beskz
                       w_data-prctr
                       w_data-bklas
                       w_data-bwtty
                       w_data-vprsv
                       w_data-verpr
                   IN CHARACTER MODE.
            APPEND w_data TO i_data.
            CLEAR w_data.
           ENDIF.
        ENDDO.
        CLOSE DATASET l_filename.
    Error Message while executing
    What happened?
        At the conversion of a text from codepage '4110' to codepage '4102':
        - a character was found that cannot be displayed in one of the two
        codepages;
        - or it was detected that this conversion is not supported
        The running ABAP program 'ZHDI_LOMM_VEHI_MAT_MASS_CREATE' had to be terminated
         as the conversion
        would have produced incorrect data.
        The number of characters that could not be displayed (and therefore not
        be converted), is 449. If this number is 0, the second error case, as
        mentioned above, has occurred.
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_CONVERSION_CODEPAGE', was not
         caught in
        procedure "F_DATA_UPLOAD" "(FORM)", nor was it propagated by a RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        Characters are always displayed in only a certain codepage. Many
        codepages only define a limited set of characters. If a text from a
        codepage should be converted into another codepage, and if this text
        contains characters that are not defined in one of the two codepages, a
        conversion error occurs.
        Moreover, a conversion error can occur if one of the needed codepages
        '4110' or '4102' is not known to the system.
        If the conversion error occurred at read or write of  screen, the file
        name was '/usr/sap/interfaces/conversion/pioneer/ddm/data/test_data1.xls'.
         (further information about the file: "X 549
         24064rw-rw----200812232135082008122307293120081223072931")
    Please help me
    Thank You

    Woah ... perfect guru
    but data looks like all junk characters ? its filling with special characters, hashes # and other characters but not with Excel data.. any idea ??
    Temesh
    Edited by: New2Sap Abap on Dec 24, 2008 6:42 AM

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

  • Copy file from FTP server to sap application server

    Hi,
    I am able to copy a particular file from FTP server to sap application server using FTP_CONNECT, FTP_COMMAND and FTP_DISCONNECT. But here my problem is, it copies into default application server path(DIR_HIOME). I want to copy into specified folder in the application server. How can I specify the required destination path.
    Can you please suggest how to achieve this.
    Thanks,
    Shiva Kankanala

    try something like this:
    data: user(30) type c value 'ftpuser', "ftp username
                  pwd(30) type c value 'ftppass', "ftp password
                  host(64) type c value '255.255.255.255', "ftp server IP
                  cmd1(80) type c value 'lcd /dump', "location on app server where you want to copy the file
                  cmd2(80) type c value 'get', "specifies you are going to get the file from ftp server
                  dest like rfcdes-rfcdest value 'SAPFTPA',
                  file(15) type c value 'file.txt'. "specifies file that you want to get from ftp server
    data: hdl type i,
            key type i value 26101957,
            slen type i.
    slen = strlen( pwd ).
    call function 'HTTP_SCRAMBLE'
        EXPORTING
          source      = pwd
          sourcelen   = slen
          key         = key
        IMPORTING
          destination = pwd.
    call function 'FTP_CONNECT'
        EXPORTING
          user            = user
          password        = pwd
          host            = host
          rfc_destination = dest
        IMPORTING
          handle          = hdl.
    call function 'FTP_COMMAND'
        EXPORTING
          handle        = hdl
          command       = cmd1
        TABLES
          data          = result
        EXCEPTIONS
          command_error = 1
          tcpip_error   = 2.
      loop at result.
        write at / result-line.
      endloop.
    CONCATENATE cmd2 file INTO cmd2 SEPARATED BY SPACE.
    call function 'FTP_COMMAND'
          EXPORTING
            handle        = hdl
            command       = cmd2
          TABLES
            data          = result
          EXCEPTIONS
            command_error = 1
            tcpip_error   = 2.
        loop at result.
          write at / result-line.
        endloop.
        refresh result.

  • Regarding Reading the file from Application Server

    Hi,
    I am trying to read data from Application Server but due to special characters it is getting dumped out.
    US24,Q,Acero (Carbon),AA,0010,0001,01,Ver Mir para dimension#
    US24,Q,Acero (Carbon),AA,0010,0002,01,Area rectificada sin da#os ra
    US24,Q,Acero (Carbon),AA,0010,0003,01,Ver Mir para dimension#
    US24,Q,Acero (Carbon),CD,0010,0001,01,ITPE Soken para verificacion
    US24,Q,Acero (Carbon),CD,0010,0010,01,No se permite desprendimiento
    US24,Q,Acero (Carbon),CD,0010,0002,01,"Vernier, cinta metrica"#
    In the last line it is going into dump due to special character ".
    Please suggest.
    Thanks
    Priyanka.

    Hi,
    You can check the mode in which you are reading the file
    from application server that is
    Open Dataset in Binary or Text Mode.
    Hope it helps
    Regards
    Mansi

Maybe you are looking for

  • Apple id has been disabled

    Hi everyone,    I am new to apple. I have an iphone 4s and a MacbookPro. One day I was checking my credit card statement. I noticed two unauthorized charges to my credit card made to iTune stores for music puchases. as far as I remember, I personally

  • Plz recommend a SATA-III controller card [solved]

    I only need this to control a single SSD (new vertex 4) so internal connectors would be great.  I want something that someone can endorse as problem-free.  In reading some online reviews, it seems as though some are NOT linux compatible, for example:

  • Custom metadata field with autonumbering sequence

    I have created a custom metadata field and I need it to be able to start a zero and then increase by one with each checkin. There were other qualifications for this particular field as well, which I have managed to do. Currently, the field is V99_999

  • Services error "could not be started"

    The "Right-Click" Services Menu options are giving me an error.  It doesn't matter which Service I choose.  The error I get is this:: "The "New Bean Document Containing Selection" service could not be used."  Or, it could be "Statistics" in the quote

  • Tick on statistical tab ( MM pricing procedure )

    Dear experts,    Please explain me what is the significance of ticking the statistical tab in MM pricing procedure. Regards, Abhijeet