Issue with reading XLSX with multiple sheets file in application Server
Hi,
We're currently implementing SAP CRM 7.40.
In one requirement we have to process an XLSX file and load its information to a set of Z tables.
The file has 6 sheets of data to process, each sheet with distinct number of columns and types (each sheet will be upload to a different Z table).
We're able to process the XLSX using the Desktop Office integration for local files.
However, we must also be able to process files on the application server.
We tried the following approaches without success
- The DOI library doesn't seem to support remote files processing:
- OPEN DATASET. with the dataset we're able to read a remote file, however since the file format is XLSX, the information we read in the dataset comes in an unreadable format
- FTP. we tried to use FTP to download the remote file to a local folder so that we could then use the DOI library to process the file. However, the client only allows SFTP connections and SAPFTP doesn't provide SFTP
There's another approache we're considering to try which is to have a perl script on the application server to split the Excel file into CSV files (one for each tab) and then use OPEN DATASET to read the contents of each file and work from there. This approach seems quite cumbersom
The approach with DOI would be the best one but either we're missing a key configuration or it truly can't be used for files. Are there any special requirements that we should take into account for this option?
We'd like to know if you have any other approach that proves successfull or if any of the above can work but with some aditional adjustments.
Thanks in advance.
Best regards.
Hello Ricardo,
Go through below link.
to read Excel file from the application server in a BACKGROUND process
You can try below approach if it is feasible for you.
Turning ".XLSX" into XML & read XML file through application.
XLSX Upload - a Unified Approach - SCN - SAP.com
Thanks!
Sameer
Similar Messages
-
Hi All,
Is there any way to upload Tariff Code (with multiple XML files) from application server?. Its urgent.
Regards,
JatinHi Jatin,
Yes, of course you can upload multiple files for tariff codes.
This can be done by the below path:-
SAP GTS Cockpit(tcode-/sapsll/menu_legal)-->Customs Management-->Classification-->Classification Master Data-->Upload Tariff Code Numbers from XML file(tocde- /SAPSLL/LLNS_UPL101).
In the above area after browsing and choosing the first file, please select multiple check box to choose more files as well. Then you can further select your application server and upload all those files in one go.
PS:- Although, we have an option to upload multiple such files but actually we should avoid multiple file uploads due to various reasons. Hence, please take utmost care during such procedure.
Regards,
Aman -
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..
-
Upload a csv file in application server with the specified codepage(Poland
Hi,
i want to upload a csv file in application server with the specified codepage ( for poland ) , please let me know how to use open dataset for that.?
AnuragI would upload the file with transaction CG3Z in binary mode and do the code page translation with a report: read from server an save with different name.
-
Problem with saving data in text file in Application server
Hello Experts,
I am trying to save a text file in application server.When I text file have less that 60000 (i.e 59999) records, it saves the file successfully, but if records in text file (saved in application server) is more than 60000 (i.e 60002), it creates a new file at the 60000th record with the continued records.
Can anyone please advise, why it is creating a new file if records are more that 60000. I tested it with 59000 records in my internal table and it is working fine. I have not given any restriction in my program to create a new file if records are more than 60000.
The logic I implemented is the following:
*Open file
open dataset g_accnt_file for output in text mode encoding utf-8.
if sy-subrc = 0.
clear g_header_record.
*Building header record for Accounting Validation file
concatenate gc_hdr_desc
gc_filetype
gc_sequence
gc_idntf_refresh
gc_cmpny_idntf
gc_accnt_id
sy-datum
sy-uzeit
gc_linde_group
sy-sysid
gc_not_used into g_header_record separated by
gc_deliminator.
transfer g_header_record to g_accnt_file.
*Move Cost center data to file to create a detail record for Accounting
*Validation file
loop at gt_csks into gs_csks.
*Remove leading Zeros
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
exporting
input = gs_csks-kostl
importing
output = gs_csks-kostl.
* Overlay gs_csks-kostl with space.
* SHIFT gs_csks-kostl RIGHT DELETING TRAILING gc_space.
*Prepare Cost Centre String
perform prepare_costcentre_string.
*Prepare detail record with Company Code & Cost Centre
perform prepare_detail_record.
clear:g_detail_record,gs_csks,g_coa.
endloop.
*Move Order data to file to create a detail record for Accounting
*Validation file
loop at gt_aufk into gs_aufk.
*Remove leading Zeros
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
exporting
input = gs_aufk-aufnr
importing
output = gs_aufk-aufnr.
* SHIFT gs_aufk-aufnr RIGHT DELETING TRAILING gc_space.
*Prepare Order String
perform prepare_order_string.
*Prepare detail record with Company Code & Order
perform prepare_detail_record.
clear:g_detail_record,gs_aufk,g_coa.
endloop.
*Move WBS data to file to create a detail record for Accounting
*Validation file
loop at gt_prps into gs_prps.
call function 'CONVERSION_EXIT_ABPSP_OUTPUT'
exporting
input = gs_prps-pspnr
importing
output = g_wbs_element.
* SHIFT g_wbs_element RIGHT DELETING TRAILING gc_space.
*Prepare WBS Element String
perform prepare_wbs_string.
*Prepare detail record with Company Code & WBS Element
perform prepare_detail_record.
clear:g_detail_record,gs_prps,g_coa.
endloop.
*Building trailer record for Accounting Validation file which will
*contain the total number of detail records in file
concatenate gc_trail_desc
g_total_count
into g_trailer_record
separated by gc_deliminator.
transfer g_trailer_record to g_accnt_file.
*Close file
close dataset g_accnt_file.
if sy-subrc = 0.
message s036(/lig/fi).
endif.
endif.
endform. " SELECT_DATA
Edited by: Matt on Sep 30, 2010 11:02 AM - added tagsHi Pankaj,
Can u check the concatenate statement with one more data. Check the no of lines for a single file.
concatenate gc_hdr_desc
gc_filetype
gc_sequence
gc_idntf_refresh
gc_cmpny_idntf
gc_accnt_id
sy-datum
sy-uzeit
gc_linde_group
sy-sysid
sy-subrc
gc_not_used into g_header_record separated by
gc_deliminator.
Regards,
Amitava -
InfoSpoke fails with message "Could not open file on application server"
BW Experts,
I created an InfoSpoke that is configured to extract to a flat file. The name of the file is specified using a logical filename. During extraction, the infospoke reports the error message "Could not open file on application server" adnd marks the extraction process as red(failed). I have tried to run the InfoSpoke in background mode and in dialog mode and the same error appears. After i run in dialog mode, i checked SU53 for authorization errors and did not find any. I also tried changing the Logical filename setup in transaction FILE to a more "friendly" directory in which i'm sure i have authorizations (e.g. my UNIX home directory) and im still getting errors.
Can you please share your thoughts on this? Any help will greatly appreciated. I also promise to award points.Hi Nagesh,
Thanks for helping out.
If i configure the InfoSpoke to download to a file using "File Name" option and also check the "Application server" checkbox, the extract works correctly (extraction to the defualt SAP path and filename=infospoke name). If i configure the InfoSpoke to download to the local workstation, the InfoSpoke also works correctly. It's only when i configure it to download to the application server and use the "Logical filename" option, that i encounter a failed extract.
Here are the messages is the Open Hub Monitor:
(red icon) Request No.147515
0 Data Records
Runtime 1 sec.
(red icon)Run No. 1
0 Data Records
Runtime 1 sec.
Messages for Run
Extraction is running RSBO 305
Could not open file on application server RSBO 214
Request 147515 was terminated before extraction RSBO 326
Request 1475151: Error occured RSBO 322
If i clink on the error message, no messages nor clues are displayed. Note, this is a new InfoSpoke that is currently in the dev system.
Please help. -
Fetching of multiple files from Application Server into SAP Program
Hi All,
I have a issue related <b>Fetching of multiple files from Application Server into SAP Program</b>.
Actual issue is as below.
In the <b>selection screen</b> of <b>my program</b> i will give <b>Application Server Path</b> as :
<b>/PW/DATA/SAP/D1S/PP/DOWN/eppi0720*</b>
Then the based on above input it should pick up all the files that are matching <b>eppi0720*</b> criteria.
Suppose if i am having <b>5</b> files with above scenario, i have to fetch all those <b>5</b> files at a time and place in my SAP Program.
All those 5 file's data should come into SAP at a time.
Can anybody tell me how can we solve above issue.
If any body has come across same issue please provide me with solution.
Thanks in advance.
Thanks & Regards,
Rayeez.If you want to get around the authorization check, you can do something like this.
report zrich_0001 .
parameters: p_path type epsf-epsdirnam
default '/usr/sap/TST/SYS/global'.
parameters: p_file type epsf-epsfilnam default 'CO*'.
start-of-selection.
perform get_file_list.
* FORM get_file_list *
form get_file_list.
types: name_of_dir(1024) type c,
name_of_file(260) type c,
name_of_path(1285) type c.
data: begin of file_list occurs 100,
dirname type name_of_dir, " name of directory. (possibly
" truncated.)
name type name_of_file, " name of entry. (possibly
" truncated.)
type(10) type c, " type of entry.
len(8) type p, " length in bytes.
owner(8) type c, " owner of the entry.
mtime(6) type p, " last modification date, seconds since 1970
mode(9) type c, " like "rwx-r-x--x": protection mode.
useable(1) type c,
subrc(4) type c,
errno(3) type c,
errmsg(40) type c,
mod_date type d,
mod_time(8) type c, " hh:mm:ss
seen(1) type c,
changed(1) type c,
end of file_list.
data: begin of file,
dirname type name_of_dir, " name of directory. (possibly
" truncated.)
name type name_of_file, " name of entry. (possibly
" truncated.)
type(10) type c, " type of entry.
len(8) type p, " length in bytes.
owner(8) type c, " owner of the entry.
mtime(6) type p, " last modification date, seconds since 1970
mode(9) type c, " like "rwx-r-x--x": protection mode.
useable(1) type c,
subrc(4) type c,
errno(3) type c,
errmsg(40) type c,
mod_date type d,
mod_time(8) type c, " hh:mm:ss
seen(1) type c,
changed(1) type c,
end of file.
call 'C_DIR_READ_FINISH' " just to be sure
id 'ERRNO' field file_list-errno
id 'ERRMSG' field file_list-errmsg.
call 'C_DIR_READ_START' id 'DIR' field p_path
id 'FILE' field p_file
id 'ERRNO' field file-errno
id 'ERRMSG' field file-errmsg.
if sy-subrc <> 0.
sy-subrc = 4.
exit.
endif.
* Read the file list and add to internal table.
do.
clear file.
call 'C_DIR_READ_NEXT'
id 'TYPE' field file-type
id 'NAME' field file-name
id 'LEN' field file-len
id 'OWNER' field file-owner
id 'MTIME' field file-mtime
id 'MODE' field file-mode
id 'ERRNO' field file-errno
id 'ERRMSG' field file-errmsg.
if sy-subrc = 1.
exit.
endif.
append file to file_list.
enddo.
* Write out the file list
loop at file_list.
write:/ file_list-name.
endloop.
endform.
Regards,
Rich Heilman -
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 -
Read PDF Formatted Spool and write PDF File to Application Server
Hi Experts,
After ECC 6.0, HR-W2 and W2C Form Spools are getting generated in PDF format.
We have a requirement wherein we want to read the PDF Spool Programatically and write the PDF file to Application server (Using OPEN DATASET and CLOSE DATASET)
PARAMETERS : p_spono LIKE tsp01-rqident.
DATA: pdf_data type FPCONTENT.
types: lt_pdf_table(1000) type x.
data: l_pdf_data type standard table of lt_pdf_table,
l_pdf_line type lt_pdf_table,
l_offset type i,
l_len type i,
p_file(100) VALUE '\sapout\DVH\pdf2.pdf'.
*Read the spool content
CALL FUNCTION 'FPCOMP_CREATE_PDF_FROM_SPOOL'
EXPORTING
i_spoolid = p_spono
i_partnum = '1'
IMPORTING
e_pdf = pdf_data
* e_pdf_file = file
EXCEPTIONS
ads_error = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
* Modify the spool contents to prepare internal table
l_len = xstrlen( pdf_data ).
while l_len >= 1000.
l_pdf_line = pdf_data+l_offset(1000).
append l_pdf_line to l_pdf_data.
add 1000 to l_offset.
subtract 1000 from l_len.
endwhile.
if l_len > 0.
l_pdf_line = pdf_data+l_offset(l_len).
append l_pdf_line to l_pdf_data.
endif.
* GUI DOWNLOAD Works Fine
* Now pdf contents is ready , lets store in local PC
*CALL FUNCTION 'GUI_DOWNLOAD'
* EXPORTING
* filename = 'C:\Documents and Settings\Desktop\shital.pdf'
* filetype = 'BIN'
* TABLES
* data_tab = l_pdf_data.
OPEN DATASET p_file FOR OUTPUT IN BINARY MODE.
IF sy-subrc <> 0.
MESSAGE ID '00' TYPE 'E' NUMBER '398' WITH 'sy-subrc:' sy-subrc
' Error opening file:'(Z03) p_file.
ENDIF.
LOOP AT l_pdf_data INTO l_pdf_line.
TRANSFER l_pdf_line TO p_file.
ENDLOOP.
CLOSE DATASET p_file.
IF sy-subrc <> 0.
MESSAGE ID '00' TYPE 'E' NUMBER '398' WITH 'sy-subrc:' sy-subrc
' Error closing file:'(Z04) p_file.
ENDIF.
Currently as you can see I have commented out GUI_DOWNLOAD Function Module, But it works perfect when I try to Download file to Local Desktop.
But when I try to pass the same Contents to Application server file and then try to open it by downloading file then it opens BLANK pdf file.
As per requirements I should be able to write the file correctly on Application server and If I dowload it from there it should open PDF file correctly.
Let me know if you require further details about the issue.
Regards
Shital
Edited by: shital phadake on Apr 8, 2009 9:39 PMThanks Selçuk for your reply and taking time for understanding the Issue,
I went thru Functionality of the program you suggested but dont think it matches my requirement.
Regards
Shital -
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... -
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. -
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. -
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 -
FM to read XML files from Application server in ECC5.0
Hi All,
We need to pick up an XML file from Application server/FTP server. The requirement is to parse the XML file and process it to create material master. SAP provides standard function modules to read XML files.
Now we need to read the XML file contents of MM01 and upload into SAP Data Base through BAPI
I need to know about the Function modules to read XML files from Application Server and also about the FM's that will update the Date base tables with the data obtained form XML files.
Regards
PrathimaParsing XML data:
http://help.sap.com/saphelp_nw04/helpdata/en/86/8280ba12d511d5991b00508b6b8b11/frameset.htm
or alternatively check out ABAP online help for "CALL TRANSFORMATION".
For creating the material master look at BAPI_STANDARDMATERIAL_CREATE.
Thomas
Maybe you are looking for
-
How is it possible for Adobe Support to be so bad ?
I mean really ! For a multi billion dollar company, support is worse than Microsoft ! And that speaks heaps ! I had the worst customer experience throughout the day with people that have no grasp over the english language and moreso, no technical ski
-
I downloaded Pandora a while back. My 12 year old nieces were playing with my iPad and now the Pandora icon is not on my screen. The app store shows that it needs to be updated, but I can't do it. What can it do to recover my Pandora program?
-
Display resolution and Mac OS X 10.5.7
I am now using my Mac mini (early 2009) as my primary computer (new aluminum keyboard and an LG 23" LCD HDTV) and have sent the iMac Core Duo to "the boys" room for them to use. But they have called my attention to the display resolution a few times
-
Can't See Submit Button?
Hi I have a form to fill out, I've downloaded Adobe Reader 9, and have completed the form I am not able to save any filled out parts nor does it print fully. I have previous filled out the form using reader 6 ---- it had a submit button that didn;t w
-
Premier Pro CS 3 and Mpeg - Help, please!
Hello, do you have any plugins for mpeg Files: editing / importing audio & video / capturing ... with PP CS3? I imported and edited Mpeg Files with Premier 2.0 - without plunigs, but in New Version - when I importing files - the audio is missing... A