Need a pipe delimiter after every field in the file on application server

Hi ,
i have to transport data in internal table to a file on application server.
I have done this successfully. But the problem is i have to put a pipe
delimiter after every field in the file on application server.
Could yoe plz help in  this issue.
Thanks & Regards
Suresh kumar D

Hi Should,
          I think the below code should solve your problem as i also had  a similar type of requirement and this was the code i had used in my program.
  FIELD-SYMBOLS: <FS> TYPE ANY.
  DATA: L_FLINE TYPE STRING.
Open file for output
  M_CHECK_SELSCR_FNMS O1 O.
  LOOP AT I_TARGET.
Write records to file
    DO.
      ASSIGN COMPONENT SY-INDEX OF STRUCTURE I_TARGET TO <FS>.
      IF SY-SUBRC EQ 0.
        IF SY-INDEX EQ 1.
          MOVE <FS> TO L_FLINE.
        ELSEIF <FS> NE C_PIPE.
          CONCATENATE L_FLINE C_PIPE <FS> INTO L_FLINE.
        ELSE.
          CONCATENATE L_FLINE <FS> INTO L_FLINE.
        ENDIF.
      ELSE.
        TRANSFER L_FLINE TO W_SRVR_NM_O_O1.
        EXIT.
      ENDIF.
    ENDDO.
  ENDLOOP.
Close file
  CLOSE DATASET W_SRVR_NM_O_O1.
  IF SY-SUBRC EQ 0.
    MESSAGE S208(00) WITH TEXT-M02.
  ENDIF.
Regards
Sikha

