Dowloading data to presentation server
Hi,
My requirement is to download large amount of data on to the presentation server. Space on presentation server is not an issue.
If I use GUI_DOWNLOAD, I need to know what type of file I need to create and whether there is any limit on the file size that is going to be created (since large amout of data needs to be downloaded). If not, is there any other way?
Also, since GUI_DOWNLOAD cannot be used in background processing (since large amout of data is being downloaded) will usage of SAP_GUI_PROCESSOR help in averting the time out while execution.
Advance Thanks...
Hi,
If you are using background processing then you cannot use GUI_DOWNLOAD.
so its better to download the file to application server using OPEN DATASET .
Then you can use the Transaction CG3Y to download the file to presentation server.
Hope this solves your problem.
Reward points if helpful.
Thanks and regards
Similar Messages
-
Downloading .xml/.tx data to presentation server while running background.
Hi experts,
I have a requiremnt to downloading .xml/.txt data to presentation server while running background.
when i run the program in foreground with use of GUI_upload/ Gui_download its working fine but not working in background.
i can't use email/data download to database file and than get it option as data can be huge.
Can anybody help me out regarding this.
Thanks
Anuj jainHi anjui,
it'snt possible to download a file in background using gui_download.
You could try to create a Shell Command (transaction SM69) to transfer data in a shared directory.
You can execute Os Commands using function module SXPG_COMMAND_EXECUTE
Alessandro -
GUI_UPLOAD NOT READING DATA FROM PRESENTATION SERVER
H HI IN MY APPLICATION I HAVE USED GUI _UPLOAD TO READ DATA FROM PRESENTATION SERVER IT WAS WORKING FINE BUT NOW I HAVE SCHEDULED IT IN BACK BACKGROUND WHEN I DEBUGGED IT GUI _UPLOADI NOT READING DATA FROM PRESENTATION SERVER
Edited by: ravikumar1006 on Mar 10, 2012 1:18 PM
Moderator message: FAQ, please search before posting, do not write in all upper case.
Edited by: Thomas Zloch on Mar 10, 2012 3:17 PMThe issue is that, when you schedule a program as background job runs on application server not on local pc for that program use the application server resurces and its not possible to read files from pc. You can find a lot of answers in forum for this
-
Reading data from presentation server.
I have a text file in which records are space seperated.I will be entering the file name in selection screen in a parameter 'infile1' and I am trying to upload these records into a internal table using function module GUI_UPLOAD.but i get a message saying that the filename given has a different field type .function module allows you to specify only fields of particualar type under filename. my code is.
data: begin of period_rec,
pval01(3), "version
pval04(4), " fiscal year
pval06(10), " cost centre
pval12(10), " cost element
bdc0301(15), " fixed cost period 01
bdc0302(15), " fixed cost period 02
bdc0303(15), " fixed cost period 03
bdc0304(15), " fixed cost period 04
bdc0305(15), " fixed cost period 05
bdc0306(15), " fixed cost period 06
bdc0307(15), " fixed cost period 07
bdc0308(15), " fixed cost period 08
bdc0309(15), " fixed cost period 09
bdc0310(15), " fixed cost period 10
bdc0311(15), " fixed cost period 11
bdc0312(15), " fixed cost period 12
end of period_rec.
parameters : infile1 like rlgrap-filename.
data: tab like period_rec occurs 10 with header line.
call function 'GUI_UPLOAD'
exporting
filename = infile2
FILETYPE = 'ASC'
tables
data_tab = tab
EXCEPTIONS
if sy-subrc <> 0.
endif.Hi,
Chk ths:
as above posts just change infile1 to string and secondly u r giving infile2 which is not declared.
*& Report ZMBJ_GUI_UPLOAD
REPORT zmbj_gui_upload.
DATA: BEGIN OF period_rec,
pval01(3), "version
pval04(4), " fiscal year
pval06(10), " cost centre
pval12(10), " cost element
bdc0301(15), " fixed cost period 01
bdc0302(15), " fixed cost period 02
bdc0303(15), " fixed cost period 03
bdc0304(15), " fixed cost period 04
bdc0305(15), " fixed cost period 05
bdc0306(15), " fixed cost period 06
bdc0307(15), " fixed cost period 07
bdc0308(15), " fixed cost period 08
bdc0309(15), " fixed cost period 09
bdc0310(15), " fixed cost period 10
bdc0311(15), " fixed cost period 11
bdc0312(15), " fixed cost period 12
END OF period_rec.
PARAMETERS : infile1 type string.
DATA: tab LIKE period_rec OCCURS 10 WITH HEADER LINE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = infile1
filetype = 'ASC'
TABLES
data_tab = tab.
* EXCEPTIONS
IF sy-subrc <> 0.
ENDIF. -
How to download data which comes in back ground job to presentation server.
HI ,
I am creating one job which has to download data to presentation server.
for back ground jobs gui_download will not work..
plz sugest the alternative for this...
thakns in advance,
khasimsathere are so many posts in SCN , please search .
write data to application server in background and then download to presentation server online. -
Transfer to presentation server
Hi Guru,
I am downloading the data to presentation server. But it should download to another peson m/c.How to do that .
Pls help me.
For ex. There are two persons A and B.
When A is executing the data then it sud download in the m/c of B.
ThanksHi,
You can download the file directly into another system it is working I have done it is possible. 1st you have to map the system in your network places then you can give the path directly it will dowloads.
Steps:
1. 1st you have to map the system in your network places there you will get a option add network place click on that it will gives popup screen there you can press next button.
2. In next step it will asks choose another network location select that and click on next button
3. In next screen you will get browse button from there you can browse and select the path and click on that next button
4. Finally it will asks you finish button click on finish button it will creates a network place on your system
5. This path you can give directly where you want it will downloads there directly
Note: If it is same network it will works normally as I said. and If It is in other network you have to use VPN connection then it will works.
See below Example I tried it was worked.
DATA: IT_MARA TYPE STANDARD TABLE OF MARA WITH HEADER LINE.
SELECT * FROM MARA INTO TABLE IT_MARA.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = '
abcsrvr\abc\TEST.XLS'
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
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 = ' '
WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE
SHOW_TRANSFER_STATUS = ABAP_TRUE
IMPORTING
FILELENGTH =
tables
data_tab = IT_MARA
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.
Thanks
Ganesh -
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 create an EXCEL file in Presentation server
hello experts,
please suggest me a solution for the following problem :
I have an internal table with some data.
how can i create an excel file with that data in Presentation Server.
Thanks & Regards
sasi.hi,
u can use FM: 'DOWNLOAD'.
it will prompt u for destination - just give the requd filename and extension.
Ex:
call function 'DOWNLOAD'
exporting
filename =
filetype = 'DAT'
tables
data_tab = tb_output
fieldnames = tb_fld_nam
exceptions
invalid_filesize = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
customer_error = 7
others = 8.
where,
tb_output = internal table having the fields which u want in the O/P
Ex:
data: begin of tb_output occurs 0,
name_1(20) type c,
name_2(20) type c,
end of tb_output.
tb_fld_nam = Field headings :
Ex:
data: begin of tb_fld_nam occurs 0,
name(25) type c,
end of tb_fld_nam.
tb_fld_nam-name = 'Name 1'.
append tb_fld_nam.
tb_fld_nam-name = 'Name 2'.
append tb_fld_nam.
Thanx & Regards,
Ajoy -
Hi Guru,
I am downloading the data to presentation server. But it should download to another peson m/c.How to do that .
Pls help me.
For ex. There are two persons A and B.
When A is executing the data then it sud download in the m/c of B.
ThanksHi Sandeep Garg ,
This is very simple. Create a mapdrive to that another person's machine and give that machine folder path in your program. Make sure to share the folder in the another person's machine.
Thanks,
Greetson -
Format problem while presentation server download.
Hi,
I am using 'GUI_DOWNLOAD' to download employee data on presentation server . I am getting a problem where all text is downloaded in single line in text file.
I can see in debug mode that the output table has 2 lines .However, these are shown as single line in the download.
Can anyone help me with this?
Thanks in advance!
Regards,
AleriaCheck parameter WRITE_LF and FILETYPE.
Best Regards, Dirk -
How to load tab limited data into apllication server
Hello All,
I have 2 questions.
1)I have data in a table,i want to place this data in the applcation server with tabdelimiter in ASC.How do i proceed?
2)I have the data in my application server in a compressed text format,i want to download this data into a zip file (i am using the filetype 'BIN' to download this data to presentation server.However when i unzip this file my file is not tabdelimited.Is there any way i can download the file of type Bin into a zip file so that when i unzip it ,it should be tabdelimited?
Thanks in advance.
Sujatha gokarajuHello,
Do like this
PARAMETERS: P_FILE TYPE RLGRAP-FILENAME,
P_TRZEI TYPE C DEFAULT ';'.
PERFORM DOWNLOAD_DATA.
*& Form DOWNLOAD_DATA
* text
* --> p1 text
* <-- p2 text
FORM DOWNLOAD_DATA.
DATA: OUTPUT TYPE STRING,
L_F_NETWR(21) TYPE C,
L_F_ERDAT_OR(10),
L_F_ERDAT_IN(10),
L_F_ERDAT_DE(10),
L_F_POSID LIKE PRPS-POSID.
OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE.
IF SY-SUBRC = 0.
LOOP AT G_T_OUTTAB.
CLEAR L_F_NETWR.
WRITE: G_T_OUTTAB-NETWR TO L_F_NETWR,
G_T_OUTTAB-ERDAT_OR TO L_F_ERDAT_OR,
G_T_OUTTAB-ERDAT_IN TO L_F_ERDAT_IN,
G_T_OUTTAB-ERDAT_DE TO L_F_ERDAT_DE.
CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT'
EXPORTING
INPUT = G_T_OUTTAB-PS_PSP_PNR
IMPORTING
OUTPUT = L_F_POSID.
IF NOT P_TAB IS INITIAL.
CONCATENATE G_T_OUTTAB-VBELN
G_T_OUTTAB-POSNR
G_T_OUTTAB-VKBUR
L_F_POSID
G_T_OUTTAB-BSTKD
L_F_NETWR
L_F_ERDAT_OR
L_F_ERDAT_IN
G_T_OUTTAB-VBELN_IN
L_F_ERDAT_DE
G_T_OUTTAB-VBELN_DE
INTO OUTPUT
SEPARATED BY CON_TAB.
ELSE.
CONCATENATE G_T_OUTTAB-VBELN
G_T_OUTTAB-POSNR
G_T_OUTTAB-VKBUR
L_F_POSID
G_T_OUTTAB-BSTKD
L_F_NETWR
L_F_ERDAT_OR
L_F_ERDAT_IN
G_T_OUTTAB-VBELN_IN
L_F_ERDAT_DE
G_T_OUTTAB-VBELN_DE
INTO OUTPUT
SEPARATED BY P_TRZEI.
ENDIF.
TRANSFER OUTPUT TO P_FILE.
CLEAR L_F_NETWR.
ENDLOOP.
ELSE.
MESSAGE E041(S9) WITH P_FILE.
ENDIF.
CLOSE DATASET P_FILE.
ENDFORM. " DOWNLOAD_DATA
Cheers,
Vasanth -
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 -
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... -
"Bad data format" when reading txt file from the presentation server
Hello,
I have a piece of code which reads a txt file from the presentation server to an internal table like below:
DATA : lv_filename type string.
lv_filename = 'C:\abap\Test.txt'. "I created a folder called abap under C:\
CALL method CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
EXPORTING
FILENAME = lv_filename
CHANGING
DATA_TAB = lt_tsd. " lt_tab has the exact same fields as the Test.txt's. Test.txt has only one line, tab delimited.
When running this code, exception BAD_DATA_FORMAT is issued.
Is it because of the file encoding or delimiter or other reason?
Thanks,
YangHello,
If its tab delimited then use the has_field_seperator parameter and check
DATA : lv_filename type string.
lv_filename = 'C:\abap\Test.txt'. "I created a folder called abap under C:\
CALL method CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
EXPORTING
FILENAME = lv_filename
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = u2018Xu2019
CHANGING
DATA_TAB = lt_tsd.
Vikranth -
Presentation server date modification
hi friends..
i want to change the presentation server date for test case..
can you guide me how to change ? where can i change ?
for eg if sy-datum is 1.07.2008 i want this date 30.05.2008 for testingHi deva,
it is not suggestible to change the date of the presentation server.it is better to take temporary date variable and apply the changes on sy-datum value and store the resultant date value in it and use in your program.
if it useful, reward points.
Thank you,
Prasad G.V.K
Maybe you are looking for
-
I ve created a website using adobe muse for a client, and due to his hosting company had to covert and upload site to html and use a third party ftp loader FILEZILLA. The site is www.sin-connections.com. This works fine in Safari, but not Firefox. al
-
FOR ALL ENTRIES in Object Oriented Context
Dear all, is it possible to use FOR ALL ENTRIES for an internal table with out header line ? I Am using Objected Oriented Programming and I Am not able to create internal table with header line . Please provide your valuable inputs on thi
-
Webservice fails to preload on startup in JDEVELOPER11g
Staff, I am trying to trouble every time I try to start the test, a look at the webservice log below and if any can help me I am very grateful, I'm using Jdeveloper11g (11.1.0.2) LOG: C:\OracleJdev\Middleware\jdeveloper\system\system11
-
Where can I get a users manual for my EOS 600
I have searched everywhere but can't get any info on my Canon EOS 600 .Every time I enter EOS 600 I get info on a Rebel or a Rebel Ti or Elan or some other Canon camera. Canon does have info on a 620 , a 630 , and a 650 but nothing on a EOS 600 , Th
-
Hi All, I found that Flash web services doesn't work with import tags( http://www.adobe.com/devnet/flash/articles/flmxpro_webservices_03.html ).Is it also true for Flex .Becaue When i try to access a web service from flex I keep getting Error# 2032 (