Incorrect entries from application server file read dataset .
As i am using below code for fetching file data from application server to internal table in custom report.
data in internal table in inconsistent is there any another way to do in?
report zparoman.
TYPES: BEGIN OF ty_bkpf, " STRUCTURE DEFINATION bkpf
belnr TYPE belnr_d ,
bukrs TYPE bukrs,
gjahr TYPE gjahr,
bldat TYPE bldat,
cpudt TYPE cpudt,
waers TYPE waers,
blart TYPE blart,
budat TYPE budat,
xblnr TYPE xblnr1,
bktxt TYPE bktxt,
END OF ty_bkpf.
DATA: it_bkpf TYPE STANDARD TABLE OF ty_bkpf INITIAL SIZE 0, " INTERNAL TABLE it_BKPF
wa_bkpf TYPE ty_bkpf. " work area wa_bkpf
TYPES: BEGIN OF ty_bseg,
belnr TYPE belnr_d,
bukrs TYPE bukrs,
buzei TYPE buzei,
bschl TYPE bschl,
umskz TYPE umskz,
hkont TYPE hkont,
zterm TYPE dzterm,
wrbtr TYPE wrbtr,
kostl TYPE kostl,
prctr TYPE prctr,
mwskz TYPE mwskz,
sgtxt TYPE sgtxt,
zuonr TYPE dzuonr,
zlspr TYPE dzlspr,
zlsch TYPE schzw_bseg,
END OF ty_bseg.
DATA: it_bseg TYPE STANDARD TABLE OF ty_bseg INITIAL SIZE 0, "internal table it_bseg
wa_bseg TYPE ty_bseg. "work area wa_bseg
TYPES:BEGIN OF ty_final, " final structue defn
header TYPE c LENGTH 3,
belnr TYPE c LENGTH 10,"belnr_d,
bukrs TYPE c LENGTH 4,"bukrs,
gjahr TYPE c LENGTH 4,"gjahr,
bldat TYPE c LENGTH 8,"bldat,
cpudt TYPE c LENGTH 8,"cpudt,
waers TYPE c LENGTH 5,"waers,
blart TYPE c LENGTH 2,"blart,
budat TYPE c LENGTH 8,"budat,
xblnr TYPE c LENGTH 16,"xblnr1,
bktxt TYPE c LENGTH 25,"bktxt,
buzei TYPE c LENGTH 3,"buzei,
bschl TYPE c LENGTH 2,"bschl,
umskz TYPE c LENGTH 1,"umskz,
hkont TYPE c LENGTH 10,"hkont,
zterm TYPE c LENGTH 4,"dzterm,
wrbtr TYPE c LENGTH 13,"wrbtr,
kostl TYPE c LENGTH 10,"kostl,
prctr TYPE c LENGTH 10,"prctr,
mwskz TYPE c LENGTH 2,"mwskz,
sgtxt TYPE c LENGTH 50,"sgtxt,
zuonr TYPE c LENGTH 18,"dzuonr,
zlspr TYPE c LENGTH 1,"dzlspr,
zlsch TYPE c LENGTH 1,"schzw_bseg,
END OF ty_final.
DATA: it_final TYPE STANDARD TABLE OF ty_final INITIAL SIZE 0, " final internal table it_final
wa_final TYPE ty_final. " work area wa_final
TYPES: BEGIN OF temp_str,
wa_string(5000) TYPE c,
END OF temp_str.
DATA:it_str TYPE TABLE OF temp_str,
wa_str TYPE temp_str.
DATA: gv_file TYPE rlgrap-filename.
gv_file = 'E:\USR\SAP\ECS\SYS\CSL_FIGL_TRANS_DATA_04172014162215.TXT'.
OPEN DATASET gv_file FOR INPUT IN TEXT MODE ENCODING DEFAULT. "Opening file from Application server
IF sy-subrc EQ 0.
* DO 2 TIMES.
DO.
READ DATASET gv_file INTO wa_str.
IF sy-subrc = 0.
APPEND wa_str TO it_str.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDIF.
* WRITE:/ 'HELLO'.
LOOP AT it_str INTO wa_str.
split wa_str at ' ' into
wa_final-header
wa_final-belnr
wa_final-bukrs
wa_final-gjahr
wa_final-bldat
wa_final-cpudt
wa_final-waers
wa_final-blart
wa_final-budat
wa_final-xblnr
wa_final-bktxt
wa_final-buzei
wa_final-bschl
wa_final-umskz
wa_final-hkont
wa_final-zterm
wa_final-wrbtr
wa_final-kostl
wa_final-prctr
wa_final-mwskz
wa_final-sgtxt
wa_final-zuonr
wa_final-zlspr
wa_final-zlsch.
" Split the string separated by SPACE
append wa_final to it_final.
ENDLOOP.
Hi ,
Try to open the file with encoding UTF-8 :
Open dataset file for INPUT in TEXT MODE ENCODING UTF-8 .
Regards
Similar Messages
-
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 YouWoah ... 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 -
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 Bhatiadelete this line DEFAULT WITH WINDOWS LINEFEED and check this..
-
Dump while downloading data from Application Server File in 4.6 system
Hi,
When we are trying to upload data from Application Server to internal table using dataset statements, it is resulting in a dump. System we are using is 4.6c.
When we faced similar kind of issue in ECC version, we have used the statement, Ignoring Conversion Errors.
Please let me know how to handle this situation in 4.6 System.
Thanks for your inputs.
Regards,
PhaniHi All,
I am sorry. My question was wrong. It should be while uploading data from internal table to application server, if there are any special characters, it is going to dump.
I will let you know the dump details and code at the earliesst.
Sorry and Thanks again for your prompt response.
Regards,
Phani. -
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. -
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 ADVANCEHI,
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. -
Split tab delimited file coming from application server.
Hi,
i have received a tab delimited file from the application server.it contains # instead of tab at the application server.
i want to know how to split it.
i tried decalring constant as:
c_tab type x value'09'.
but it gives an error saying only c,n,d and t types are allowed.
please gelp.
Thanks,
Anand.Hi,
Do like this
*--Local Variables
DATA : l_file TYPE string,
l_line TYPE string.
*--Clear
CLEAR : l_file.
l_file = p_ipfile.
*--Read the data from application server file.
OPEN DATASET l_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
*--Error in opening file
MESSAGE i368(00) WITH text-005.
ENDIF.
*--Get all the records from the specified location.
DO.
READ DATASET l_file INTO l_line.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT l_line AT cl_abap_char_utilities=>horizontal_tab
INTO st_ipfile-vbeln
st_ipfile-posnr
st_ipfile-edatu
st_ipfile-wmeng.
APPEND st_ipfile TO it_ipfile.
ENDIF.
ENDDO.
*--Close dataset
CLOSE DATASET l_file.
Regards,
Prashant -
Picking of Adobe forms from application server
Hi Gurus
We have SAP ECC 6.0. So far in our system we have text files and CSV excel files which comes from external system and lies in application sever and these are being picked up automatically by system and gets processed in SAP.
1)The requirement is to "pick the adobe forms from application server and read some fields in the form and update the fields (required) in customer master data in SAP". How can we achieve this?
Any kind of help is appreciated.
Thanks
AleemHi Aleem,
I tried to work on a similar scenario couple of months back. But it was not successful. Will you please let me know if you get any solution???
Thanks in advance
Poornima -
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,
KarthikHi,
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 -
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 -
Unable to read file from application server
Hi guys,
I am reading file(could be any extension) from application server,but some time i am successfuly able to read file and sometime unable to read,why its happening .
my code is here
OPEN DATASET E_FILE FOR INPUT IN BINARY MODE . "
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.
Thanks
Ankur SharmaHi,
What actually happens? Do you get a short dump? Do you get a return code ne 0? Does it run fine but you get no data in your table?
We aren't mind-readers and can't help much without more information.
Try using transaction AL11 to see if you access the files you are trying to open.
Gareth. -
Uploading and reading file from application server
Hi
My problem is when am uploading a file to application server it is getting stored in
usr/sap/transyp1/prod/in directory
after that i want to read that file from application server to update database
when using below code it is showing some other directory in f4 help
DATA: lv_hostname TYPE msxxlist-name.
DATA: lv_server TYPE bank_dte_jc_servername.
PARAMETERS: p_file TYPE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'BANK_API_SYS_GET_CURR_SERVER'
IMPORTING
e_server = lv_server.
lv_hostname = lv_server.
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = 'P_FILE'
dyname = sy-cprog
dynumb = '1000'
filetype = 'P'
location = 'A'
server = lv_hostname.
experts could you please help me out
Thanks & Regards
Nagesh.ParuchuriUser Transaction file. You will get all logical file path names.
used following fucntion module to read file name and use command open dataset to read the file.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
CLIENT = SY-MANDT
LOGICAL_FILENAME = C_LOGICAL_FILENAME
OPERATING_SYSTEM = SY-OPSYS
PARAMETER_1 = P_IN_FILENAME
IMPORTING
FILE_NAME = P_OUT_FILENAME
EXCEPTIONS
FILE_NOT_FOUND = 1
OTHERS = 2.
OPEN DATASET P_OPEN_FILE ENCODING UTF-8 IN TEXT MODE FOR OUTPUT.
IF SY-SUBRC <> 0.
MESSAGE E000(38) WITH 'Error in Opening file: ' V_PHY_FILENAME.
ENDIF. -
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 -
Read Tilda separated file from Application Server
I have a requirement to read a tilda separated file from application server and write a tilda separeted output to application server. Please suggest how to to get data from tilda separated file to internal table ? and also How to create a tilda separated file from internal table to application server.
Hi again,
This some sample code for outputing data on application server with tilda separator.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT. " MESSAGE msg.
IF sy-subrc <> 0.
message i812(LQ).
LEAVE LIST-PROCESSING.
ENDIF.
LOOP AT gs_input INTO wa_input.
CONCATENATE wa_input-wadat_ist
wa_input-sort2
wa_input-name1
wa_input-street
wa_input-region
wa_input-post_code1
wa_input-zzchep
wa_input-vbeln
wa_input-bstkd
wa_input-zfrom
wa_input-zland
wa_input-zccode
wa_input-zrcvd
wa_input-zfref
wa_input-znorc
wa_input-zsepr
wa_input-zvers
wa_input-zlout
wa_input-zinfo
wa_input-zinco
wa_input-zsqal
wa_input-zscod
wa_input-zrqal
wa_input-zeqal
wa_input-zecod
wa_input-zcust
wa_input-ztran INTO g_path SEPARATED BY '~'.
TRANSFER g_path TO p_file.
CLEAR : g_path, wa_input.
ENDLOOP.
CLOSE DATASET p_file.
Hope this will be helpful for you.
Regards,
Vijay -
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,
ShrikanthHi ,
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
Maybe you are looking for
-
Problem with subsequent deltas after converting Full requests to Repair.
Hi All, We are working on changing an existing system from loading from multiple extractors directly to a cube to loading each extractor to its own DSO and then combining the data in a 'consolidated' DSO and then on the the cube. To avoid downtime in
-
Frame Moving Runtime using Look and Feel
Hi All, I need creating Frame Moving runtime using Look and feel (Oracle forms 10 g with swing concept). If any bodies know give me a idea and demo files. Thanks and Regards M.Sathiya
-
Iphoto library failed to finish opening (iphoto library manager)
My iphoto library is on an external harddrive and opens (however, without showing the actual picture thumbnails but only the frames where the pictures should be; as long as i am scrolling, i can see the actual pictures). The Iphoto library manager gi
-
hello all, i have a requirement like this, there are two select statements like below select * from IFLO appending corresponding fields of table it_itab_33kv where begru eq '006F' and fltyp eq '6'. select * from IFLO appending corresponding fields of
-
Change language in RFKORD10_PDF
Hi guru's, I try to modify the language parameter (SPRAS) but RFKORD10_PDF is a standard program. I try to modify before to proceed the printing. Is there an enhancement or something like that? I checked but did not find anything. Thank in you advanc