"Open file..." dialog from Application Server (Unix)
Hi all you experts.
I have a simple ABAP program that reads input files from Application Server (Unix), at this moment the users have to enter manually the name of the file(s) in a parameter text field. I would like to add value to this program by helping the user select the file using an "Open file..." dialog or something similar that enable them to chose the file on behalf of writing the complete name (including the path).
Do you have any idea about how to implement it?
Many thanks in advance.
Hi,
Try function module F4_DXFILENAME_TOPRECURSION or F4_FILENAME_SERVER (for a specific directory) within the at value-request event for the filename.
Cheers,
Darren
Similar Messages
-
How to delete file from application server(Unix)
Hi All,
Using the below code downloading a file from application server(Unix) to client machine. I want to delete the file from application server once it is downloaded to client
We work on Forms 11.1.1.4.0 and Oracle DB 10g. Client machine are Windows 7.
BEGIN
IF webutil_file_transfer.AS_to_Client
(clientFile => Name_In('global.g_file_name')
,serverFile => ls_AppServer_Loc)THEN
message('Data exported Successfully');
ELSE
message('File download from Application Server failed');
END IF;
EXCEPTION
WHEN OTHERS THEN
message('File download failed: '||SUBSTR(sqlerrm,1,200));
END;
I have search for solution on OTN. Few suggested to use HOST.
Can any one help me how to use Host() built_in to delete the file.
Thanks,
MaddyCan any one help me how to use Host() built_in to delete the file.
Host('/bin/rm <complete file path>'); -
Class to Get File List from Application Server
Hi all
I've to obtain the file list of a directory from application server, I can use a FM too but It's possible the lenght of file name is upper then 40 characters so I can't use FM EPS_GET_DIRECTORY_LISTING.
Thanks
Edited by: Aristoteles92 on Apr 20, 2010 3:27 PMTry using the function RZL_READ_DIR_LOCAL. Here is an example program using this function.
data: begin of itab occurs 0,
rec(1000) type c,
end of itab.
data: wa(1000) type c.
data: p_file type localfile.
data: ifile type table of salfldir with header line.
parameters: p_path type salfile-longname
default '/usr/sap/TST/DVEBMGS01/data/'.
call function 'RZL_READ_DIR_LOCAL'
exporting
name = p_path
tables
file_tbl = ifile
exceptions
argument_error = 1
not_found = 2
others = 3.
loop at ifile.
format hotspot on.
write:/ ifile-name.
hide ifile-name.
format hotspot off.
endloop.
at line-selection.
concatenate p_path ifile-name into p_file.
clear itab. refresh itab.
open dataset p_file for input in text mode.
if sy-subrc = 0.
do.
read dataset p_file into wa.
if sy-subrc <> 0.
exit.
endif.
itab-rec = wa.
append itab.
enddo.
endif.
close dataset p_file.
loop at itab.
write:/ itab.
endloop.
Regards,
Rich Heilman -
File download from application server to presentation server
Hi,
We have requirment to upload a file to application server in .dbf format and then download it to presentation server. while downloading the file to presentation server some of the fields getting junk values. we are downloading file to excel sheet. some of the fields values are Russian texts. Those fields only getting junk values, all other fields are getting correct values.
Please advice.
Regards,
chandra.hi
sample code below should help you......
<u>Download to presentation server</u>
This program can be used to download files from Application server to presentaion server.
1)Maximum length of each field is considered to be 40 characters.
2)Maximum length of the field can be changed by specifying the length in selection screen parameter
3)First line of the Application server file should contain the description of each field.
4)Each field should be delimited by #.
*& Report ZDOWNLOADFILE *
REPORT ZDOWNLOADFILE
MESSAGE-ID B1 .
INCLUDES *
INCLUDE ZDOWNLOADFILE_TOP.
INCLUDE ZDOWNLOADFILE_FORM.
EVENT-AT SELECTION-SCREEN *
AT SELECTION-SCREEN ON pa_appl.
PERFORM check_file_exists USING pa_appl.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_appl.
PERFORM f4_dxfilename USING pa_appl.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_pres.
PERFORM f4_filename USING pa_pres.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_del.
PERFORM f4_dxfilename USING pa_del.
EVENT INITIALIZATION *
INITIALIZATION.
PERFORM initialization.
EVENT START-OF-SELECTION *
START-OF-SELECTION.
PERFORM determine_fields. "Determine number of columns
PERFORM build_itab. "Create internal table based on number
"of columns
PERFORM build_header. "To prepare header for the file
PERFORM download_data. "Download data to presentation server
PERFORM delete_files. "Delete files from application server
*& Include ZDOWNLOADFILE_TOP *
TYPES: BEGIN OF ty_header,
text(100) TYPE c,
END OF ty_header.
DATA: c_fnh_mask type dxfields-filemask value '.',
search_dir type dxfields-longpath value '/sapglobal/users'.
CLASS cl_abap_char_utilities DEFINITION LOAD.
Internal tables *
DATA: gt_header TYPE STANDARD TABLE OF ty_header,
gt_fieldcat TYPE lvc_t_fcat.
Work areas *
DATA: gs_header TYPE ty_header,
gs_fieldcat TYPE lvc_s_fcat.
DATA: wa_filename TYPE string.
DATA: wa_count(2) TYPE N,
wa_start(3) TYPE N,
wa_end(3) TYPE N,
wa_len(3) TYPE N.
DATA: wa_data(12000) TYPE c,
wa_off TYPE I,
itab_appl TYPE REF TO DATA,
itab_line TYPE REF TO DATA,
col(2) TYPE c.
DATA: wa_field(30) TYPE c.
DATA: lv_index TYPE sy-tabix.
DATA: gs_adrp type adrp,
gs_usr02 type usr02,
gs_usr21 type usr21,
gs_char50(50).
CONSTANTS: co_slash(1) value '/'.
FIELD-SYMBOLS: <itab> TYPE STANDARD TABLE,
<wa>,
<fs_line>,
<wa_line>.
SELECTION SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-f01.
PARAMETERS: pa_appl LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE text-f02.
PARAMETERS: pa_pres LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE text-f03.
PARAMETERS: pa_del LIKE rlgrap-filename .
PARAMETERS: pa_deld AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK B3.
SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE text-f04.
PARAMETERS: pa_len(3) TYPE c.
SELECTION-SCREEN END OF BLOCK B4.
*& Include ZDOWNLOADFILE_FORM *
*& Form f4_dxfilename
text
-->P_pa_appl text
form f4_dxfilename using p_file.
DATA: wa_file LIKE dxfields-longpath.
CLEAR: wa_file.
call function 'F4_DXFILENAME_TOPRECURSION'
exporting
i_location_flag = 'A'
i_server = ' '
i_path = search_dir
filemask = c_fnh_mask
fileoperation = 'R'
importing
o_path = wa_file
exceptions
rfc_error = 1
error_with_gui = 2
others = 3
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
p_file = wa_file.
endif.
endform. " f4_dxfilename
*& Form f4_filename
text
-->P_pa_pres text
form f4_filename using p_data.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
IMPORTING
FILE_NAME = p_data
endform. " f4_filename
*& Form check_file_exists
text
-->P_pa_appl text
form check_file_exists using p_file.
DATA: wa_file LIKE rlgrap-filename.
wa_file = p_file.
OPEN DATASET wa_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc = 8.
MESSAGE E714
WITH text-m01 p_file text-m02.
ELSE.
CLOSE DATASET p_file.
ENDIF.
endform. " check_file_exists
*& Form build_header
text
--> p1 text
<-- p2 text
form build_header .
*Select user details
clear gs_usr21-persnumber.
select single persnumber
into (gs_usr21-persnumber)
from usr21
where bname = sy-uname.
concatenate sy-uname
co_slash
gs_adrp-name_text(36)
co_slash
into gs_char50.
condense gs_char50.
clear gs_usr02-class.
select single class
into (gs_usr02-class)
from usr02
where bname = sy-uname.
concatenate gs_char50
gs_usr02-class
into gs_char50.
condense gs_char50.
Write report technical name
write 'Name: ' TO gs_header+0(10).
gs_header+11(*) = sy-repid.
APPEND gs_header TO gt_header.
CLEAR: gs_header.
Write user data
write 'User: ' TO gs_header+0(10).
gs_header+11(*) = gs_char50.
CONCATENATE gs_header gs_char50 INTO
gs_header SEPARATED BY SPACE.
APPEND gs_header TO gt_header.
CLEAR: gs_header.
Write System data
write 'System: ' TO gs_header+0(10).
write: sy-sysid to gs_header+11(3).
write: co_slash to gs_header+14(1).
write: sy-mandt to gs_header+15(3).
APPEND gs_header TO gt_header.
CLEAR: gs_header.
Write System date and time
write 'System: ' TO gs_header+0(10).
write sy-datum to gs_header+11(10).
write sy-uzeit to gs_header+22(8).
APPEND gs_header TO gt_header.
CLEAR: gs_header.
Write Local date and time
write 'Local: ' TO gs_header+0(10).
write sy-datlo to gs_header+11(10).
write sy-timlo to gs_header+22(8).
APPEND gs_header TO gt_header.
CLEAR: gs_header.
APPEND gs_header TO gt_header.
endform. " build_header
*& Form determine_fields
text
--> p1 text
<-- p2 text
form determine_fields .
DATA: wa_data(600) TYPE c.
CLEAR: wa_count,wa_start,wa_end,wa_data.
wa_start = 0.
wa_end = 1.
OPEN DATASET pa_appl FOR INPUT IN TEXT MODE ENCODING DEFAULT.
READ DATASET pa_appl INTO wa_data.
wa_len = STRLEN( wa_data ).
DO wa_len TIMES.
IF wa_data+wa_start(wa_end) EQ
cl_abap_char_utilities=>horizontal_tab.
wa_count = wa_count + 1.
ENDIF.
wa_start = wa_start + 1.
ENDDO.
CLOSE DATASET pa_appl.
wa_count = wa_count + 1.
endform. " determine_fields
*& Form build_itab
text
--> p1 text
<-- p2 text
form build_itab .
DATA: wa_len(4) TYPE c.
CLEAR: wa_len.
IF pa_len IS INITIAL.
wa_len = 40.
ELSE.
wa_len = pa_len.
ENDIF.
col = 1.
DO wa_count TIMES.
CONCATENATE 'FIELD' col INTO wa_field.
gs_fieldcat-fieldname = wa_field.
gs_fieldcat-outputlen = wa_len.
gs_fieldcat-datatype = 'CHAR'.
gs_fieldcat-col_pos = col.
col = col + 1.
APPEND gs_fieldcat TO gt_fieldcat.
CLEAR: wa_field.
ENDDO.
*Create the internal table dynamically based on the file structure,
*this table will be used to download data through GUI_DOWNLOAD fm
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = gt_fieldcat
IMPORTING
EP_TABLE = itab_appl
*Assign the pointer to the field symbol
ASSIGN itab_appl->* TO <itab>.
CREATE DATA itab_line LIKE LINE OF <itab>.
*Create a work area for the dynamic internal table
ASSIGN itab_line->* TO <wa_line>.
col = 1.
OPEN DATASET pa_appl FOR INPUT IN TEXT MODE ENCODING DEFAULT.
DO.
READ DATASET pa_appl INTO wa_data.
IF sy-subrc <> 0.
CLOSE DATASET pa_appl.
RETURN.
ELSE.
wa_start = 0.
lv_index = 1.
DO wa_count TIMES.
ASSIGN COMPONENT lv_index OF STRUCTURE <wa_line> TO <fs_line>.
FIND cl_abap_char_utilities=>horizontal_tab
IN wa_data+wa_start(*) MATCH OFFSET wa_off.
IF sy-subrc = 0.
IF wa_off NE 0.
<fs_line> = wa_data+wa_start(wa_off).
ENDIF.
wa_start = wa_start + wa_off + 1.
lv_index = lv_index + 1.
ELSE.
<fs_line> = wa_data+wa_start(*).
ENDIF.
ENDDO.
APPEND <wa_line> TO <itab>.
CLEAR: <wa_line>,<fs_line>.
ENDIF.
ENDDO.
endform. " build_itab
*& Form download_data
text
--> p1 text
<-- p2 text
form download_data .
clear: wa_filename.
wa_filename = pa_pres.
call function 'GUI_DOWNLOAD'
exporting
filename = wa_filename
filetype = 'DAT'
tables
data_tab = gt_header
exceptions
access_denied = 15
call function 'GUI_DOWNLOAD'
exporting
filename = wa_filename
filetype = 'DAT'
append = 'X'
tables
data_tab = <itab>
exceptions
access_denied = 15
endform. " download_data
*& Form initialization
text
--> p1 text
<-- p2 text
form initialization .
REFRESH: gt_header,gt_fieldcat,gt_header.
endform. " initialization
*& Form delete_files
text
--> p1 text
<-- p2 text
form delete_files .
IF pa_deld EQ 'X'.
DELETE DATASET pa_appl.
ENDIF.
IF pa_del IS NOT INITIAL.
DELETE DATASET pa_del.
ENDIF.
endform. " delete_files
<b>reward points if helpful.</b>
thanks
vijay -
How to open word document from application server?
hello ,
I want to open a word document that is placed on the application server.
the function module 'ws_execute' works fine for displaying documents placed on ur local file system. But if i want to open from application server, what needs to b done?
i m referring to the following demo program 'SAPRDEMOOFFICEINTEGRATION'
is this the correct reference or there is some other way to do the same?
kindly help.
Regards,
RoshaniHi Roshani,
The solution is like this.
1> Execute - this is the solution to your program. The file is generated and put in the Application Server for the data to be sent by some means to the intended Place.
2> To Display/View - This is for the person (who runs the program) to view if the output generated is correct or not.
So to accomplish this use the same internal table for both Open Dataset and Gui download.
Open dataset puts data onto the Application server and Gui_download puts the data onto the Desktop or Presentation server for the user to see the data thats fetched.
So use them as directed to achieve the desired output.
Reward Points.
Thanks,
Tej.. -
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 -
Excel File downloaded from application server is also opening in notepad
Hi Friends,
While downlaoding an excel file from the application server,we are able to open in notepad also.But this does not conatin the excel properties and hence happening.File should only oopen with excel and no other file type
Can any open help on this
ld_file = '/usr/sap/trans/abap/HR_DATA.xls'.
OPEN DATASET ld_file FOR OUTPUT in text mode ENCODING DEFAULT .
IF sy-subrc = 0.
LOOP AT int_final.
CLEAR wa_string.
CONCATENATE int_final-employee_sno int_final-employee_code INTO wa_string SEPARATED BY con_tab.
CONCATENATE wa_string int_final-first_name INTO wa_string SEPARATED BY con_tab.
please help...
Edited by: Neliea on Oct 29, 2009 1:11 PMHi,
Please refer to these links.
[url]Re: Internal table to excel download?;url]
[url]Re: Transfer from Internal Table to EXCEL file...;url]
Regards,
Aditya -
Delete file data from Application Server
Hello,
How do we delete data from the file on application Server.
For deleting the file, we use DELETE DATASET <filename>.
If we want to delete only the data and not the file, how to address it?
Please let me know.Hi , please check the following links, maybe using the truncate dataset can be helpful.
http://help.sap.com/saphelp_nw70/helpdata/EN/fc/eb3c7f358411d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/EN/d5/c3f58e9f3b11d2960000a0c9308b1f/frameset.htm
Another way could be get the file name and store in a var , then delete the file and afterwards
create a new one with the same name as stored in the var.
Thanks,
Walter Oliveira. -
Logic to fetch the file name from Application Server
Hi Friends
I have a requirement that : By giving the Directory name (eg:/tmp),I have to get the all file names stored under that Directory name.
Can anyone please provide me the logic / function modules related to this requirement.
Points are assured for useful answers.
Regards,
SreeHi,
use these:
function module "EPS_GET_DIRECTORY_LISTING"
FM RZL_DIR_READ instead. its easy and effective to use.
Or
FILE_GET_NAME_USING_PATH,
EPS_GET_DIRECTORY_LISTING
/SAPDMC/LSM_F4_FRONTEND_FILE
OPEN DATASET <Path / filename> FOR INPUT IN TEXT MODE...
if sy-subrc eq 8, then the file does not exist on the application server.
Reward Points if found helpfull..
Cheers,
Chandra Sekhar. -
File Access from DB Server/Unix Mounting
We have an Oracle Database that runs on Unix Box and a cold fusion application/web server runs on a Windows box. We have a data intensive stored procedure that gets data from DB, does lot of massaging and then create bunch of html files with sorting capabilities etc. This process happens upon user request from website (cold fusion/html page calling Oracle stored procedure). After this, the cold fusion server need to get access to these html files to display to the user.
Our Unix DBA's does NOT want to do File Mounting as they think the windows box is not secure. Hence we are exploring other options.
Below are the options we are exploring. But very well open to suggestions...
1. Let cold fusion query the data from Database and let it do the data manipulation/massaging
2. We explored the external tables (based on file) but the files are dynamic and could not find a way to do this
3. FTP transfer from Unix to NT box but there could be time delay and may not be available for immediate display
4. Create a temporary table, let the DB procedure insert data into table. Then Cold fusion will query from there.
Any other suggestions?Hi,
Its not required to handle for #
just read the dataset into the string and split the string into work area fields seoparated by TAb delimiter.
Eg:
READ DATASET <filename> INTO l_string.
SPLIT l_string
AT cl_abap_char_utilities=>horizontal_tab "Horizontal tab
INTO l_funcloc_clas-tplnr
w_funcloc_clas-class
w_funcloc_clas-klart
w_funcloc_clas-atnam
w_funcloc_clas-atwrt
w_funcloc_clas-atfor.
append w_funcloc_clas to l_funcloc_clas.
With Regards,
Dwarakanath.S -
Hi, I'm trying to write a class that will show something like JFileChoose.showOpenDialog but for server files. It's pretty simple, I'm passing a String array in the show() method. I tried to mimic the behavior of JFileChooser where the showOpenDialog would return an int indicating whether the user pressed OK, Cancel etc.
However, I'm trying to think of a way to block the show method until the user presses the ok or cancel button. What do you recommend?
If you think another aproach is better please let me know.
ThanksHave you considered actually using JFileChooser and just passing in a custom FileSystemView?
-
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 -
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 -
Download file from application server to internal table in background
hi all,
i want to download a file from appliaction server into my internal table but in background.
i had tryed CG3Z and CG3Y t-code but screen that is coming is asking for the parameters, and i want that screen should not appear and file should be saved in the predefined path by me.
if there any way to do so,
Points will be rewarded as per the Aswers.
thaks in advance.Hi Sudeep,
Use this code to get file data from application server.
REPORT ZE0232_BDC_APPLSERVER.
DATA: FILE_PATH TYPE STRING.
FILE_PATH = 'c:\bdc_mat.prn'.
DATA: BEGIN OF ITAB OCCURS 0,
END OF ITAB.
OPEN DATASET FILE_PATH FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC = 0.
DO.
READ DATASET FILE_PATH INTO ITAB.
IF ITAB-RESNO NE SPACE.
APPEND ITAB.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET FILE_PATH.
LOOP AT ITAB.
WRITE:/ ITAB.
ENDLOOP.
FILE PATH IS application server path.
IF USEFULL REWARD -
Dynamic selection of file in infopackage from application server
Hi,
We have a infopackage in Process chain which runs daily. In the infopackage 'EXTRACTION' tab , input file is from application server. The file we get daily is not unique.
As an example file name is not like 'UNIQUE.CSV' . It varies daily and carries a date and time stamp like UNIQUE_DATE_TIME.CSV
I think we can have a routine to handle this. can someone help me with the routine/code?
Thank you all.Hi,
1. Create Two Floders in AL11 i.e. in Apllication Server. Eg Name it F1 and F2.
2. First dump the .csv files into Folder F1 using some Programs or Manualy (Name xyz.csv).
3. Then load the data using InfoPackage (here IN infoPackage, Extraction Tab you need to select Adapter = Load Text File from Application Server and then give the correct path from Folder F1), through PC.
4. At the end of the load, attach a simple Program to Move the xyz.csv file from Folder F1 to Folder F2.
5. So next day the file will come to Folder F1 and the it will loaded to Cube/DSO and at the end it will move to Folder F2.
Else you can use simple one or two lines of UNIX/WINDOWS (depends on your OS) script to move the file from Folder F1 to Folder F2 , once you load is over.
While moving the file from Folder F1 to Folder F2 you can append the date at the end of the file and then move to Folder F2, it is use full for future reference.
See Blogs and Article, similar logic...
https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
How to transfer the Data from SAP-System to Non-SAP system without additional Cost/License
/people/surendrakumarreddy.koduru/blog/2009/03/11/how-to-transfer-the-data-from-sap-system-to-non-sap-system-without-additional-costlicense
To Check the Files/Reports in Application Server and Trigger Mail Alerts.
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/4096bf2d-bcea-2b10-4ab4-e0683830d9b2&overridelayout=true
1. Create Three Floders in AL11 i.e. in Apllication Server. Eg Name it F1, F2 and F3.
2. First dump the .csv files into F1. (Name xyz.csv).
3. Then using UNIX/WINDOWS (depends on your OS) script , first check the file is there are not in F1, if yes then rename the file with date and time or date and transfer the files from F1 to F2 i.e xyz06032010.csv.
4. Then Create a small ABAP program to check the file in F2, if it is there then Trigger the Event, and using that event you execute teh PC.
5. Then using UNIX/WINDOWS (depends on your OS) script , transfer the files from F2 to F3 i.e xyz06032010.csv.
6. Next day morning F1 and F2 are empty and F3 is having the backup files.
So use this method, I used the similar logic and it is working fine.
Timinings are importent i.e what time you need to dump the fule in F1 and what time you need to run UNIX/WINDOWS (depends on your OS) script , transfer the files from F1 to F2 and what time UNIX/WINDOWS (depends on your OS) script , transfer the files from F2 to F3.
Thanks
Reddy
Maybe you are looking for
-
Problem booting Lion after restoring disk from Time Machine
I have a late 2009 iMac which I have upgraded to Lion, having created a bootcamp partition with Windows Server 2008 before upgrading. This has been working absolutely fine for a few months but then there appeared to be some kind of hard disk problem
-
HT4623 How many email addresses can I add to my Apple account for iMessage?
I have an iPod, an iPod mini, an iPod touch and an iPod Touch. I would like to use four unique email addresses for each device, mainly to not get duplicate messages. I also became sober recently. And the frustration of not being able to uniquely iden
-
Mac OS X 10.7.3 Question
After installing Mac OS X 10.7.3 i keep getting error messages "You can't open the application Adobe Reader Updater Helper because PowerPC applications are no longer supported" What is this all about?
-
Hi, I want to compare 2 arraylist elements and set only the elemnts which doesnot match in either of the List. For example:- List<String> list1 = new ArrayList<String>(); list1.add("Italy"); list1.add("US"); list1.add("E
-
Help needed regarding sequence
is there any way of finding what was the last ddl operation peformed on a sequence. I am able to find the exact time of ddl operation on sequence but no the exact operation... plz reply me as soon as possible... thanks in advance regards, Adarsh.P