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,
Phani
Hi 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.
Similar Messages
-
Problem while downloading data from Application server.
Hi
I have create a file on the application server.
When i tried to download the file from application server into Excel file , all the fields in the file appear in the same column.
How can place the fields separately in different columns in the Excel.
Thanks
Subha
Edited by: subhacp on Sep 5, 2011 8:32 AMHi,
Try to use below function module where you need not to do anything new, just give path of the directory where you want to store on your workstation in the parameter I_FILE_FRONT_END and give path of your application server from where you want to pick file which is in .XLS format in the FM parameter I_FILE_APPL .
It will simply copy the file from Apllication server to your workstation in the same format and with the same characters.
CALL FUNCTION 'C13Z_FILE_DOWNLOAD_BINARY'
EXPORTING
I_FILE_FRONT_END = pr_down
I_FILE_APPL = l_w_file
I_FILE_OVERWRITE = 'X'
* IMPORTING
* E_FLG_OPEN_ERROR =
* E_OS_MESSAGE =
EXCEPTIONS
FE_FILE_OPEN_ERROR = 1
FE_FILE_EXISTS = 2
FE_FILE_WRITE_ERROR = 3
AP_NO_AUTHORITY = 4
AP_FILE_OPEN_ERROR = 5
AP_FILE_EMPTY = 6
OTHERS = 7
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Hope it will solve your query. -
Error while loading data from application server
Hi all,
Am facing a problem while loading data from application server.
The error i get is ....
*" The argument ' Rental/Lease ' cannot be interpreted as a number while assigning character to application structure*.
'Rental/Lease' is a value for a character infoobject length 30. I checked for the sequence of fields in data source and the sequnce of values am receiving in application server and the sequence match.
when i copy these values into a CSV onto a desktop and load,load is successful.
Please let me know your views.
Thanks&Regards,
PraveenIt looks like the system is trying to convert Rental/Lease to a number format. Is the info object type CHAR or NUMC or ??? I would look there.
Also, make sure / is in RSKC.
Brian -
Problem in downloading data from application server
Hi,
I tried the following code for downloading data to PC in background:
PARAMETERS: p_file LIKE rlgrap-filename OBLIGATORY.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc = 0.
LOOP AT itab INTO istab.
TRANSFER istab TO p_file.
ENDLOOP.
ENDIF.
Here, the contents are not getting transferred to the p_file. I give the path of the file while executing the program.
First of all, the file is not getting created in PC. And the statement 'OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT'. is working but unable to read after that using READ DATASET statement.HI,
You can use this code .............
OPEN DATASET gv_dataset for input in text mode encoding default.
IF sy-subrc = 0.
DO.
clear gv_rec.
READ DATASET gv_dataset INTO gv_rec.
if sy-subrc <> 0.
append gv_rec to gt_raw.
exit.
endif.
append gv_rec to gt_raw.
ENDDO.
CLOSE DATASET gv_dataset.
ELSE.
gv_retcode = 1.
ENDIF.
Regards,
jayan -
Download 350MB of data from Application Server to Presentation server
i want to Download 350MB(Around 2.5Million record of Table BSEG) of data from Application Server to Presentation server..
i have tried with the transaction CG3Y and program using open dataset,read dataset,close dataset,ws_download...but went in vain,,,ended with TIMEOUT ERROR..will OPEN DATASET 'path' FOR OUTPUT FILTER 'Compress' be helpful
..please help me ..its urgent..you can do the FTP with Unix commands..
initially connect to the application server by using command
FTP <app server ip>,then it willl ask for username and password... after successful connection you can use the following commnads to transfer file
lcd <destination path name>(set the dest path)
cd <source path>(set the sorce path),
get <filename to be transfererd>( do the transfer)....
You can do same with ABAP code also, for this you need to use some function modules like..
FTP_CONNECT ( to establish the connection)
FTP_COMMAND ( to execute the commands like cd, lcd get,put)
finally FTP_DISCONNECT to close the open connection...
for further details refer standard program RSFTP002,RSFTP003....
reward points if helpful... -
How to get data from application server
hi experts,
when i load data from application server(.csv file) to ODS, data all goes one column.
in infopackage exterdata tabstrip i have given the below values.
escape sign is "
data separator is ,
separator for thousands is ,
my sample data:
"1010000";"A410";"03.2008";"113.5704531"
"1010000";"A410";"04.2008";"93.1146410"
any ideas..
SiriHi Siri,
You should look in the T.Code :RSCUSTV1
BW:Settings for Flat File
Thousand separator
Dec. point separator
Field separator
Field delimiter
Then you can use the Same Characterstics while creating the Flat file & also passing the same in Info Package
This will resolve your issue
Regards
Hari -
How to bring the data from application server to presentation server
hi,
i have one problem,i have written the program which will open the files in the application server when we run the program in the background(sm37),the same data from application server i want to bring into presentation server in the format of (.csv),how to bring the data from application to presentation server can any body help me on this topic.folowing is the code .
*& Report ZPFA_HIER_LOAD
REPORT ZFPA_HIER_LOAD.
*---- Declaration of Oracle connectioN
DATA con_name LIKE dbcon-con_name VALUE 'COMSHARE'.
DATA: MFL1(9),MFL2(5),MFL3(9),MFL4(2),MFL5(8) TYPE c.
DATA : mfilename type string.
data: begin of matab1 occurs 0,
MFL1(9) TYPE C,
MFL2(5) TYPE C,
MFL3(9) TYPE C,
MFL4(2) TYPE C,
MFL5(8) TYPE C ,
end of matab1 .
data: setid(8) type c.
data: begin of source occurs 0,
setid(8) type c,
end of source.
*PARAMETERS : p_pfile LIKE filename-FILEEXTERN.
*PARAMETERS : m_bsenty(8). " type c obligatory.
*mfilename = P_PFILE.
EXEC SQL.
SET CONNECTION :con_name
ENDEXEC.
EXEC SQL.
CONNECT TO :con_name
ENDEXEC.
EXEC SQL PERFORMING get_source.
SELECT set_id FROM UNIT_SET INTO
:setid
ORDER BY SET_ID
ENDEXEC.
start-of-selection.
LOOP AT SOURCE.
REFRESH matab1. CLEAR matab1.
EXEC SQL PERFORMING evaluate.
SELECT TO_CHAR(MEM_ID),TRIM(TO_CHAR(MEM_PID)) FROM UNIT_TREE INTO :MFL1,
:MFL5
where set_id = :SOURCE-SETID ORDER BY MEM_ID
ENDEXEC.
if SOURCE-SETID = '80000000'.
mfilename = '/tmp/aesorg'.
elseif SOURCE-SETID = '80000006'.
mfilename = '/tmp/Consolidation_Manager'.
elseif SOURCE-SETID = '80000010'.
mfilename = '/tmp/10org'.
elseif SOURCE-SETID = '80000012'.
mfilename = '/tmp/20org'.
elseif SOURCE-SETID = '80000018'.
mfilename = '/tmp/30org'.
elseif SOURCE-SETID = '80000025'.
mfilename = '/tmp/40org'.
Endif.
mfilename = '/usr/test.dat'.
************************This was i tried***********************
open dataset mfilename for output in text mode encoding default." IN
*TEXT MODE ENCODING DEFAULT.
if sy-subrc <> 0.
exit.
endif.
close dataset mfilename.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = MFILENAME
FILETYPE = 'ASC'
TABLES
data_tab = matab1
EXCEPTIONS
file_write_error = 1
invalid_type = 2
no_authority = 3
unknown_error = 4
OTHERS = 10.
loop at matab1 .
transfer matab1 to mfilename.
endloop.
clear matab1.
ENDLOOP.
loop at matab1 .
transfer matab1 to mfilename.
endloop.
close dataset mfilename.
MFL5 = '0'.
CLEAR MFL5.
FORM evaluate.
if MFL5 = -1.
MFL5 = ''.
ENDIF.
concatenate MFL1 ',' into MFL1.
concatenate MFL1 ',' into MFL3.
matab1-MFL1 = MFL1.
matab1-MFL2 = 'ZBUE,'.
matab1-MFL3 = MFL3.
matab1-MFL4 = ' ,'.
matab1-MFL5 = MFL5.
append matab1 .
CLEAR MFL1.
CLEAR MFL2.
CLEAR MFL3.
CLEAR MFL4.
CLEAR MFL5.
ENDFORM.
"evaluate
*& Form GET_SOURCE
text
FORM GET_SOURCE.
source-setid = setid.
append source.
clear source.
ENDFORM. "GET_SOURCEHi Rammohan,
You cannot use OPEN DATASET to transfer data from application server to presentation server.
You can do the following :
<b>Do 1st point in BACKGROUND</b>
1. Read the data file from application server into an internal table using OPEN DATASET
<b>Do 2nd point in Foreground</b>
2. Once you get the data into an internal table, then use FM GUI_DOWNLOAD to download it on presentation server
You cannot use the above 2 point together in Background because its not possible. Hence you need program it partially in background and partially in foreground.
Best regards,
Prashant -
How to upload data from application server
Hi,
please help me out in uploading the data from application server which is a tab delemited file into an internal table.
Thanks
kumarhi,
Use this sample code as an example.
table declaration
tables: mara.
*data declaration
data: begin of it_lfa1 occurs 0,
vendor like lfa1-lifnr,
land1 like lfa1-land1,
name1 like lfa1-name1,
ort01 like lfa1-ort01,
end of it_lfa1.
selection screen
selection-screen: begin of block b1 with frame.
parameters: p_file type rlgrap-filename obligatory.
selection-screen: end of block b1.
at selection screen
at selection-screen on value-request for p_file.
*& start-of-selection
start-of-selection.
perform transfer_file using p_file.
perform write.
*& Form transfer_file
text
-->P_P_FILE text
form transfer_file using p_p_file.
data: l_message(30) type c.
***opening dataset for reading
open dataset p_p_file for input in text mode encoding default message
l_message.
if sy-subrc ne 0.
message i001(zerr2) with p_p_file.
endif.
*******transferring data from file to app server.
do.
read dataset p_p_file into it_lfa1.
if sy-subrc = 0.
append it_lfa1.
clear it_lfa1.
else.
exit.
endif.
enddo.
*******closing dataset
close dataset p_p_file.
endform. " transfer_file
*& Form write
text
--> p1 text
<-- p2 text
form write .
loop at it_lfa1.
write:/ it_lfa1-vendor,
it_lfa1-land1,
it_lfa1-name1,
it_lfa1-ort01.
endloop.
endform. " write
Thanks
Aneesh. -
How to download pdf from application server
hi all,
anybody has code to download pdf from application server to presentation server.
right now i get the pdf file on to the desktop but i get error on opening.
gui_download gives error if i use xstring.
pl advice.
thanks.
sap fan.Hi,
use the below code to download file from app server to presentation server
PARAMETERS: S_file TYPE SAPB-SAPPFAD
default '\folder1\abc,pdf'.
PARAMETERS: t_lfile TYPE SAPB-SAPPFAD
default 'c:\temp\xyx.pdf'.
START-OF-SELECTION.
CALL FUNCTION 'ARCHIVFILE_SERVER_TO_CLIENT'
EXPORTING
path = source_file
TARGETPATH = target_lfile
EXCEPTIONS
ERROR_FILE = 1
OTHERS = 2
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
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 -
Regarding Short Dump While loading data from DB Connect
Dear All,
We are having an issue of getting short dump while loading data from DB Connect to BW. We were able to load the data into BW Dev using the same data source without any problem. Whereas in Production, I am getting the following error:
Runtime Error PERFORM_CONFLICT_TAB_TYPE
Except. CX_SY_DYN_CALL_ILLEGAL_TYPE
What could be the reason for the error that I am gettinghi,
Refer Note 707986 - Writing in trans. InfoCubes: PERFORM_CONFLICT_TAB_TYPE
Summary
Symptom
When data is written to a transactional InfoCube, the termination PERFORM_CONFLICT_TAB_TYPE occurs. The short dump lists the following reasons for the termination:
("X") The row types of the two tables are incompatible.
("X") The table keys of the two tables do not correspond.
Other terms
transactional InfoCube, SEM, BPS, BPS0, APO
Reason and Prerequisites
The error is caused by an intensified type check in the ABAP runtime environment.
Solution
Workaround for BW 3.0B (SP16-19), BW 3.1 (SP10-13)
Apply the attached correction instructions.
BW 3.0B
Import Support Package 20 for 3.0B (BW3.0B Patch20 or SAPKW30B20) into your BW system. The Support Package is available oncenote 0647752 with the short text "SAPBWNews BW3.0B Support Package 20", which describes this Support Package in more detail, has been released for customers.
BW 3.10 Content
Import Support Package 14 for 3.10 (BW3. 10 Patch14 or SAPKW31014) into your BW system. The Support Package is available once note 0601051 with the short text "SAPBWNews BW 3.1 Content Support Package 14" has been released for customers.
BW3.50
Import Support Package 03 for 3.5 (BW3.50 Patch03 or SAPKW35003) into your BW system. The Support Package is available once note 0693363 with the short text "SAPBWNews BW 3.5 Support Package 03", which describes this Support Package in more detail, has been released for customers.
The notes specified may already be available to provide advance information before the Support Package is released. However, in this case, the short text still contains the term "Preliminary version" in this case.
Header Data
Release Status: Released for Customer
Released on: 18.02.2004 08:11:39
Priority: Correction with medium priority
Category: Program error
Primary Component: BW-BEX-OT-DBIF Interface to Database
Secondary Components: FIN-SEM-BPS Business Planning and Simulation
Releases
Software
Component Release From
Release To
Release And
subsequent
SAP_BW 30 30B 30B
SAP_BW 310 310 310
SAP_BW 35 350 350
Support Packages
Support
Packages Release Package
Name
SAP_BW_VIRTUAL_COMP 30B SAPK-30B20INVCBWTECH
Related Notes
693363 - SAPBWNews BW SP03 NW'04 Stack 03 RIN
647752 - SAPBWNews BW 3.0B Support Package 20
601051 - SAPBWNews BW 3.1 Content Support Package 14
Corrections Instructions
Correction
Instruction Valid
from Valid
to Software
Component Ref.
Correction Last
Modifcation
301776 30B 350 SAP_BW J19K013852 18.02.2004 08:03:33
Attributes
Attribute Value
weitere Komponenten 0000031199
Thanks
(Activate ODS/Cube and Transfer rules again..) -
XML File not fully downloaded Fully from Application Server.
Hi,
I am downloading an XML file from Application server. It's only downloading partially. Below is the Declaration for target Internal table.
DATA: BEGIN OF infile OCCURS 0,
line(65535) TYPE c,
END OF infile.
SAP does not allow more than 65535 characters for a data type of type C. So its only downloading till that length.
If I am using type as STRING, its downloading in different format. Also its not allowing me to put these data into internal table.
Below is my code for downloading.
OPEN DATASET p_unix IN TEXT MODE MESSAGE msg.
IF sy-subrc <> 0.
MESSAGE i001(38) WITH 'Error on Open of File: ' msg.
ELSE.
WHILE sy-subrc = 0.
READ DATASET p_unix INTO infile.
CHECK sy-subrc = 0.
APPEND infile.
ENDWHILE.
CLOSE DATASET p_unix.
Is there any way to convert string into XML format & put it in the internal table?
Kindly suggest me any other way, so I can download the entire set of file into the internal table.
Thanks,
Debi.Hi ,
Try downloading the file from the application server using the TCode CG3Y on your local machine.
Then use the FM GUI_UPLOAD to upload the contents in an internal table.
Thanks,
Manish -
Error while downloading data from internal table into XML file
hi all,
i developed a program to download data from into internal table to xml file like this.
tables: mara.
parameters: p_matnr like mara-matnr.
data: begin of itab_mara occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
aenam like mara-aenam,
vpsta like mara-vpsta,
end of itab_mara.
data: lv_field_seperator type c, " value 'X',
lv_xml_doc_name(30) type c, " string value my xml file,
lv_result type i.
lv_field_seperator = 'x'.
lv_xml_doc_name = 'my xml file'.
types: begin of truxs_xml_line,
data(256) type x,
end of truxs_xml_line.
types:truxs_xml_table type table of truxs_xml_line.
data:lv_tab_converted_data type truxs_xml_line,
lt_tab_converted_data type truxs_xml_table.
data: lv_xml_file type rlgrap-filename value 'c:\simp.xml'.
select matnr ernam aenam vpsta from mara into table itab_mara up to 5
rows where matnr = p_matnr.
CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
EXPORTING
I_FIELD_SEPERATOR = lv_field_seperator
I_LINE_HEADER =
I_FILENAME =
I_APPL_KEEP = ' '
I_XML_DOC_NAME = lv_xml_doc_name
IMPORTING
PE_BIN_FILESIZE = lv_result
TABLES
I_TAB_SAP_DATA = itab_mara
CHANGING
I_TAB_CONVERTED_DATA = lt_tab_converted_data
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
open dataset lv_xml_file for output in binary mode.
loop at lt_tab_converted_data into lv_tab_converted_data.
transfer lv_tab_converted_data to lv_xml_file.
endloop.
close dataset lv_xml_file.
this program is syntactically correct and getting executed, but when i open the target xml file it is showing the following error.
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
XML document must have a top level element. Error processing resource 'file:///C:/simp.xml'.
will anyone show me the possible solution to rectify this error
thanks and regards,
anil.Hi,
Here is a small sample program to convert data in an internal table into XML format and display it.
DATA: itab TYPE TABLE OF spfli,
l_xml TYPE REF TO cl_xml_document.
* Read data into a ITAB
SELECT * FROM spfli INTO TABLE itab.
* Create the XML Object
CREATE OBJECT l_xml.
* Convert data in ITAB to XML
CALL METHOD l_xml->create_with_data( name = 'Test1'
dataobject = t_goal[] ).
* Display XML Document
CALL METHOD l_xml->display.
Here are some other sample SAP programs to handle XML in ABAP:
BCCIIXMLT1, BCCIIXMLT2, and BCCIIXMLT3.
Hope this helps,
Sumant. -
Uploading the data from Application server to Database
Hi,
I am trying to upload tab delimited file from application server into database.
I have upload the file from presentation to application server by CGZ3
and i am able to see file in app server with #s and it appers in application server as
10140#A#E#120#abcd#
10146#M#P#300#a.b#
10152#M#P#200#dat123.com##
140#A#P#300#blicksat123.com#
10140#A#E#260#cust1at123.com##
And my notepad records looks like
10140 A E 120 abcd
10146 M P 300 a.b
10152 M P 200 dat123.com
140 A P 300 blicksat123.com
10140 A E 260 cust1at123.com
I am using open data set and read dataset to read the file as shown below
DATA:
l_htab TYPE c, " Horizontal tab
l_line(100) TYPE c. " Content in the file
l_htab = cl_abap_char_utilities=>horizontal_tab.
Open dataset
OPEN DATASET pp_afname FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc EQ 0.
DO.
Read dataset
READ DATASET pp_afname INTO l_line.
IF sy-subrc EQ 0.
SPLIT l_line AT l_htab
INTO fs_file-carrid
fs_file-autoind
fs_file-commtype
fs_file-resptime
fs_file-smtpaddr.
APPEND fs_file TO pt_afile.
ELSE.
EXIT.
ENDIF. " IF SY-SUBRC EQ 0.
ENDDO. " DO.
CLOSE DATASET pp_afname.
ELSE.
MESSAGE 'Problem in opening the App.Server file' TYPE con_msgtyp_i.
ENDIF. " IF sy-subrc EQ 0.
Load the data to the database
PERFORM load_data_to_database USING t_afile.
When i am trying to upload it is taking me to dump and the errpr analysis is like
"The program attempted to interpret the value "26 0 " as a number, but
since the value contravenes the rules for correct number formats,
this was not possible."
Any suggestions on this
Regards
VEnk@Hi,
Thats the line feed character. After reading the application server file, use this
data: lv_feed type c value CL_ABAP_CHAR_UTILITIES=>CR_LF.
loop at itab.
replace all occurrences of lv_feed in itab-field with space.
modify itab.
endloop.
Vikranth -
TRANSFER OF DATA FROM APPLICATION SERVER TO REPORT
I have a file on application serverin T-code AL11(sap directories).I want to bring the data from this file to my report.
Please explain me procedure with example.
I approached below method:
I approached with OPEN DATASET,But i got short dump.
syntax:
open dataset c_dset(file in app.svr.) for output in text mode
encoding default.
transfer c_dset to i_transfer(itab).
close dataset.
short dump:
unable to open file "".
Kindly solve my problem.Hi Saritha,
If I am not wrong u r trying to read the data from the file which is on the apps server rite?
Use open data set with input for reading the file from application server .......... output is to write the file onto the application server
check the below sample code.......
DATA:
len TYPE i,
text(30) type c,
dir(30) TYPE c VALUE '/tmp/test.txt'.
DATA: begin of data OCCURS 0,
matnr type matnr,
werks type werks_d,
end of data.
START-OF-SELECTION.
CLEAR: text.
OPEN DATASET dir FOR INPUT IN TEXT MODE.
DO.
READ DATASET dir INTO text.
IF SY-SUBRC 0.
EXIT.
ENDIF.
close dataset.
Maybe you are looking for
-
I installed Oc4j as a standalone package in a directory (Solaris2.6) where everybody in my group has full access. Now the problem is I'm the only person who can start the application server by the following: java -jar oc4j.jar For other people in the
-
Problem with window manager after re-installing Compiz
When i start my arch i get no window borders. I also cant get enything minimized, when i try to do so windows are lost. i use this command when i start: metacity --replace which allowes me to have window borders but still i cant minimize. All these h
-
My iphone4 is taking more than 5 hours to erase all the data still it is under process , still how much more time i have to wait for my mobile to ON ?
-
My "Java Platform" plugin is listed as insecure and blocked in the main Add-ons window and I am instructed use the plugin check page to update. When I go to the plugin check page it shows the "Java Platform" plugin as already being "up to date". What
-
My first Jabber Guest link not working
So I believe I have everything set up correctly for Jabber Guest, but when I browse to the link I created I either get the Expressway Edge login page, or if I'm logged in to the Exp I get "The requested URL /call/8888 was not found on this server."