READ DATASET PROBLEM

Hi all,
Using the code to read file data
DATA : Len type i,
            str_name type string.
READ DATASET name INTO str_name LENGTH len .
but it only reads first 155 characters i.e. length is always 155 not more that that but as per requirement wants to read more that 155 charcters.
Any suggestions welcome,
Regards,

READ for Files
Reads a file.
Syntax
READ DATASET <dsn> INTO <f>
[MAXIMUM LENGTH <maxlen>]
[ACTUAL LENGTH <len>].
Reads the contents of the file <dsn> on the application server to the variable <f>. The amount of data can be specified using MAXIMUM LENGTH. The number of bytes transferred can be written to <len> using ACTUAL LENGTH.
Regards,
Priya.

Similar Messages

  • Problem with READ DATASET when reading file from app server

    Hi,
    wondering if anyone can help, I'm using the following code to read from a file on app server, the file is of type .rtf
    OPEN DATASET file_rtf FOR INPUT IN TEXT MODE
                                 ENCODING DEFAULT
                                 WITH SMART LINEFEED.
    DO.
    READ DATASET file_rtf INTO string.
    IF SY-SUBRC = 0.
    EXIT.
    ENDIF.
    ENDDO.
    the open dataset part works sy-subrc = 0, but the read returns sy-subrc = 8 and no data is passed to string.
    Any ideas as to what is causing this problem appreciated, <removed>
    Thanks
    Edited by: Thomas Zloch on Mar 17, 2010 3:57 PM - please don't offer p...

    Hi Adam,
    The source code in the below link has details about how to read/write to application server.
    [Application server file operartions|http://www.divulgesap.com/blog.php?p=NDk=]
    Please let us know if you have any issues.
    Regards,
    Ravi

  • Problem reading DATASET into xstring

    Hi,
    I am facing a curious problem where I'd appreciate a helping hand: when I read data from a dataset into a variable of fixed-length, everything works fine. When I try to do the same with a variable-length type, nothing is read.
    This code works fine:
    <i>DATA binarydata(32000) TYPE x,
         alen TYPE i.
    OPEN DATASET filename FOR INPUT IN BINARY MODE.
    READ DATASET filename INTO binarydata ACTUAL LENGTH alen.</i>
    Here alen contains the correct number of bytes read (eg. 19000).
    But if I try:
    <i>DATA binarydata TYPE xstring,
         alen TYPE i.
    OPEN DATASET filename FOR INPUT IN BINARY MODE.
    READ DATASET filename INTO binarydata ACTUAL LENGTH alen.
    </i>
    Here alen is 0.
    Can anybody tell me what's wrong here ?
    Thanks & Regards
    Heiko

    Hello Heiko
       If you are using NON-UNICODE system, please try by unselecting the checkbox "Unicode Checks Active" in program attributes.
       While using UNICODE system, need to use as STRING.
    Reason:
    In UNICODE enabled or when Unicode Checks is active, system can transfer data between structures only when both are of characater format.
    In your case, the data is read in text mode i.e character format but trying to move to XSRTING which is sequence of 'X' type characters. Hence resulting in dump.
    Just for your info:
    <b>The elementary data type STRING is similar to data type C and refers to a variable-length string. Accordingly, the elementary data type XSTRING is similar to data type X and refers to a variable-length byte sequence.</b>
       Hope the above info clarifies you.
    Kind Regards
    Eswar

  • # problem while reading dataset from application server.

    hi all,
    I uplodaed a  text file which is tab delimeted, to the application server using transaction code cg3z directly. now that file is stored with # in place of tab(space) in application server.
    my broblem is that when i am reading that file using  READ DATASET  its comming with that # symbol also.
    how i split that dataset .
    or if there is any other solution ,like openning file into another mode,
    help me.
    thank uou

    Hi Pawan..
    you can access the Tab character using CL_CHAR_ABAP_UTILITIES=>HORIZONTAL_TAB
    Do like this After READ DATASET.
    DATA : V_RECORD(100).
    DO.
    READ DATASET P_FILE INTO V_RECORD.
    IF SY-SUBRC <> 0.
      EXIT.
    ENDIF.
    SPLIT V_RECORD INTO FIELD1 FIELD2 SEPARATED BY <b>CL_CHAR_ABAP_UTILITIES=>HORIZONTAL_TAB.</b>
      <<<<further operations here>>>>
    ENDDO.
    reward if Helpful.
    <b></b>

  • Not able to get file from application server with read dataset

    Hi,
    Firstly i download a file from application server from read data set and then i sent this file as attachment. But problem is that i am able to send .jpg .bmp file but i am not able to send .pdf or .doc file so what can i do for that. ?
    My code is like below...
      DATA : PATH TYPE STRING.
      DATA: E_FILE LIKE RLGRAP-FILENAME.
      CONCATENATE '/tmp/'  NAME_WITH_EXT INTO E_FILE SEPARATED BY SPACE.
      CONDENSE E_FILE NO-GAPS.
      IF EXTENSION = 'TXT'.
        OPEN DATASET E_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT WITH WINDOWS LINEFEED . " MESSAGE MSG.
        IF SY-SUBRC <> 0.
       WRITE: SY-SUBRC, MSG, ' LIKE ', C_FNAME.
        ELSE.
          WHILE SY-SUBRC = 0.
            READ DATASET E_FILE INTO WA_C.
            IF SY-SUBRC <> 0.
              EXIT.
            ENDIF.
            APPEND WA_C TO IT_C.
          ENDWHILE.
          CLOSE DATASET E_FILE.
        ENDIF.
      ELSE.
        OPEN DATASET E_FILE FOR INPUT IN BINARY MODE. " ENCODING DEFAULT. "    INPUT IN  BINARY MODE . " TEXT MODE ENCODING   NON-UNICODE.
        IF SY-SUBRC = 0.
          DO .
            READ DATASET E_FILE INTO GS_PDF_TAB.
            IF SY-SUBRC = 0.
              APPEND GS_PDF_TAB TO GT_PDF_TAB.
            ELSE.
              EXIT.
            ENDIF.
          ENDDO.
          CLOSE DATASET E_FILE.
        ENDIF.
      ENDIF.
    Regards,
    Gurprit Bhatia

    delete this line DEFAULT WITH WINDOWS LINEFEED  and check this..

  • READ DATASET

    Hi Friends,
    I'm getting problem in reading only 100 records from the application server using the READ DATASET statement. The file on the application server may have 8000 records but i wanted to get only 100 records and process them. Then i wanted to get  next 100 records from the file stored on app.server and process and so on.
    After I get the 100 records, I wanted to do further operations such as putting them into a custom table.
    Will the below code work?
    DATA l_item(100) type c.
    *Open the .DAT file for reading
      OPEN DATASET p_file1 FOR INPUT IN TEXT MODE ENCODING UTF-8 MESSAGE
      x_error.
      IF sy-subrc NE 0.
    *An error occured during opening the dataset !
        MESSAGE x_error TYPE 'E'.
        CLEAR x_error.
      ENDIF.
      DO.
    *Read the .DAT file into an internal table
        READ DATASET p_file1 INTO l_item.
        IF sy-subrc EQ 0.
    *split the records into data fields based on delimiter ','
    *then append the current record to an internal table
          SPLIT l_item AT ',' INTO
                                   x_item-inv_item_id
                                   x_item-intl_aa_nbr
                                   x_item-intl_pba_nbr
                                   x_item-intl_ta_nbr
                                   x_item-intl_product_code
                                   x_item-descr254
                                   x_item-intl_stck_id
                                   x_item-awr_disallowed_flg
                                   x_item-returnable_flg
                                   x_item-fulfillment_flg
                                   x_item-refund_only_flg
                                   x_item-prod_returnable_flg
                                   x_item-stock_cat_id.
          APPEND x_item TO i_item.
          CLEAR x_item.
        ELSE.
    *Data was read and the end of the file was reached
          MESSAGE i006.
          EXIT.
        ENDIF.
      ENDDO.

    Hi,
    If you want to process every 100 records once,  you can in ways.
    1.  
    DO.
    *Read the .DAT file into an internal table
        READ DATASET p_file1 INTO l_item.
        IF sy-subrc EQ 0.
    *split the records into data fields based on delimiter ','
    *then append the current record to an internal table
          SPLIT l_item AT ',' INTO
                                   x_item-inv_item_id
                                   x_item-intl_aa_nbr
                                   x_item-intl_pba_nbr
                                   x_item-intl_ta_nbr
                                   x_item-intl_product_code
                                   x_item-descr254
                                   x_item-intl_stck_id
                                   x_item-awr_disallowed_flg
                                   x_item-returnable_flg
                                   x_item-fulfillment_flg
                                   x_item-refund_only_flg
                                   x_item-prod_returnable_flg
                                   x_item-stock_cat_id.
          APPEND x_item TO i_item.
          CLEAR x_item.
          lv_count = lv_count + 1.
         if lv_count = 100.
           perform process 100 records.
            clear: lv_count, x_items.
            refresh x_items.
        endif.
        ELSE.
    *Data was read and the end of the file was reached
          MESSAGE i006.
          EXIT.
        ENDIF.
      ENDDO.
    2.   Download all records into an internal table once.
    then loop internaltable.
    data: lv_count type i,
             lv_count1 type i,
             lv_previous type i.
    lv_count = lv_count  + 1.
    lv_count1 = lv_count1 + 1.
    if lv_count1 < = 100.
    copy 100 records into another internal table2.
    else.
         lv_previous = lv_count - lv_previous.
    if lv_previous = 100.
        process records.
       clear: lv_count1,  internal table2.
       refresh internal table2
    endif.
    endif.
    endloop.
    regards,
    Ganesh

  • Read dataset - read data randomly

    Dear All,
    I am facing a strange problem while reading data through READ DATASET statement.
    The data is getting read randomly from the file.
    For example, if my text file contains 10,000 records, i am able to see around 800 in my internal table.
    Also, with read dataset statement, sometimes first record gets read, second time fifth record and so on. There is no particular order.
    Read dataset statement is skipping a lot of records while reading data from the file.
    Has anyone face this problem earlier?
    Any clue in this direction will be highly appreciated.
    Many thanks.
    Best Regards,
    Tarun

    Hi,
    how you are looking your input file, if it is in NOTEPAD check menu option 'Format----> Word wrap' is unchecked and then see the how many entries are there in the file.
    Regards,
    Sreeram.

  • Upload read dataset only one line

    hi all
    i have a problem, i want to upload a file from applikation server. When i want to read dataset into a xstring field,
    it read only the first line not all why?
    here is my code
    type-pools dset.
    data lf_filename type string value '/opt/interface/indtrans/d58_sst/integrale/output/PLU.plu'.
    data lf_line type xstring.
    data lf_str_line type string.
    data lf_hex_code type swxmlcont.
    data lt_attr type dset_attributes.
    start-of-selection.
      open dataset lf_filename for input in binary mode.
      do.
        read dataset lf_filename into lf_line.
        if sy-subrc <> 0.
          exit.
        else.
    *      get dataset lf_filename attributes lt_attr.
          append lf_line to lf_hex_code.
        endif.
      enddo.
      close dataset lf_filename.
    thx abap_begin....

    that to be functional, but when i read with the file with cl_gui_frontend_services=>gui_upload with file Typ "BIN"
    CALL METHOD cl_gui_frontend_services=>gui_upload
         EXPORTING
           FILENAME                = l_filename
           FILETYPE                = 'BIN'
    *      HAS_FIELD_SEPARATOR     = SPACE
    *      HEADER_LENGTH           = 0
         IMPORTING
           FILELENGTH              = l_size
    *      HEADER                  =
         CHANGING
           data_tab                = lt_data
         EXCEPTIONS
           FILE_OPEN_ERROR         = c_not_found
           FILE_READ_ERROR         = 3
           INVALID_TYPE            = 4
           NO_BATCH                = 5
           GUI_REFUSE_FILETRANSFER = 7
           others                  = 99.
    i becam a other result then, when i read with
    open dataset lf_filename for input in binary mode.
    why?
    Now i have a idea, i read the file value in text mode and save this in an internal table.
    Then make the loop over table, and convert the value in identical princple such as cl_gui_frontend_services=>gui_upload with the filetype "BIN".
    I dont' know, how you do this?
    thx abap_begin

  • Explain why READ DATASET conversion from codepage '4110' to codepage '4102'

    I am unfamiliar with unicode but I am trying to solve a problem in an ABAP program.
    Our code is
    OPEN DATA p_in FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    DO.
      READ DATASET p_in INTO i_tab.
    The program gives me the error  'At the conversion of a text from codepage '4110' to codepage '4102'.  The program abends on a line in the file that contains the special character '#'.
    Does this mean that the file I am reading is in codepage '4110' and the internal format of i_tab is codepage '4102'?  If so, how do the codepages get assigned to unix files and internal structures   How can I make the both codepage '4110' or codepage '4102'?  Also, what is the difference between these two codepages?
    thanks.
    Ryan
    My

    Hi,
    Use
    open dataset DSN in text mode for input encoding utf-8.

  • Upload xml file from aplication server using read dataset, parser error.

    Hi,
    I would like to upload xml file from app. server but parser failed. If I upload this xml file from workstation (using ws_upload) it is correct. For uploading xml file from app. server I use open dataset... read dataset. In loop section I remove '#' char. How do You upload xml file from app server? What Could be incorrect.
    I try to open dataset in binary mode, text mode...
    TYPES: BEGIN OF xml_line,
            data(255) TYPE c,
          END OF xml_line.
    DATA: gt_xml_table TYPE TABLE OF xml_line,
          gs_xml_structure TYPE  xml_line,
          gv_xml_table_size TYPE i.
    OPEN DATASET s FOR INPUT IN BINARY MODE.
      IF sy-subrc <> 0.
        MESSAGE e001(zet) WITH '....'.
      ENDIF.
      DO.
        READ DATASET s INTO gs_xml_structure.
        IF sy-subrc <> 0.
          EXIT.
        ELSE.
         len = STRLEN( gs_xml_structure ).
         len = len - 1.
         check len > 0.
         WRITE gs_xml_structure(len) TO gs_xml_structure.
          APPEND gs_xml_structure TO gt_xml_table.
        ENDIF.
      ENDDO.

    You Can do this too
    parameters: p_file like rlgrap-filename.
    data: subrc like sy-subrc.
      create object me.
      REFRESH t_data.
    *  Open XML File
      CALL METHOD me->CREATE_WITH_FILE
        EXPORTING
          filename = p_file
        RECEIVING
          retcode  = subrc.
    * Saves Data in an itab from XML File.
      CALL METHOD me->get_data
        IMPORTING
          retcode    = subrc
        CHANGING
          dataobject = t_data[].
    Regards,
    Claudio.

  • 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

  • Adobe reader download problem on mac.  when i try to download reader it says i need adobe air.  when i try to download adobe air it says it's no longer available or supported.  i deleted the old air because i got a message saying i needed to delete it.

    adobe reader download problem on mac.  when i try to download reader it says i need adobe air.  when i try to download adobe air it says it's no longer available or supported.  i deleted the old air because i got a message saying i needed to delete it. what should i do?  my operating system is Mac 10.7.5

    You don't need Adobe AIR to download or install Adobe Reader.
    Try downloading the offline installer from http://get.adobe.com/reader/enterprise/

  • Adobe Reader Printing Problem

    I have a PC with Windows XP SP3. When I try to print a PDF document, I get the following message: "The document could not be printed. There were no pages selected to print." Of course, I had selected the pages to print.
    Recently, I had many problems with Adobe Reader 10, so I removed it and reloaded Adobe 9. Today, when this printing problem appeared, I did a restore on my computer, taking it back a few months. I still have the printing problem.
    Any idea what's wrong? Any idea how to fix it?

    I have Acrobat Pro 9, but the feature I am using is listed under my
    printers.
    If I go to Print, then in the drop-down list of printers, I have PDF -
    which essentially creates a new PDF document.  I don't really understand
    why it worked, but it did.  The Print - PDF is also available to Word,
    Publisher, etc.
    Hope tis works.
    Darlene M. Stoops
    Corps Ministries Communications Consultant
    The Salvation Army Territorial Headquarters
    Canada and Bermuda Territory
    NOTE: New phone number 416-467-3306, or extension 3306. Visit our websites
    for news, updates, and program ideas!
                                                                                    From:       Lindsay_MP <[email protected]>                                                                               
    To:         Darlene Stoops <[email protected]>                                                                               
    Date:       05/17/2011 11:40 AM                                                                               
    Subject:    Adobe Reader Printing Problem                                                                               
    Do you have Acrobat Pro 9? I can't find how to Print to PDF under File.....

  • Open DataSet problem

    Hello Expert:
    I wanna download a excel file from unix server
    the file inculde some Chinese Character.
    Program is:
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    *& Report  YTEST_17
    REPORT  ytest_17.
    *& Report  ZUPLOADTAB                                                  *
    *& Example of Uploading tab delimited file                             *
    *REPORT  zuploadtab                    .
    PARAMETERS: p_infile  LIKE rlgrap-filename
                            OBLIGATORY DEFAULT  '/usr/sap/report/BS_template.xls'.
    *PARAMETERS: p_infile  type string.
    *DATA: ld_file LIKE rlgrap-filename.
    DATA: ld_file TYPE string.
    *Internal tabe to store upload data
    TYPES: BEGIN OF t_record,
        name1 LIKE pa0002-vorna,
        name2 LIKE pa0002-name2,
        age   TYPE i,
        END OF t_record.
    DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
          wa_record TYPE t_record.
    *Text version of data table
    TYPES: BEGIN OF t_uploadtxt,
      name1(10) TYPE c,
      name2(15) TYPE c,
      age(5)  TYPE c,
    END OF t_uploadtxt.
    DATA: wa_uploadtxt TYPE t_uploadtxt,
          wa_upload    TYPE t_record.
    *String value to data in initially.
    DATA: wa_string(255) TYPE c.
    *constants: con_tab(2) TYPE C VALUE '09'.
    *If you have Unicode check active in program attributes then you will
    *need to declare constants as follows:
    *class cl_abap_char_utilities definition load.
    CONSTANTS:
        con_tab  TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
    *START-OF-SELECTION
    START-OF-SELECTION.
      ld_file = p_infile.
      OPEN DATASET ld_file FOR INPUT IN TEXT MODE encoding default.
      IF sy-subrc NE 0.
      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.
            MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
            APPEND wa_upload TO it_record.
          ENDIF.
        ENDDO.
        CLOSE DATASET ld_file.
      ENDIF.
    *END-OF-SELECTION
    END-OF-SELECTION.
    *!! Text data is now contained within the internal table IT_RECORD
    <Display report data for illustration purposes
      LOOP AT it_record INTO wa_record.
        WRITE:/     sy-vline,
               (10) wa_record-name1, sy-vline,
               (10) wa_record-name2, sy-vline,
               (10) wa_record-age, sy-vline.
      ENDLOOP.
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    but a shortdump happened, would u please give some solution
    ShrtText
        You cannot convert the character set.
    &#21457;&#29983;&#20102;&#20160;&#20040;?
        While a text was being converted from code page '4110' to '4102', one of
        the following occurred:
        - an character was discovered that could not be represented in one of
        the two code pages;
        - the system established that this conversion is not supported.
        The running ABAP program, 'YTEST_17' had to be terminated, since the
        conversion could cause incorrect data to be generated.
        683 characters could not be represented (and thus could not converted).
        If 683 = 0, a second or a different error has occurred.
    thank you
    Kevin
    any solution, please..........
    Message was edited by:
            Kevin Gao

    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    *& Report YTEST_17
    REPORT ytest_17.
    *& Report ZUPLOADTAB *
    *& Example of Uploading tab delimited file *
    *REPORT zuploadtab .
    PARAMETERS: p_infile LIKE rlgrap-filename
    OBLIGATORY DEFAULT '/usr/sap/report/BS_template.xls'.
    *PARAMETERS: p_infile type string.
    *DATA: ld_file LIKE rlgrap-filename.
    DATA: ld_file TYPE string.
    *Internal tabe to store upload data
    TYPES: BEGIN OF t_record,
    name1 LIKE pa0002-vorna,
    name2 LIKE pa0002-name2,
    age TYPE i,
    END OF t_record.
    DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
    wa_record TYPE t_record.
    *Text version of data table
    TYPES: BEGIN OF t_uploadtxt,
    name1(10) TYPE c,
    name2(15) TYPE c,
    age(5) TYPE c,
    END OF t_uploadtxt.
    DATA: wa_uploadtxt TYPE t_uploadtxt,
    wa_upload TYPE t_record.
    *String value to data in initially.
    DATA: wa_string(255) TYPE c.
    *constants: con_tab(2) TYPE C VALUE '09'.
    *If you have Unicode check active in program attributes then you will
    *need to declare constants as follows:
    *class cl_abap_char_utilities definition load.
    CONSTANTS:
    con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
    *START-OF-SELECTION
    START-OF-SELECTION.
    ld_file = p_infile.
    <b>
    SET LOCALE LANGUAGE 'JA'. “Specify the language .. JA Is for Japanese
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE encoding NON-UNICODE.</b>
    IF sy-subrc NE 0.
    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.
    MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
    APPEND wa_upload TO it_record.
    ENDIF.
    ENDDO.
    CLOSE DATASET ld_file.
    ENDIF.
    *END-OF-SELECTION
    END-OF-SELECTION.
    *!! Text data is now contained within the internal table IT_RECORD
    <Display report data for illustration purposes
    LOOP AT it_record INTO wa_record.
    WRITE:/ sy-vline,
    (10) wa_record-name1, sy-vline,
    (10) wa_record-name2, sy-vline,
    (10) wa_record-age, sy-vline.
    ENDLOOP.

  • Error on line read dataset p_zfile into it_int

    hi while executing this below code..
    open dataset p_zfile for input in text mode ENCODING DEFAULT.
        if sy-subrc = 0.
          v_one = 1.
          do.
            v_no = v_no + 1.
         *read dataset pzfile  into it_record*_ this is giving short dump as below
    code to read file
    end do
    short dump
    the following error is being prompted
    CONVT_CODEPAGE
    CX_SY_CONVERSION_CODEPAGE
    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
    where
    it_record is type infile_struct,
    and infile_struct is as below
    types: begin of infile_struct,
            data(1150)           type c,
           end of infile_struct.
    and p_zfile is used in fm call file_get_nam
    please suggest this code is working fine in 4.6 c not upgraded to SAP ECC 6.0 this error is occuring in the code
    regarda
    arora

    here is code
    open dataset p_infile for input in text mode ENCODING DEFAULT.
    f sy-subrc = 0.
          v_one = 1.
          do.
            v_no = v_no + 1.
            read dataset p_infile into in_record.        if sy-subrc = 0. here dump is occuring at last record i deleted the last record in the file but again the dump comes on last record only when all records are read and finally when the cursor come to read dataset statement last time
              if v_no <> v_one.
                split in_record at v_tab into wa_record-idno
                                              wa_record-stonumber
                                              wa_record-stolineno
                                              wa_record-sched_line
                                              wa_record-pur_group
                                              wa_record-frmplant
                                              wa_record-frmstglocatin
                                              wa_record-toplant
                                              wa_record-tostglocation
                                              wa_record-material
                                              wa_record-matdesc
                                              wa_record-quantity
                                              wa_record-dockdate
                                              wa_record-splinst1
                                              wa_record-splinst2
                                              wa_record-splinst3
                                              wa_record-splinst4
                                              wa_record-delete
                                              wa_record-block.

Maybe you are looking for

  • Need help: page wont preview in browser properly

    I am stuck designing the layout for this page right now. I'll attach what I have and the sample template that I based it off of. I cant figure out why it seems to display just fine in dreamweaver but when previewing in a browser everything is bunched

  • FaceTime no longer connects when one party abroad

    Both my husband and I have iPads that are wifi only.  When we are both in the US FaceTime works fine no issue.  When my husband goes to the UK we cannot connect the app just rings at my end but it is not ringing at the other end. So in short, it thin

  • Slideshow problems on secondary monitor

    When i hook up my laptop up to a larger monitor Lightroom works fine but then when i click slideshow the large monitor just goes black and the slideshow reverts back to the laptop. Does anybody know of a way i can get the slideshow to show on the lar

  • SAML2 configuration upload metadata file

    Hi experts, currently, we are implementing SAML2 and we have an issue by uploading the metadata.xml within the SAML2 trusted provider tab. I tried to upload the metadata.xml file of the identity provider on service provider site. After clicking uploa

  • Related to component development.

    Hi folks, A very basic jsf question relating to component development. In the component class should all the instance variables have bean type getter and setter property ? If the answer to the previous question is no ,then from a design perspective w