Regarding uploading the file from Application Server
I am trying to upload a .csv file to Application Server through CG3Z tcode.
But i am getting dump ad below..
What happened?
While a text was being converted from code page '4102' to '1100', one
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, 'SAPLC13Z' had to be terminated, since the
conversion could cause incorrect data to be generated.
1 characters could not be represented (and thus could not converted).
If 1 = 0, a second or a different error has occurred.
Please let me know..how can i resolve this??
Thanks
Priyanka
Check if your CSV file is UNICODE encoding.
If CG3Z steel not works you can check on OSS SUPPORT if a note solve your problem.
Similar Messages
-
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 -
Error while uploading the file from Allpcation server in LSMW-7th step
Hi Experts,
what should be the specific CODE PAGE should be maintained while uploading the file from application server in LSMW-7th Step
Thanks in advance,
KSRHi
I mean that there is any seperate CODE PAGE which comes at the bottom of screen while uploading the file from the application server in 7th step.
Is there any specific CODE PAGE to be maintained...
Thanks in advance
Oarsk -
Error in Reading the file from Application Server
Hi,
This Error is regarding one of my interface, the issue is that , the interface reads data from file in bunch suppose 100 records at a time , then processes those records and once finished go for next 100 records .
Noe the error is that , the process takes place till 500 records correctly but when it went to fetch for next 100 i.e fom 501 to 600 it selects only 501 to 583 .
this records has been processed successfully but the job finished there only
but the file contains 788 records
When the same file has been run in other server it ran successfully without such error .
Can you please suggest how to resolve the issueHi,
Try to manually download the file from application server using standard transactions, and than check how many records are you able to download from app. server.
I guess there might be something wrong with the format of 583rd record, which makes sap assume that the file has come to an end.
Hope this will help you.
Regards,
Vinit... -
How to upload XML file from Application server.
Hi,
How to upload XML file from Application server.Please tell me as early as possible.
Regards,
Sagar.Hi,
parameters : p_file type ibipparms-path obligatory.
***DOWNLOAD---->SAP INTO EXCEL
filename1 = p_file.
call function 'GUI_DOWNLOAD'
exporting
BIN_FILESIZE =
filename = filename1
filetype = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
tables
data_tab = it_stock
FIELDNAMES =
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.
endif.
Regards,
Deepthi. -
Problem while dowloading the file from Application Server
Dear Experts,
I am facing the Problem while downloading the file from Application server.
We done the automatic function while saving the invoice, this will create an idoc, and this idoc is written in the Application Server.
I am running the Transaction AL11 and select the record, and from menu --> List, i am downloading into TXT format.
But for some segments, the length is long, and so the last 3 to 4 fields values are not appearing in the File. Even though i am unable to view the values in the file before downloading. But i can view in IDOC.
Please help me to solve this issue.
Thanks & Regards,
Srinibut our user will use the Txn. AL11 and they will download from there
Educate the user On a serious note, tell him this is not how data from app server should be downloaded. You can ask him to talk to the basis team to provide him access to the app server folder where the file is being stored.
I can set the Variant and put this in background, But always the file name will be change, Like we use Time stamp in the File name.
You can't automate this process by scheduling in BG mode. This is because the in BG mode you can't dwld the file to presentation server.
Hope i'm clear.
BR,
Suhas -
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 -
Error Loading the file from application server
Hi Team,
I'm trying to load the .CSV file from application server and I'm getting the error message.
In the data package
Update to PSA --Green
Transfer Rule -- Green
Update Rule - error ABORT was set in the customer routine 9998
Error 1 in the update
Please help me to provide the solution.
But when I try to load the other files there are no issues. thanks.
Regards,
SenthilRaj
check the below links, which can helps to solve your issues
Flat file data load
flat file Data loading issue
Mahesh -
Uploading xml file from application server
HI everybody guys having promblem reading xml file from application server.Here is the solution. the sample program is below.
TYPE-POOLS: ixml. "iXML Library Types
*TABLES : rbkp.
TYPE DECLERATIION
TYPES: BEGIN OF type_tabpo,
ebeln TYPE ekko-ebeln, "PO document number
ebelp TYPE ekpo-ebelp, "PO line item
END OF type_tabpo.
TYPES: BEGIN OF type_ekbe,
belnr TYPE rbkp-belnr, "Invoice document
gjahr TYPE rbkp-gjahr, "fiscal year
END OF type_ekbe.
TYPES: BEGIN OF type_invoice,
belnr TYPE rbkp-belnr, "PO document number
gjahr TYPE rbkp-gjahr, "Fiscal Year
rbstat TYPE rbkp-rbstat, "invoice status
END OF type_invoice.
TYPES: BEGIN OF t_xml_line, "Structure for holding XML data
data(256) TYPE x,
END OF t_xml_line.
INTERNAL TABLE DECLERATIION
DATA: gi_tabpo TYPE STANDARD TABLE OF type_tabpo,
gi_ekbe TYPE STANDARD TABLE OF type_ekbe,
gi_invoice TYPE STANDARD TABLE OF type_invoice,
gi_bapiret2 TYPE STANDARD TABLE OF bapiret2.
DATA: l_ixml TYPE REF TO if_ixml,
l_streamfactory TYPE REF TO if_ixml_stream_factory.
l_parser TYPE REF TO if_ixml_parser,
l_istream TYPE REF TO swif_ixml_istream,
l_document TYPE REF TO if_ixml_document,
l_node TYPE REF TO if_ixml_node,
l_xmldata TYPE string.
*DATA: l_elem TYPE REF TO if_ixml_element,
l_root_node TYPE REF TO if_ixml_node,
l_next_node TYPE REF TO if_ixml_node,
l_name TYPE string,
l_iterator TYPE REF TO if_ixml_node_iterator.
DATA: l_xml_table TYPE TABLE OF t_xml_line, " XML Table of the structure
l_xml_line TYPE t_xml_line, " Record of structure t_xml_line
l_xml_table_size TYPE i. " XML table size
DATA: l_filename TYPE string.
WORK AREA DECLARATION
DATA: gw_tabpo TYPE type_tabpo,
gw_ekbe TYPE type_ekbe,
gw_invoice TYPE type_invoice,
gw_bapiret2 TYPE bapiret2.
BEGIN OF SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: p_file TYPE pathintern LOWER CASE DEFAULT '/usr/sap/tmp/'.
Validation of XML file: Only DTD included in XML document is supported
SELECTION-SCREEN END OF BLOCK blk1.
INTIALISATION.
INITIALIZATION.
SELECTION SCREEN VALIDATION
AT SELECTION-SCREEN.
To validate p_file is not initial
PERFORM sub_validate_file.
PERFORM sub_validate_path.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Request for filename for xml file from the application server
PERFORM sub_get_filename_appl USING p_file.
START OF SELECTION SCREEN
START-OF-SELECTION.
PERFORM sub_fetch_po_details.
PERFORM sub_get_invoice.
PERFORM sub_rel_invoice.
END OF SELECTION SCREEN
END-OF-SELECTION.
*& Form sub_validate_file
To Validate the file
FORM sub_validate_file .
IF p_file IS INITIAL.
MESSAGE e000. "specify the file path
ENDIF.
ENDFORM. " sub_validate_file
*& Form sub_get_filename_appl
form sub_get_filename_appl USING l_fname TYPE any.
DATA: l_fname TYPE filename-fileintern. " File name
*GET THE FILENAME FROM THE APPLICATION SERVER
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
EXPORTING
directory = l_fname
filemask = '*'
IMPORTING
serverfile = l_fname
EXCEPTIONS
canceled_by_user = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " sub_get_filename_appl
*& Form sub_fetch_po_details
To fetch the PO details from the application server
Format of file is XML
FORM sub_fetch_po_details .
TYPE DECLERATIION
l_ixml = cl_ixml=>create( ).
Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
PERFORM get_xml_table.
LOOP AT gi_tabpo INTO gw_tabpo.
WRITE:/ gw_tabpo.
ENDLOOP.
ENDFORM. " sub_fetch_po_details
*& Form get_xml_table
Read from the xml file
FORM get_xml_table .
Local variable declarations
DATA: l_len TYPE i,
l_len2 TYPE i,
l_tab TYPE tsfixml,
l_content TYPE string,
l_str1 TYPE string,
c_conv TYPE REF TO cl_abap_conv_in_ce,
l_itab TYPE TABLE OF string.
l_filename = p_file.
code to upload data from application server
OPEN DATASET l_filename FOR INPUT IN BINARY MODE.
IF sy-subrc <> 0.
WRITE:/ 'invalid file path'.
ENDIF.
DO.
READ DATASET l_filename INTO l_xml_line.
IF sy-subrc EQ 0.
APPEND l_xml_line TO l_xml_table.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET l_filename.
code to find the table size
DESCRIBE TABLE l_xml_table.
l_xml_table_size = ( sy-tleng ) * ( sy-tfill ).
*code to convert hexadecimal to XML
LOOP AT l_xml_table INTO l_xml_line.
c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data
replacement
= space ).
c_conv->read( IMPORTING data = l_content len = l_len ).
CONCATENATE l_str1 l_content INTO l_str1.
ENDLOOP.
l_str1 = l_str1+0(l_xml_table_size).
SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
LOOP AT l_itab INTO l_str1.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN
l_str1 WITH space.
ENDLOOP.
CALL TRANSFORMATION ('ID') " code to put in internal table
SOURCE XML l_str1
RESULT tab = gi_tabpo[].
ENDFORM. " get_xml_tableHi Raja,
I tried the same. But it not populating the table and giving an error message in the return table "line 1 col 1-unexpected symbol; expected '<', '</', entity reference, charac".
I can't find any ' ; ' in the XML file. What could be the possible reason of error? -
Upload XML file from Application Server to Internal Table
Hi Experts,
i have xml file in application server and i want to convert to internal table .
i have tried this link http://wiki.sdn.sap.com/wiki/display/ABAP/UploadXMLfiletointernal+table.
Here the file is loaded from local(presentation Server) ..
i want to know how to select file from application layer ..and schedule in background..
i also tried FM '/SAPDMC/LSM_F4_SERVER_FILE' but this need front end selection of file from application server..
i need to select a xml file from application server and convert into internal table in background.. help me on this..Have a look on
Re: How to convert XML data to different ABAP internal table
Thanks
Ravin -
Upload 1gb file from application server to PSA
Hi,
The following is the requirement my client has,
1) there will be a 1gb file on application server
2) pick up the file, and validate if the number of records are equal to number provided in the footer, if they dont match, reject the file
3) then validate the first field, employees number, with a database table
if the employee exisits insert this file in PSA ( BW)
else reject this file and proceed to next file.
this file is a fixed length file, and not a CSV.
can you please provide me with some hint or link or answers.
Thanks
ajayHi,
The following is the requirement my client has,
there will be a 1gb file on application server pick up the file, and validate if the number of records are equal to number provided in the footer, if they dont match, reject the file then validate the first field, employees number,
with a database table if the employee exisits insert this file in PSA (
BW) else reject this file and proceed to next file.
this file is a fixed length file, and not a CSV.
can you please provide me with some hint or link or
answers.
Thanks
ajay
for my above queries, i have an idea but need your help to solve.
i want to read the file on application server ( for example 1st record to 100th record) and store it in the internal table 1, and again i want to read the same file on application server from 101th record to 200th record and store it in the internal table 2. and so on.
can anyone help me to this, what is it that i should code for this?
open data set
read data set (any conditions???)
close dataset.
ill surely award points for all the replies.
thankyou
ajay -
Not recognizing # while reading the file from application server
Hi
I am reading a file from application server. While reading into internal table with read statement the last field in each record is filling with hash symbol in the last digit. If I write any if condition with HASH symbol its not going inside the if condition, means its not recognizing as hash may be its internally treating as some other. I need to remove the hash from that field. How I can do that.
Thanks,
kishoreI faced exact situation. Yes, internally its treated as some other special character. What i did was, becuase hash symbol was always coming at the end...i created a dummy field in my internal table so that it will not interfere with my actual data. When i see the data in my internal table, the hash always falls in the last field (dummy) which i will ignore. I could not get solution to remove this hash so i adopted this approach and it worked!!
Hope it helps,
SKJ -
FM to get the file from application server to presenatation server automati
Hi!
In my upload program I am egtting the error log file onmy application server directly. Is there a function module or a way that in my abap code I can mention to bring the file or transfer the file to the presentation server . As my program is been run in the back ground so I cannot directly get the file on the presenattion server, so I need to bring it back on teh presentation server back to see teh eror log.
I would like my program to do the transfer in background itself so that I can see the error log on a daily basis from my local file .
Thanks
when 'X'. "X is application server
* TRANSLATE p_err USING '\/'." correct slash for unix
open dataset p_err2 for output in text mode encoding default.
if sy-subrc = 0.
loop at t_err into s_nts.
transfer s_nts to p_err2.
if sy-subrc ne 0.
message i010(ad) with p_err2 'Download Failed'.
endif.
endloop.
close dataset p_err2.
else.
message i010(ad) with p_err 'dataset could not be found'.
sy-subrc = -1. "Maintain error condition
endif.
* endif.
when ' '. "Blank is presenation server
translate p_err using '/\'."correct slash Dos file
call function 'DOWNLOAD'
EXPORTING
filename = p_err
filetype = 'ASC' "FTYPE set to DAT in DATA seg
TABLES
data_tab = t_err.
if sy-subrc ne 0.
message i010(ad) with 'File ' p_err 'cannot be located.'.
sy-subrc = -1. "Maintain error condition
exit.
endif.
endcase.
ENDIF.
ThanksSO , after reading all , I assume that there is no way in which when I run the background job and get a errro file on application server can be retrievd on my presenattion serevr during the background job run. I was thinking that theer might be a functionn module which will convert the application server file into presenttion server file during the program run in background and store it in the location provided.
I was trying to use FM CALL FUNCTION 'C13Z_APPL_TO_FRONT_END' and CALL FUNCTION 'ARCHIVFILE_SERVER_TO_SERVER' but using teh first one asks for source file and destination file name during teh program run and as it runs in background it cannot be provided again and again and teh second one dosent seem to work.
Thanks -
How to upload .CSV file from Application Server
Hi Experts,
How to upload .CSV file separated by ',' from Application server to an internal table.
Invoice No,Cust No,Item Type,Invoice Date,days,Discount Amount,Gross Amount,Sales Amount,Customer Order No.,Group,Pay Terms
546162,3233,1,9/4/2007,11,26.79,5358.75,5358.75,11264,HRS,11
546163,2645,1,9/4/2007,11,3.07,305.25,305.25,10781,C,11
Actually I read some already answered posts. But still I have some doubts.
Can anybody please send me the code.
Thanks in Advance.Hi Priya,
Check this code
Yhe logic used here is as follows,
Get all the data into an internal table in the simple format ie: a row with one field contains an entire line
After getting the data, we split each line of the table on every occurrence of the delimiter (comma in your case)
Here, I have named the fields as field01, field02 etc, you could use your own names according to your requirement
parameters: p_file(512).
DATA : BEGIN OF ITAB OCCURS 0,
COL1(1024) TYPE C,
END OF ITAB,
WA_ITAB LIKE LINE OF ITAB.
DATA: BEGIN OF ITAB_2 OCCURS 0,
FIELD01(256),
FIELD02(256),
FIELD03(256),
FIELD04(256),
FIELD05(256),
FIELD06(256),
FIELD07(256),
FIELD08(256),
FIELD09(256),
FIELD10(256),
FIELD11(256),
FIELD12(256),
FIELD13(256),
FIELD14(256),
FIELD15(256),
FIELD16(256),
END OF ITAB_2.
DATA: WA_2 LIKE LINE OF ITAB_2.
OPEN DATASET p_FILE FOR INPUT IN TEXT MODE ENCODING NON-UNICODE.
IF SY-SUBRC = 8.
WRITE:/ 'File' , p_FILE , 'cannot be opened'.
LV_LEAVEPGM = 'X'.
EXIT.
ENDIF.
WHILE SY-SUBRC <> 4.
READ DATASET p_FILE INTO WA_ITAB.
APPEND WA_ITAB TO ITAB.
ENDWHILE.
CLOSE DATASET p_FILE.
LOOP AT ITAB INTO WA_ITAB.
SPLIT WA_ITAB-COL1 AT ',' " where comma is ur demiliter
INTO WA_2-FIELD01 WA_2-FIELD02 WA_2-FIELD03 WA_2-FIELD04
WA_2-FIELD05 WA_2-FIELD06 WA_2-FIELD07 WA_2-FIELD08 WA_2-FIELD09
WA_2-FIELD10 WA_2-FIELD11 WA_2-FIELD12 WA_2-FIELD13 WA_2-FIELD14
WA_2-FIELD15 WA_2-FIELD16.
APPEND WA_2 TO ITAB_2.
CLEAR WA_2.
ENDLOOP.
Message was edited by:
Kris Donald -
How to upload a file from application server?
Hi experts,
I am going to create a conversion program using call function 'HR_INFOTYPE_OPERATION'.In my conversion I am going to upload per_area,emp_subgroup,payroll_area,work contract and orgn_key for the infotype IT0001 and the input file is from application server.I am using check boxes for these 5 fields and for the fields I am selecting the checkbox.I want to upload the datas in the IT0001 using HR_INFOTYPE_OPERATION.That is using the call transaction function.Its urgent give me some ideas or codings for that infotype updating.
Thanks,
Sakthi.CHi
you can use <b>open dataset for input</b>,<b>Read dataset</b> for uploading data from a application server.
Message was edited by:
Raghu Reddy
Maybe you are looking for
-
Can't See Historical Forecast in SPP
Hi We have loaded the sales order data using a flat file.We were able to load the data into the cube 9ADEMAND (but not into the ODS 9ARAWDAT). We are also able to see the demand data in the forecasting planning book and even forecast is also getting
-
HT201401 My phone will not ring or vibrate despite ringer up to max volume
My phone will not ring or vibrate despite ringer up to max volume & vibrate turned on. Message tone does sound though when message comes in. I know the sounds work as I have tested them, they just don't work with incoming calls????
-
Showing SUM of minutes as hours & minutes
Hi everyone, I'm using numbers as a timelog (as I see others doing the same). I can't, however, find the solution to my problem in the previous post search. I would appreciate any help anyone can offer, so thank you in advance. I have created a separ
-
Error : 'cannot find symbol getText()'
please check my java coding. when I compile it, the error: 'cannot find symbol getText() ' is appear. What wrong with this coding. import java.awt.*; import java.awt.event.*; import javax.swing.*; public class buatAction public static void main(Strin
-
QM: Sample Size is 32767 if freely defined inspection point is used
Hi, I am using Inspection plan with freely defined inspection point (100). Inspection type: 04 I want to do 100% inspection. Material master setting is done for early lot creation. If I use freely defined inspection point in the plan and create an or