Similar Messages

  • I use Iplanet web server and my question is, once I make changes to my java file, is it necessary to restart the server after every change to the file(java)??

     

    Hi,
    In your iWS, Go to particular instance config directory
    edit contexts.properties file
    (eg:-/usr/netscape/server4/https-test/config/contexts.properties).
    Do the below changes.
    (uncomment
    context.global.reloadInterval=5
    "And"
    context.global.isModifiedCheckAggressive=true).
    Example:-
    ~~~~~~~~~~~
    # Context properties:
    # context.global.sessionmgr=com.netscape.server.http.session.SimpleSessionManager
    # context.global.sessionmgr.initArgs=
    # context.global.initArgs=initial=0
    # context.global.realPathFromRequest=false
    # context.global.respondCookieVersion=0
    # context.global.sessionExpireOnClose=false
    # context.global.includeTransparency=true
    # context.global.tempDir=/tmp
    context.global.reloadInterval=5
    # context.global.javaBufferSize=0
    # context.global.bufferSize=4096
    # context.global.docRoot=/foo/bar
    # context.global.inputStreamLengthCheck=true
    # context.global.outputStreamFlushTimer=0
    # context.global.uri=/
    # context.global.host=
    # context.global.ip=
    # context.global.authdb=default
    # context.global.classpath=
    # context.global.singleClassLoader=false
    # context.global.contentTypeIgnoreFromSSI=true
    # context.global.parameterEncoding=utf8
    # context.global.sessionCookie=NSES40Session
    context.global.isModifiedCheckAggressive=true
    I hope this will work for you.
    Thanks,
    Daks.
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support.

  • Reading tab delimited file from application server

    Hi All,
    I do know that we need to use Open data set to read a file from application server, but my question is when you use  read DATASET v_file into wa_final -  this wa_final is an work area and also i have mentione an internal table. so do we need to Split the record at tab into the corresponding fields. Append the records into an internal table i_input.????
    Please let me know on this....
    thanks in advance....
    Poonam....

    Hi,
    first see the file contents in application server, how the contents whether the contents seperated by any symbol or not, if the contents seperated by any symbol then you have to split the data before appending to internal table.
    check this code.
    DATA: l_data_string TYPE string.
      filename = p_file.
      OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc EQ 0.
        DO.
          READ DATASET filename INTO l_data_string.
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
          CLEAR k_input.
          SPLIT l_data_string AT '#' INTO k_input-agreement k_input-suffix k_input-status
                k_input-first_name k_input-last_name k_input-job_title k_input-tel k_input-fax k_input-email_address k_input-mob_number.
          APPEND k_input TO i_input.
        ENDDO.
      ENDIF.
    Regards,
    Venu

  • Pipe delimited file on application server.

    Hi , i m creating a text file on application server, i have written below code and file is getting created correctly.  however, i want to create pipe delimited file.  is there any method for this?
    DATA : lv_line(173).
      DATA : l_wa_itab_length(4) TYPE c VALUE '173'.
      IF NOT p_tab[] IS INITIAL.
        SORT p_tab.
        OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.
        IF sy-subrc NE 0.
          MESSAGE 'Error on output file read' TYPE 'E'.
        ELSE.
          LOOP AT p_tab.
            lv_line = p_tab.
            TRANSFER lv_line TO p_file LENGTH l_wa_itab_length.
            CLEAR p_tab.
            CLEAR lv_line.
          ENDLOOP.
          CLOSE DATASET p_file.
        ENDIF.
      ENDIF.
      REFRESH p_tab.

    i m pasting below my entire code.
    REPORT  zmigration_data_download.
    FIELD-SYMBOLS: <fs_table> TYPE STANDARD TABLE.
    DATA: d_table_ref TYPE REF TO data.
    DATA: d_rfc_db_opt TYPE rfc_db_opt.
    DATA: it_opt LIKE rfc_db_opt OCCURS 0 WITH HEADER LINE.
    DATA: d_file  TYPE string.
    PARAMETERS:     p_tab   TYPE dd02l-tabname OBLIGATORY.
    PARAMETERS:     p_file  LIKE rlgrap-filename OBLIGATORY DEFAULT '/usr/sap/tmp/test.txt'.
    SELECT-OPTIONS: s_opt   FOR  d_rfc_db_opt NO INTERVALS.
    START-OF-SELECTION.
      REFRESH it_opt.
      LOOP AT s_opt WHERE sign = 'I' OR option = 'EQ'.
        it_opt-text = s_opt-low.
        APPEND it_opt.
      ENDLOOP.
      CREATE DATA d_table_ref TYPE TABLE OF (p_tab).
      UNASSIGN <fs_table>.
      ASSIGN d_table_ref->* TO <fs_table>.
      IF <fs_table> IS ASSIGNED.
        CLEAR <fs_table>.
        SELECT * FROM (p_tab) INTO TABLE <fs_table>
        WHERE (it_opt).
        IF sy-subrc EQ 0.
          PERFORM download_file TABLES <fs_table> USING p_file.
          MESSAGE i398(00) WITH 'Upload from SAP Successfull'.
        ENDIF.
      ENDIF.
    *&      Form  download_file
          text
         -->P_<FS_TABLE>  text
         -->P_P_FILE  text
    FORM download_file TABLES p_tab USING p_file.
      DATA : lv_line(173).
      DATA : l_wa_itab_length(4) TYPE c VALUE '173'.
      IF NOT p_tab[] IS INITIAL.
        SORT p_tab.
        OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.
        IF sy-subrc NE 0.
          MESSAGE 'Error on output file read' TYPE 'E'.
        ELSE.
          LOOP AT p_tab.
            lv_line = p_tab.
            TRANSFER lv_line TO p_file LENGTH l_wa_itab_length.
            CLEAR p_tab.
            CLEAR lv_line.
          ENDLOOP.
          CLOSE DATASET p_file.
        ENDIF.
      ENDIF.
      REFRESH p_tab.
    ENDFORM.                               " download_file

  • Want to display a space after last field in the output txt file

    hi
    I want to display a space after last field in the output txt file which is generaed by my program on utility server the last field lengyt we have defined is four and in database it is of three characters and requirement is to disppaly the last fourth field as space in the output file w hich is not shown as the txt file automatically gets closed at the third place as it is the last field in the record and ind atabase records are of therss char only but user wants to display this fourth position in the notepad output file as space ( which is last field in the output file)
    eg
    name house  street country
    record output coming in file
    ram   h3      street3  thn      now this thn which is last field the notepad get closed at thn only
    i want to display one space in last field for the whole of output file
    ie ram      h3   street3  thn(space)
        sham   h4  street4   sgp(space)  so on......
    we need to show this space in the output file as blank
    regards
    Arora

    hi Atish
    i am using
    loop at gt_sagadr_outtab into wa_sagadr_outtab
    move wa_sagadr_outtab-country to wa_sagadr_text+223(226).
    endloop
    in this last field ie country i need to display the last 226 as blank as only country key is two char in database so the last space is not shown
    i am not unsing the fM as tolb by  you
    and afterwards
    i am usning
    Concatenate 'Sagadr_' sy-datum sy-uzeit '.dat' into gv_filename_sagadr.
    CALL FUNCTION 'FILE_GET_NAME'
      EXPORTING
      CLIENT                        = SY-MANDT
        LOGICAL_FILENAME              = gc_lfile
        OPERATING_SYSTEM              = SY-OPSYS
        PARAMETER_1                   = gc_param1
        PARAMETER_2                   = gc_send
        PARAMETER_3                   = gv_filename_sagadr
      USE_PRESENTATION_SERVER       = ' '
      WITH_FILE_EXTENSION           = ' '
      USE_BUFFER                    = ' '
      ELEMINATE_BLANKS              = 'X'
      IMPORTING
      EMERGENCY_FLAG                =
      FILE_FORMAT                   =
        FILE_NAME                     =  gv_filepath_sagadr
    EXCEPTIONS
      FILE_NOT_FOUND                = 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.
    and lastly
    open dataset gv_filepath_sagadr for output in text mode encoding default.
        if sy-subrc eq 0.
         loop at gt_sagadr_text into wa_sagadr_text.
         transfer wa_sagadr_text to gv_filepath_sagadr.
         endloop.
        endif.
       close dataset gv_filepath_sagadr.
        if sy-subrc = 0.
        message S002 with gv_filepath_sagadr. "Files & created on Application server
        endif.
    SO NOT SURE WHERE TO USE THE CODE AND HOW

  • I am creating a web form from a template and I need to change a field. It is just a text field at the moment but I need to change it to a field that the customer can fill in. How do I do this?

    I am creating a web form from a template and I need to change a field. It is just a text field at the moment but I need to change it to a field that the customer can fill in. How do I do this?

    See this thread:
    http://answers.acrobatusers.com/Is-add-instructional-text-text-field-disappear-clicked-q19 5078.aspx

  • Read Tab delimited File from Application server

    Hi Experts,
    I am facing problem while reading file from Application server.
    File in Application server is stored as follows, The below file is a tab delimited file.
    ##K#U#N#N#R###T#I#T#L#E###N#A#M#E#1###N#A#M#E#2###N#A#M#E#3###N#A#M#E#4###S#O#R#T#1###S#O#R#T#2###N#A#M#E#_#C#O###S#T#R#_#S#U#P#P#L#1###S#T#R#_#S#U#P#P#L#2###S#T#R#E#E#T###H#O#U#S#E#_#N#U#M#1
    i have downloaded this file from Application server using Transaction CG3Y. the Downloaded file is a tab delimited file and i could not see "#' in the file,
    The code is as Below.
    c_split  TYPE abap_char1 VALUE cl_abap_char_utilities=>horizontal_tab.
    here i am using IGNORING CONVERSION ERRORS in order to avoid Conversion Error Short Dump.
    OPEN DATASET wa_filename-file FOR INPUT IN TEXT MODE ENCODING DEFAULT IGNORING CONVERSION ERRORS.
          IF sy-subrc = 0.
            WRITE : /,'...Processing file - ', wa_filename-file.   
           DO.
          Read the contents of file
              READ DATASET wa_filename-file INTO wa_file-data.
              IF sy-subrc = 0.
                SPLIT wa_file-data AT c_split INTO wa_adrc_2-kunnr
                                                   wa_adrc_2-title
                                                   wa_adrc_2-name1
                                                   wa_adrc_2-name2
                                                   wa_adrc_2-name3
                                                   wa_adrc_2-name4
                                                   wa_adrc_2-name_co
                                                   wa_adrc_2-city1
                                                   wa_adrc_2-city2
                                                   wa_adrc_2-regiogroup
                                                   wa_adrc_2-post_code1
                                                   wa_adrc_2-post_code2
                                                   wa_adrc_2-po_box
                                                   wa_adrc_2-po_box_loc
                                                   wa_adrc_2-transpzone
                                                   wa_adrc_2-street
                                                   wa_adrc_2-house_num1
                                                   wa_adrc_2-house_num2
                                                   wa_adrc_2-str_suppl1
                                                   wa_adrc_2-str_suppl2
                                                   wa_adrc_2-country
                                                   wa_adrc_2-langu
                                                   wa_adrc_2-region
                                                   wa_adrc_2-sort1
                                                   wa_adrc_2-sort2
                                                   wa_adrc_2-deflt_comm
                                                   wa_adrc_2-tel_number
                                                   wa_adrc_2-tel_extens
                                                   wa_adrc_2-fax_number
                                                   wa_adrc_2-fax_extens
                                                   wa_adrc_2-taxjurcode.
    WA_FILE-DATA is having below values
    ##K#U#N#N#R###T#I#T#L#E###N#A#M#E#1###N#A#M#E#2###N#A#M#E#3###N#A#M#E#4###S#O#R#T#1###S#O#R#T#2###N#A#M#E#_#C#O###S#T#R#_#S#U#P#P#L#1###S#T#R#_#S#U#P#P#L#2###S#T#R#E#E#T###H#O#U#S#E#_#N#U#M#1
    And this is split by tab delimited and moved to other variables as shown above.
    Please guide me how to read the contents without "#' from the file.
    I have tried all possible ways and unable to get solution.
    Thanks,
    Shrikanth

    Hi ,
    In ECC 6 if all the unicode patches are applied then UTF 16 will defintly work..
    More over i would suggest you to ist replace # with some other  * or , and then try to see in debugging if any further  # appears..
    and no # appears then try to split now.
    if even now the # appears after replace statement then try to find out what exactly is it... wheather it is a horizantal tab etc....
    and then again try to replace it and then split..
    Please follow the process untill all the # are replaced...
    This should work for you..
    Let me know if you further face any issue...
    Regards
    Satish Boguda

  • How can we read some bytes from every line of the file

    How can we read some bytes from the every line of the file moving on to the next line
    without using the read line

    Actualiy readLine() takes more execution time
    for reading a part of line if we can do so without
    readLine() we can save some time...Well, if you knew, beforehand, the length of each line, you could use RandomAccessFile and its seek method, but, since you don't, you would have to read the rest of the line character-by-character, checking to see if it is a newline, in order to place the "cursor" at the beginning of the next line in order to read the next few characters you want.
    So, as you can see, you will need to read the entire line anyway (and if you do it yourself you also have to do the checking yourself considering all three possible end-of-line sequences), so you just as well use readLine().
    Some people may suggest Scanner and it's nextLine() method, but that also needs to read the rest of line (as evidenced by the fact that it returns it), so that is no different than the readLine() (or read it yourself) solution.

  • Urgent.... Help Needed for Storing file in Application Server

    Hi All,
    I have a requirement where in I have to save a file in Application Server.
    File is of 141 Character Length, so there can be spaces left at the end.
    When I am downloading the file into Application Sever and then downloading the same file from Application Server to Presentation into a notepad then the spaces at the end are truncating.
    I want that the file that is generated should be of 141 character though if there may be spaces at the end.
    It will be great if you can help me out in this.
    Thanks in Advance.
    Jayant Sahu.

    when downloading to App server, you need to specify the LENGTH option on your TRANSFER ststement to keep fixed length.  You must also use a STRING type variable in your transfer.
    From Documentation on Transfer command:
    <b>If the file was opened as a text file or a legacy text file, the trailing blank characters are deleted for all data objects, except for those of data type string. The line end marker defined when the file was opened is then added to the remaining content of the data object or to the result of the conversion, and the final result is written byte-by-byte to the file.</b>
    There also used to be a problem with WS_DOWNLOAD - you had to do the following:
    Maintaining Trailing spaces when downloading to PC
    Before calling DOWNLOAD or WS_DOWNLOAD, do a perform SET_TRAIL_BLANKS(saplgrap) using 'X'
    To set the length of each record including your blanks add this code: perform SET_FIXLEN(saplgrap) using '0' '100'
    Don't think this is needed any more.
    Andrew

  • IPhoto: After I've changed the file name/format in Finder iPhoto can't load/relink to the referenced file.

    After I've changed the file name/format in Finder iPhoto can't load/relink to the referenced file anymore. For some reasons I don't like to reimport the file.

    Hmm the advice has been not to use referenced libraries - you ignored and did it anyway and you find the advise not helpful
    Furthermore the advice is that if you choose to use a referenced library that you assure that the path never changes - you also choose to ignore that advice and do it anyway - and you blame the peopson trying to help you
    once again - you have one choice - change the file names back and put the files back in the exact same place - and again you are totally ignoring the advice and instead name calling and attacking the person giving you advice
    Maybe life would be easier if you followed advice rather than ignoring it and then complaining that things no longer work
    change the name back and you will be fine until the next problem you hit that is caused by choosing a referenced library
    Have a nice day
    LN

  • Need Sample code to upload the data to Application Server

    Hi ,
    I need to upload the data to application server.
    The output should be an XML file.
    Can anybody send me sample code for this.
    Reward points are assured.
    Best Regards
    Bhagat.

    may be this code wil help ,first to downjload the XML fine -
    1)
    REPORT  zhr_test2_tk.
    TYPE-POOLS: ixml.
    TYPES: BEGIN OF xml_line,
            data(256) TYPE x,
           END OF xml_line.
    DATA: l_ixml            TYPE REF TO if_ixml,
          l_streamfactory   TYPE REF TO if_ixml_stream_factory,
          l_ostream         TYPE REF TO if_ixml_ostream,
          l_renderer        TYPE REF TO if_ixml_renderer,
          l_document        TYPE REF TO if_ixml_document.
    DATA: l_element_position TYPE REF TO if_ixml_element,
          l_element_title    TYPE REF TO if_ixml_element,
           l_element_flight  TYPE REF TO if_ixml_element,
           l_element_from    TYPE REF TO if_ixml_element,
           l_element_to      TYPE REF TO if_ixml_element,
            l_element_dummy   TYPE REF TO if_ixml_element,
             l_value           TYPE string.
    DATA: l_xml_table       TYPE TABLE OF xml_line,
          l_xml_size        TYPE i,
          l_rc              TYPE i.
    DATA: lt_erec TYPE TABLE OF hrp5126,
          l_erec TYPE hrp5126.
    DATA: date(10),
          time(4),
          filepath TYPE string.
    CONSTANTS: filedir TYPE string VALUE 'C:\tmp\',
               filename TYPE string VALUE 'ZHR_test'.
    START-OF-SELECTION.
    fill internal table
      SELECT * FROM hrp5126 INTO TABLE lt_erec.
    Start filling xml DOM object from internal table lt_erec.
      LOOP AT lt_erec INTO l_erec.
    *Create the root node 'position'
        IF sy-tabix EQ 1.
        create an ixml factory
          l_ixml = cl_ixml=>create( ).
        create Document Object Model
          l_document = l_ixml->create_document( ).
       Fill root node with value 'position'
          l_element_position = l_document->create_simple_element(
                         name   = 'position'
                         parent = l_document ).
        ENDIF.
        IF sy-tabix GT 1.
        create element jobtitle as child of position
          l_value = l_erec-jobtitle.
          l_element_title = l_document->create_simple_element(
                             name   = 'job_title'
                             parent = l_element_position
                             value  = l_value ).
          l_value = l_erec-empl_start_date.
          l_element_dummy = l_document->create_simple_element(
                             name   = 'StartDate'
                             parent = l_element_title
                             value  = l_value ).
          l_value = l_erec-empl_end_date.
          l_element_dummy = l_document->create_simple_element(
                             name   = 'EndDate'
                             parent = l_element_title
                             value  = l_value ).
        ENDIF.
      ENDLOOP.
      IF sy-subrc NE 0.
        WRITE: 'No data in table hrp5125'.
      ENDIF.
    create a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
    connect internal XML table to streamfactory
      l_ostream = l_streamfactory->create_ostream_itable(
                      table = l_xml_table ).
    render the document
      l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                            document = l_document ).
      l_rc = l_renderer->render( ).
    Get time and date
      WRITE sy-uzeit2(2) TO time2(2).
      WRITE sy-uzeit0(2) TO time0(2).
      WRITE sy-datum4(2) TO date0(2).
      WRITE sy-datum6(2) TO date2(2).
      WRITE sy-datum0(4) TO date4(4).
    *Build filename with date and time reference
    CONCATENATE filedir filename date time '.xml' INTO filepath.
    <i>* This is the code I hope to modify in order to save the xml structure on the application server, with a specified filepath.</i>
    <b>  OPEN DATASET filepath FOR OUTPUT IN BINARY MODE.
      LOOP AT lt_erec into l_erec.
        TRANSFER  l_erec TO filepath.
      ENDLOOP.
      CLOSE DATASET filepath.</b>
    save XML document
      l_xml_size = l_ostream->get_num_written_raw( ).
    *This is the code for download to local computer
    CALL METHOD cl_gui_frontend_services=>gui_download
       EXPORTING
         bin_filesize            = l_xml_size
         filename                = filepath
         filetype                = 'BIN'
       CHANGING
         data_tab                = l_xml_table
       EXCEPTIONS
         file_write_error        = 1
         no_batch                = 2
         gui_refuse_filetransfer = 3
         invalid_type            = 4
         no_authority            = 5
         unknown_error           = 6
         header_not_allowed      = 7
         separator_not_allowed   = 8
         filesize_not_allowed    = 9
         header_too_long         = 10
         dp_error_create         = 11
         dp_error_send           = 12
         dp_error_write          = 13
         unknown_dp_error        = 14
         access_denied           = 15
         dp_out_of_memory        = 16
         disk_full               = 17
         dp_timeout              = 18
         file_not_found          = 19
         dataprovider_exception  = 20
         control_flush_error     = 21
         OTHERS                  = 22.
    IF sy-subrc <> 0.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    2) uploading tht PC XML file to APPliaction server -
    DATA rec like QISRS_XML_LINE.
    OPEN DATASET filepath FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    LOOP AT l_xml_table into rec.
    TRANSFER rec TO filepath.
    ENDLOOP.
    CLOSE DATASET filepath.

  • How to skip one field from the file by using sqlldr

    Hi ,
    i'm using DB 10g R2 on Redhat ,
    my control file hereunder ,
    LOAD DATA
    INTO TABLE reber.AAA_BILL
    APPEND
    REENABLE DISABLED_CONSTRAINTS
    EXCEPTIONS reber.AAA_BILL
    FIELDS TERMINATED BY '|'
    (Streamnumber ,
    MDN ,
    USERNAME ,
    DOMAIN ,
    USERIP ,
    CORRELATION_ID ,
    ACCOUNTREASON ,
    STARTTIME ,
    PRIORTIME ,
    CURTIME ,
    SESSIONTIME  ,
    SESSIONVOLUME ,
    RATEPOLICYIDX ,
    FEE ,
    GROUPID ,
    SERVICEID)and this is one records of the file ,
    222|1|0664363446|12D0DC90||10.15.6.45|007b8aa5|3|20111029204824|20111029204824|20111029211504|1600|0|147|0|4000|10154|really i want to skip the first field in the file which is (222|) and starting from the second field ,
    any help please

    Thank you for you reply ,
    really i know the Filler to skip colomn from the table , is the Filler working also to skip field from the File . i'll read the link to check this

  • Create Excel file in application server but the field value is incorrect

    Hi Experts,
    i am facing a problem when create excel file in application server using OPEN DATASET command.
    the internal table have 4 field and one of those field contains 19 digit number --> ICCID.
    the code running well, successfully create EXCELfile in application server but the problem is SAP only copy exactly first 15 digit numeric only and the rest became zero 0
    Example :
    the field value in internal table is 8962118800000447654 but when i opened in the excel file the value became 8962118800000440000.
    and if i add alphabet like a8962118800000447654 then it is correct.
    is there is anything wrong with my code?
    here is my code
    CONSTANTS: c_tab TYPE abap_char1 VALUE cl_abap_char_utilities=>horizontal_tab. "Tab Char
    Data : begin of lt_zdsdmmdt00005 occurs 0,
             SERNR (18) type c,
             MSISDNl(20) type c,
             BOX1 (20) type c,
             ICCID(30) type c,
           end of lt_zdsdmmdt00005.
    data : ld_temp(100) type c.
    i_file = '/usr/sap/DM/test_excel.xls'.
    open dataset i_file for output in legacy text mode.
      loop at lt_zdsdmmdt00005.
        move lt_zdsdmmdt00005-ICCID to ld_iccid .
        concatenate lt_zdsdmmdt00005-sernr  lt_zdsdmmdt00005-MSISDN  lt_zdsdmmdt00005-BOX1 ld_iccid
        into ld_temp separated by c_tab.
        transfer ld_temp to i_file.
      endloop.
      close dataset i_file.
    Best Regard,
    Akbar.

    Hi Naveen,
    thanks for your reply,
    i already tried and the result still the same. any idea?
    Best Regard,
    Akbar.

  • Field Values being changed in the flat file on Application Server

    Hi All,
    I am loading a flat file(.CSV) from Application server. The file has some characteristic fields, for ex: CNUM of type Char, length 20. But it has got the value which is of 10 char length, say XYZ1234XAB. When I load the same fiel from client workstation, the load was successful but when I load it from Application server, the load has failed and the error is Invalid/Hex. characteristics for this record and many such records.
    When I checked the file on the application server the value 'XYZ1234XAB' is being displayed as 'XYZ1234XAB   #' and it is also being loaded with '#'. This is the cause of the error.
    Why is the value being changed on the application server? What can I do to overcome this?
    Thanks,
    RPK.
    Message was edited by:
            RPK

    Hi Ganesh,
    I have already loaded data to my ODS and when activating it is giving error "Value 'XYZ123XABC   #' (hex. '123456....') of characteristic CNUM contains invalid chara".
    I also have some lower case char in some of the records for the same field. The file is huge and cannot change the file, infact I have many such files. Is there any other way to overcome this?
    Thanks,
    RPK

  • Code for reading particular  fields from the file placed in application

    hi,
    code for reading particular  fields from the file placed in application server in to the internal table.

    Hi,
    Use the GUI_UPLOAD FM to upload the File into ur Internal Table.
    DATA : FILE_TABLE TYPE FILE_TABLE OCCURS 0,
             fwa TYPE FILE_TABLE,
             FILENAME TYPE STRING,
             RC TYPE I.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
      EXPORTING
        WINDOW_TITLE            = 'Open File'
       DEFAULT_EXTENSION       =
       DEFAULT_FILENAME        =
       FILE_FILTER             =
       INITIAL_DIRECTORY       =
       MULTISELECTION          =
       WITH_ENCODING           =
      CHANGING
        FILE_TABLE              = FILE_TABLE
        RC                      = RC
       USER_ACTION             =
       FILE_ENCODING           =
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 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.
    READ TABLE FILE_TABLE INDEX 1 into fwa.
    FILENAME = fwa-FILENAME.
        CALL FUNCTION 'GUI_UPLOAD'
             EXPORTING
                  filename                = filename
                  FILETYPE                = 'DAT'
           IMPORTING
                FILELENGTH              =
             TABLES
                  data_tab                = itab
             EXCEPTIONS
                  file_open_error         = 1
                  file_read_error         = 2
                  no_batch                = 3
                  gui_refuse_filetransfer = 4
                  invalid_type            = 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.
    Regards,
    Balakumar.G
    Reward Points if helpful.

Maybe you are looking for