Creating a directory statically in the Application Server
Hi,
I need to create a directory in the application server statically (not through code), in which I later have to store and read files. Most forums talk about doing this through AL11 --> Configure.
While this does create an entry in the directory list in AL11, I doubt if the directory was actually created in the AS. Double clicking this directory name shows an error message in the status bar (Wrong order of calls <- CALL opendir: No such file or directory). So I believe the directory is not created at all.
How do I set up a directory which I can browse and see, and use for creating / reading files?
My AS is on AIX OS.
Thanks,
Z
Hi,
Yes, Could we not do it from SAP screens?
Go to Al11 and in that you can see a tab Configure.
There you can create the Directory and say Add button
and then Save .
and after that Using
Open Data set ds1 for Output.
will create the File if it is not there .
you can specify the path in which you can create the files.
check this thread as well:
Creating a directory & subdirectory on Application Server
Sachin
Edited by: Sachin Dhingra on Jan 22, 2009 11:02 AM
Similar Messages
-
How we create a flat file on the application server
hi,
how we create a flat file on the application servere,this file have the header data and corresponding item data also.
i.e. how we use the AT NEW and ATEND. statement in this file creation.
pls send me some code related to this.
thanks,
vipinHi Grafl,
Chk this link
Folder creation in AL11 using ABAP program
try this code.This works on UNIX servers
data: unixcom like rlgrap-filename.
data: begin of tabl occurs 500,
line(400),
end of tabl.
dir = unixcom = 'mkdir mydir'. "command to create dir
"to execute the unix command
call 'SYSTEM' id 'COMMAND' field unixcom
id 'TAB' field tabl[].
<b>Reward Points if Useful</b>
Regards
Gokul -
ABEND while creating file in the application server
Dear All,
Please provide the solution for the following.
REPORT ZMAIN.
SELECT BKORM UP TO 1000
EXTRACT ext.
ENDSELECT
Imagine, now the extract file having 1000 Entries
Reading the above EXTRACT file
LOOP .
submit ZSUB.
ENDLOOP.
End OF Main Program----
REPORT ZSUB.
SELECT BKORM UPTO 500
EXTRACT ext.
ENDSELECT
Here for each submit of the ZSUB, it is creating one EXTRACT file in the application server. When it reaching to create 999, it is going for ABEND.
Can anybody provide the solution to avoid going for ABEND .
Is there any restriction to create extract files in the applciation server?
Thanks in advance.Instead of select/endselect, try to use a loop with internal tables..
There's no limit in the extracts you can do..
<removed by moderator>
Edited by: Thomas Zloch on Nov 2, 2010 5:20 PM - please do not ask for... -> Ok
Edited by: Roberto Vacca on Nov 2, 2010 5:29 PM -
Password protected Excel sheet on the application server (dataset)
How can I create password protected excelsheet on the application server? Is it possible through DATASET?
How can I modify below statement to create xls password protected?
OPEN DATASET dest FOR OUTPUT IN BINARY MODE.
Regards
Kcould you ask moderator (via abuse button) to move it to the ABAP forum?
Edited by: Sandra Rossi on Nov 23, 2009 1:13 PM -
API for creating a directory in the application server
Hello,
Does anyone knows a way to create a directory in the application server? Something similar to
CL_GUI_FRONTEND_SERVICES but for managing files in the application server?
Thanks in advance
Diz IsMiActually, CL_GUI_FRONTEND_SERVICES=>Directory_Create works really good for me.
REPORT ZRICH_0001 .
data: path type string.
data: rc type sy-subrc.
path = '\172.52.72.651qfilesvr400S109XXXXusrsapTSTSYStest'.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_CREATE
EXPORTING
DIRECTORY = path
CHANGING
RC = rc
EXCEPTIONS
DIRECTORY_CREATE_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
PATH_NOT_FOUND = 4
DIRECTORY_ACCESS_DENIED = 5
DIRECTORY_ALREADY_EXISTS = 6
UNKNOWN_ERROR = 7
others = 8
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,
Rich Heilman -
How to check whether the Application Server directory exits or not
Hi,
I have a selection screen in which I give the Application server file name(UNIX file) as input. Here, I would like to check whether the Server directory exists or not.
Let us say, the path I gave in the selection screen is /usr/sap/tmp/testfile.txt . Here, the file name is testfile.txt and the server directory is /usr/sap/tmp . I would like to check whether this directory /usr/sap/tmp exists in the server or not. I am not bothered about the file name as I am going to write data into the file. I am mainly concerned about whether the directory exists in the server or not. and one more thing... this is the Application Server path not the Local path.
Can anyone help me on the same how to check whether the server directory exists or not.
Thanks in advance.
Best Regards,
Pradeep.Also you can use the FM EPS_GET_DIRECTORY_LISTING for this purpose.
Store the directory name
l_dpath = p_file+0(l_no).
Validate the directory of the application server
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
dir_name = l_dpath
TABLES
dir_list = l_i_dlist
EXCEPTIONS
invalid_eps_subdir = 1
sapgparam_failed = 2
build_directory_failed = 3
no_authorization = 4
read_directory_failed = 5
too_many_read_errors = 6
empty_directory_list = 7
OTHERS = 8.
If any problem occurs with the directory then display proper
error message
IF sy-subrc <> 0.
Display error message
MESSAGE e018 WITH 'Problem with directory entered'(008).
ENDIF. " sy-subrc <> 0
Regards,
Joy. -
How do upload a file to the application server into a directory?
hi to all,
i want to upload file into the database..i need upload the file into the application server and save it to a directory..is there any way?where i can read about this?any information?
ashwinyHello,
First, we need to determine the terms we are using, in order to avoid confusion. We (including the documentation) are using "upload" to describe storing the file on the server, and "download" to pull it from the server into local machine.
You can use the "File Browse" item to upload any file you need from your local machine and into a database table. The default APEX configuration (in the dads.conf file) stored the uploaded file in a table called wwv_flow_file_objects$. In your application, you can access this table using a view called APEX_APPLICATION_FILES.
After you uploaded a file, any user can access it, using the download procedure described in the reference I gave you. The download procedure gives you an option to store the download file anywhere you need, using the "Open/Save" dialog box.
I believe this is covering everything you need. If you still having problems, please consider posting the relevant application pages on apex.oracle.com. It will be easier to understand and help you.
Regards,
Arie. -
How to find out the application server instance name?
Hi,
I installed an Oracle application server a long long while ago and completely forgot the things about the installation, including the name of the instance (I installed single instance, not cluster). Now I am trying to create a connection to the application server and I am prompted to fill in the instance name. Where in the installation can I find out the instance name?
The version of the server as displayed when the server is started:
$ ./oc4j -start
Starting OC4J from /oraInventory/j2ee/home ...
09/10/08 16:04:39 Oracle Containers for J2EE 10g (10.1.3.2.0) initializedThis 10.1.3.2.0 number is somewhat confusing. As I understand it, right now if you download a copy of the Application server from Oracle web site, the current version is 10.1.3.1.0.
I am also reading the installation guide now and when looking at the server starting messages on the screen, I realize that installing the server in the oraInventory directory is not quite right. Does that interfere with the correct functioning of the server? I installed it but have never tried to use it until now.
Many thanks for your help!
NewmanJ. Newman wrote:
Hi,
I installed an Oracle application server a long long while ago and completely forgot the things about the installation, including the name of the instance (I installed single instance, not cluster). Now I am trying to create a connection to the application server and I am prompted to fill in the instance name. Where in the installation can I find out the instance name?If you have access to that server, then the following should give the instance name.
grep 'IASname' $ORACLE_HOME/config/ias.properties
you should also see it in the AS Control Console page.
The version of the server as displayed when the server is started:
$ ./oc4j -start
Starting OC4J from /oraInventory/j2ee/home ...
09/10/08 16:04:39 Oracle Containers for J2EE 10g (10.1.3.2.0) initializedThis 10.1.3.2.0 number is somewhat confusing. As I understand it, right now if you download a copy of the Application server from Oracle web site, the current version is 10.1.3.1.0.
Regarding the version numbers, this fourth digit refers to the Component-specific release number. The OAS documentation says this about it.
"This digit identifies a release level specific to a component. Different components can have different numbers in this position depending upon, for example, component patch sets or interim releases."
I am also reading the installation guide now and when looking at the server starting messages on the screen, I realize that installing the server in the oraInventory directory is not quite right. Does that interfere with the correct functioning of the server? I installed it but have never tried to use it until now.
Many thanks for your help!
NewmanI think Oracle software should always be installed in a separate directory. I think it may also generate errors in its functioning but it will certainly create a whole lot confusion and mess in later administration and configurations.
hope that helps!
AMN
Edited by: AMN on Oct 8, 2009 5:14 PM -
FIle Creation in the Application Server With Unicode-8 and Byte-Order Mark
Hi Guys,
I've requirement of creating a file in the Application server with the Data.
The Data Format Should be in UTF-8 and Byte-Order Mark.
I need to supply this data from SAP to PRMS.
I'm able to create a file with Unicode, but any of the guys have worked on Umicode with Byte-Order Mark, please let me know.
Thanks,
Adi.Hi Mathieu,
If you haven't found an aswer yet, you can check in transaction SE24 CL_ABAP_FILE_UTILITIES method CREATE_UTF8_FILE_WITH_BOM. You can check the code of the method (it's very short) so you can understand how it works. It's also a static method so you can call it directly in your program.
Ex:
CALL METHOD cl_abap_file_utilities=>create_utf8_file_with_bom(your_file_name).
I hope this helps.
Pax Vobiscum.
~ Eric -
Working with File Properties on the Application Server
Hi,
I am looking for a way to get the size of a file existing in a directory in the application server without reading it.
Is there a function module or a static method that returns a file properties exists in the application server?
Thanks,
Eyal.hi Eyal,
fm <b>EPS_GET_FILE_ATTRIBUTES </b>
regards Andreas -
Query Results to the Application Server
Hello Experts,
We have a requirement where when we execute a query, the query results in the excel format should be placed in a folder in the application server.From the Application server I need to send these results using the FTP service to the different locations.
Can someone please suggest me how to place the query results in the application server and how to send these results using the FTP service to the different locations.
Regards,
SachinHi Sachin,
Yes its possible
Using RSCRM_BAPI TCode schedule the report based on your requirement i.e. daily, weekly...etc. And then dump the report result into one path (Directory) in Application Server.
Create FTP/SFTP User ID in Application server level in BW System.
Check the below link for more info
/people/surendrakumarreddy.koduru/blog/2009/03/11/how-to-transfer-the-data-from-sap-system-to-non-sap-system-without-additional-costlicense
Regards
KP -
How to check whether file exist in a folder at the application server
Hi to all experts.
if suppose there is a file at the application server test.txt my requirement if the one more file is created of the same name before overwriting the file a warning message is to displayed to the user that the file already exist .
how to do itHI Mohammed,
use The FM DX_FILE_EXISTENCE_CHECK
or static class CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
For more info
search file in application server
application server
hope it helps you.
Regards! -
How to change the format in the application server
The following is the uploading file in the application server:
Directory: /usr/sap/tmp
Name: ZMIRACA_SD27_LIUNIN_20070109_111913.csv
,0,000,ZMAT_TERRY,,19.12.2006,test material by terry,
,0,000,ZMAT_TERRY,,19.12.2006,test material by terry,
I click the menu System->List->Save->Local file->Spreadsheet and give a name: a.csv, then I open "a.csv", I find ",0,000,ZMAT_TERRY,,19.12.2006,test material by terry,,,EXTERNAL P,1.000,000,EA,," in one cell,but I want to separate them in different cell according to comma. Do you have some idea?
Thanks in advance!
NinaHI Nina
Have created a CSV file myself on application server using the following example code:
parameters: fname type filename obligatory lower case.
data: it_t001 type table of t001.
data: str type string.
field-symbols: <wa>, <fld>.
select * into table it_t001 from t001.
open dataset fname for output in text mode encoding default.
if sy-subrc ne 0.
write:/ 'Unable to open file.'.
else.
loop at it_t001 assigning <wa>.
clear: str.
do.
assign component sy-index of structure <wa> to <fld>.
if sy-subrc ne 0.
transfer str to fname.
exit.
elseif sy-index = 1.
move <fld> to str.
else.
concatenate str <fld> into str separated by ','.
endif.
enddo.
endloop.
endif.
After executing the program, have checked the file using following methods and i dont have any problem:
1. FTP transfer to PC.
2. AL11 -> Display -> Menupath: System->List->Save->Local File->Spread Sheet
3. Transfer via transaction: CG3Y.
In all the cases, the values are in separate cells. Please verify.
Kind Regards
Eswar -
Browse folder in the application server
Hi there,
In a program, I need to create an output file, and to save it either in the applictaion server or in the presentation server.
But I want the user to be able to choose the folder where to save it, not the file itself. Browsing the Web I have found a method of a class, the cl_gui_frontend_services=>directory_browse, by means of which I achieved displaying a screen to select a folder in the computer.
But I couldn't find a function module for displaying a screen for the user to choose a folder from the application server.
Sending an 'A' in the parameter i_server in function module F4_DXFILENAME_TOPRECURSION won't work, since the window displayed is to choose a file and not a folder.
Thanks a lot in advance.
Regards,
IgnacioSELECTION-SCREEN BEGIN OF BLOCK 002 WITH FRAME TITLE text-002.
PARAMETERS : p_aps LIKE rlgrap-filename MODIF ID pth .
SELECTION-SCREEN END OF BLOCK 002.
DATA : path_name(150) TYPE c.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_aps.
SUBMIT rs_get_f4_dir_from_applserv AND RETURN.
IMPORT path_name FROM MEMORY ID 'PATH_NAME_SDL'.
p_aps = path_name.
[Retrieve application server file names in F4 help|http://searchsap.techtarget.com/tip/0,289483,sid21_gci943422,00.html]
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
PERFORM application_server_path.
*& Form application_server_path
FORM application_server_path.
IF p_read = 'X'.
*& Selecting file from server on pressing f4
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
EXPORTING
directory = '.\'
filemask = ' '
IMPORTING
serverfile = p_file1
EXCEPTIONS
canceled_by_user = 1.
ELSE.
MESSAGE 'F4 is only valid for transfering data from Server to PC' TYPE 'S'.
ENDIF.
ENDFORM. " application_server_path -
How to see the file at the application server
HI TO ALL SDNERS ,
THIS IS MY CODE WHERE TO CHECK THE DOWNLOADED FILE AT THE APPLICATION SERVER.IN TCODE AL11 I HAVE SEEN THERE IS NO FILE GETTING CREATED.WHEN TRANSFERRING THE SY-SUBRC VALUE IS ZERO.
Program Name : ZME11_BDC.
Title : PURCHASE INFORMATION RECORD LOAD PROGRAM
Program Objective : THIS PROGRAM READS IN THE PURCHASE
INFORMATION FILE. IT CREATES A BDC SESSION TO
USE TO LOAD THE PURCHASE INFORMATION RECORDS
INTO SAP using the ME11 Transaction.
REPORT ZME11_BDC no standard page heading MESSAGE-ID ZHNC line-size 55.
constants declaration
constants: c_x value 'X',
c_sess type apqi-groupid value 'zcustomer',
c_xd01 type tstc-tcode value 'ME11'.
DECLARING VARIABLES
DATA: V_MSG(255),
V_ERREC TYPE I,"NO OF FAILED RECORDS
V_LINES."NO OF RECORDS
FLAG DECLARATIONS
DATA: FG_DATA_EXIST VALUE 'X',"CHECK FOR DATA
FG_SESSION_OPEN VALUE ''.
STRUCTURES AND INTERNAL TABLE DECLARATIONS
TYPES :BEGIN OF TY_PIR,
LIFNR TYPE EINA-LIFNR,
MATNR TYPE EINA-MATNR,
EKORG TYPE EINE-EKORG,
WERKS TYPE EINE-WERKS,
VERKF TYPE EINA-VERKF,"sales person
TELF1 TYPE EINA-TELF1,"telephone
URZLA TYPE EINA-URZLA,"country
REGIO TYPE EINA-REGIO,"region
APLFZ(5),"plan deleivery time
EKGRP TYPE EINE-EKGRP,"purchase group
NORBM(13),
NETPR(13),
END OF TY_PIR.
DATA : IT_PIR TYPE TABLE OF TY_PIR,
WA_PIR LIKE LINE OF IT_PIR.
DATA: BEGIN OF IT_BDCDATA.
INCLUDE STRUCTURE BDCDATA.
DATA END OF IT_BDCDATA.
DATA : BEGIN OF IT_BDCMSG.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA END OF IT_BDCMSG.
SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER : FNAME TYPE RLGRAP-FILENAME.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION ON VALUE REQUEST
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FNAME.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = FNAME.
START OF SELECTION
START-OF-SELECTION.
PERFORM F_GET_DATA USING FNAME
CHANGING IT_PIR.
PERFORM F_GENERATE_DATASET USING FNAME
CHANGING IT_PIR WA_PIR.
*& Form F_GET_DATA
text
-->P_V_FNAME text
<--P_IT_PIR text
FORM F_GET_DATA USING P_FNAME LIKE FNAME
CHANGING P_IT_PIR LIKE IT_PIR.
DATA: LV_FILE TYPE STRING.
LV_FILE = FNAME.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = LV_FILE
FILETYPE = 'DAT'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = P_IT_PIR
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF P_IT_PIR IS INITIAL.
FG_DATA_EXIST = ''.
ENDIF.
ENDFORM. " F_GET_DATA
*& Form F_GENERATE_DATASET
text
-->P_V_FNAME text
<--P_IT_PIR text
FORM F_GENERATE_DATASET USING P_V_FNAME LIKE FNAME
CHANGING P_IT_PIR LIKE IT_PIR
P_WA_PIR LIKE WA_PIR.
MESSAGE I001(ZHNC).
*OPENING FILE AT THE APPLICATION SERVER FOR WRITING
OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC EQ 0.
MESSAGE I002(ZHNC).
LOOP AT P_IT_PIR INTO P_WA_PIR.
SPLIT P_WA_PIR AT '*' INTO P_WA_PIR-LIFNR
P_WA_PIR-MATNR
P_WA_PIR-EKORG
P_WA_PIR-WERKS
P_WA_PIR-VERKF
P_WA_PIR-TELF1
P_WA_PIR-URZLA
P_WA_PIR-REGIO
P_WA_PIR-APLFZ
P_WA_PIR-EKGRP
P_WA_PIR-NORBM.
*TRANSFER THE FILE FROM INTERNAL TABLE TO APPLICATION SERVER
MESSAGE I003(ZHNC).
TRANSFER P_WA_PIR TO FNAME.
ENDLOOP.
*CLOSING THE FILE AT THE APPLICATION SERVER
CLOSE DATASET FNAME.
ENDIF.Hello,
I made a similar program. You can have a look at it.
*& Form write_to_app_server
text
--> p1 text
<-- p2 text
FORM write_to_app_server.
To get filename
PERFORM get_filename.
To write into the application server
OPEN DATASET g_filename_with_path FOR OUTPUT IN TEXT MODE.
IF sy-subrc = 0.
LOOP AT <l_table> INTO <l_line>.
TRANSFER <l_line> TO g_filename_with_path.
ENDLOOP.
CLOSE DATASET g_filename_with_path.
ELSE.
CLOSE DATASET g_filename_with_path.
ENDIF.
To send mail
PERFORM send_mail.
ENDFORM. " write_to_app_server
*& Form get_filename
text
--> p1 text
<-- p2 text
FORM get_filename.
DATA : l_log_path TYPE filepath-pathintern
VALUE 'Y28M_DOWNLOADS_BACKGROUND' .
CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
EXPORTING
client = sy-mandt
logical_path = l_log_path
operating_system = sy-opsys
file_name = p_fname
IMPORTING
file_name_with_path = g_filename_with_path
EXCEPTIONS
path_not_found = 1
missing_parameter = 2
operating_system_not_found = 3
file_system_not_found = 4
OTHERS = 5.
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. " get_filename
You may find it useful.
Regards,
Karuna.
Maybe you are looking for
-
FTP user accounts to access AEBS HD
I am pretty new to apple and apple products so this maybe a no-brainer to some folk. I have an AEBS with a LaCIe HD attached and a Mac mini. I would like to set up user accounts to access the HD over the internet. I have been looking into FTP options
-
SQL Devloper working fine but not SQL Plus
Hi, I am facing a problem that I can connect to oracle server via SQL Developer but cannot connect to the same using SQL*Plus. ORA-12154: TNS:could not resolve service name I checked many forums and followed each advices but in vein. To make sure tha
-
Error V0104 in BAPI_SALESORDER_SIMULATE
Hello, While executing BAPI BAPI_SALESORDER_SIMULATE I end up with error V0104 and processing terminates. This has got to do with the screen sequence and entries are missing in table T185D. Is it not that this table has to be maintained using transac
-
How do I recover a lost serial number?
I threw out my Adobe Elements 10 case, which had the original serial number on it, and I don't know how else to reinstall it to another computer without it. I did not register my product online before it was thrown out either. With that, does anyone
-
AIR App Made in Flash AS3 Installer Error
I created a desktop AIR 2.6 app using AS3 in Flash 5.5. After I publish it and try to install it I get this error: The app works great when I just run the swfs. I have published apps before using the same software and haven't had any problems. Thi