How to dynamically define a file name and its path in a web application
Hi, I want to create a simple web application that reads from an XML file and displays the data back to the user. The xml file is created independent of my application on the same machine that the Application Server runs. How can I define my xml file name and/or path to be independent of my code and not hard-coded in my application?
By an external configurationfile? That can be a propertiesfile, a xml file, an ini file, a plain vanilla txt file, etcetera.
Similar Messages
-
How to find PG.xml file name and path associated with a FUNCTION
Hi,
I am having a function:IRC_VIS_HOME_PAGE with Web HTML value as below:
OA.jsp?akRegionCode=IRC_VIS_HOME_PAGE&akRegionApplicationId=800&OAPB=IRC_BRAND
How to find PG.xml file name and path assoicated with above funtion.
Thanks,
ashokAshok,
Function IRC_VIS_HOME_PAGE will have 2 parameter defined for it which are OASF and OAHP where
OASF=<SelectedFunctionName> - this tells the Framework to select this function in the given "Home Page" menu context.
OAHP=<HomePageMenuName> - this is used ONLY with the OASF parameter, and it is used to establish the current menu context. It should point to a "Home Page" menu.
--Shiv -
How to print the report file name and path and the last mod date
Good morning,
I am trying to print on the footer of the report the report file name and path as well as the report last modification date.
Anyone would know how I can do that? I have checked the doc but found nothing.
Thks. Philippe.Did you ever determine how to print report name and report last mod date?
Thanks -
How do I put the file name and path into either the header or the footer?
I need to keep track of pdf documents as their names or locations sometimes change. I need to show both file name and path, preferably in the header. I would also like it to refresh automatically when I change, say, the file name, but that's not as essential as the basic function of showing the file name and path.
You will need to do this with a text field and a Javascript that executes on open.
-
Ho to get file name and full path of a local file
I want to be able to get the file name and it's full path of
a local file. I was thinking of using "FileReference" but
FileReference doesn't permint accessing the local file path. Can
anyone suggest a way of doing this.
ThanksYou will have to create 2 different versions.
See this example we have created using JSystem
http://jsystem.flashjester.com
Download the example file provided.
Hope this helps.
Regards
FlashJester Support Team
e. - [email protected]
w. - www.flashjester.com
"This has been one of the most impressive and thoroughly
pleasant
experiences of customer support I have ever come across -
astounding!"
Director - hedgeapple -
How to get the source file name and transform into database
Hi,
We need to load data from source file abc.csv into oracle table. during loading, we need to keep the file name abc.csv and write into the database table as one field. Is there anyone who did the similar task? and how to make it? Pls help!Hi,
If you can write the filename to a text file, you may do the following:
(1) create a text-file containing the name of your source-file.
(2) create an external table using that text-file as input.
Now, you can SELECT the filename from the external table.
Of course, you need a way to : create the flat file, handle the flat file, etc.
Grtz. -
How can I set the file name and folder for output to PDF from another application?
I am developing an application in Microsoft Access where the printed reports are to be saved in PDF format for archive purposes. I can send the output to Adobe X, but the default file name is the Access report name and the folder selected is the one last used.
What I need to do is to create the file with a specific name (which changes for each run) and to a specific folder (which also changes for each run).
The language I'm using is Visual Basic for Applications which is located in an Access form that controls the report production.
Any suggestions, please?Got it - many thanks.
-
How to write context.lookup("jndi name ") and its syntex
hi
i m a new one and doing this jms type program for the first time. i copy a source code and paste but at the compilation time there is no error.
at the run time i get the exception as
Naming Exceptionjavax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
can anyone help me how to write the code of below statement as i m getting the wrong jndi name
QueueConnectionFactory queueConnectionFactory =
(QueueConnectionFactory) context.lookup("QueueConnectionFactory");
and its configuration style in ejb-jar and jboss.jar.
getting a reply soon may be my good luck.Have a look at:
http://wiki.jboss.org/wiki/Wiki.jsp?page=Getquotjavax.naming.NoInitialContextExceptionquot -
How to dynamicly create a field name AND access it
All,
I am trying to build a code block that will access what amounts to a table structure inside a table. I have 38 occurances if a set of 3 fields. (Source system had an internal array/occurs clause that was converted for our ODS into individual fields) I am returning a single row as a row type and have addressability to all fields. What I am trying to avoid is coding my logic block 38 times, 1 for each occurance.
FOR X IN 1 .. 38 LOOP
V_CAT_CD_X := 'CAT_'||X||'_CD';
End Loop;
The following is the display of the correctly built field:
--> Loop Cat CD: CAT_1_CD Rec count:1 Loop counter:1
--> Loop Cat CD: CAT_2_CD Rec count:1 Loop counter:2
--> Loop Cat CD: CAT_3_CD Rec count:1 Loop counter:3
--> Loop Cat CD: CAT_4_CD Rec count:1 Loop counter:4
My problem is that my row cursor PP1 is addressable hardcoding PP1.CAT_1_CD or PP1.CAT_2_CD ect, however I am having problems using my created string to access the field.
What do I need to do to gain accessability via this method?
I do have the ability to select the column names from the system tables but even then, I am lacking addressability to my ROW type using the selected field name.
Thanks
GregNot sure if this is what you are looking for:
SQL> ed
Wrote file afiedt.buf
1 declare
2 my_cur SYS_REFCURSOR;
3 v_rec mytest%rowtype;
4 cursor c1 is select column_name from all_tab_cols where table_name = 'MYTEST';
5 v_sql_stmt VARCHAR2(1000) := NULL;
6 BEGIN
7 v_sql_stmt := 'SELECT ';
8 FOR I IN c1 LOOP
9 v_sql_stmt := v_sql_stmt||I.column_name||',';
10 end loop;
11 v_sql_stmt := RTRIM(v_sql_stmt,',');
12 v_sql_stmt := v_sql_stmt||' FROM mytest';
13 open my_cur for v_sql_stmt;
14 LOOP
15 FETCH my_cur INTO v_rec;
16 EXIT WHEN my_cur%NOTFOUND;
17 dbms_output.put_line(v_rec.a);
18 END LOOP;
19 close my_cur;
20* end;
SQL> /
1
2
PL/SQL procedure successfully completed.
SQL> Edited by: AP on Nov 17, 2010 5:29 AM -
How to dynamically populate a manager name and level for any user who login
Hi All,
I need some help in doing this in my DB:
Table 1 is the the manager hierarchy {which basically shows the structure of every employee's org).
Table 2 is a list of all people manager ( all these usernames will also be in table 1). What i need to find is using the username from Table 2, the highest level that username exists in the manager hierarchy.
For ex:
Table 1: { What this shows is Sam is CEO and Jeff reports to him. So for Sam, he will exist on all 15 levels and Jeff will have Sam has his top level manager and then Jeff will repeat for all remaining levels till 15.
Manager Level 0 Level 1 Level 2 Level 3...Level15
Sam Sam Sam Sam Sam
Sam Jeff Jeff Jeff Jeff
Now in Table 2:
User Name Manager Level/Name
Sam Manager Level 0 Sam
Jeff Manager Level 1 Jeff
As you see, for each user name in Table i want to populate their high level from the manager hierarchy {their record in manager hierarchy).
Hope This helps to clear the confusion.
ThanksHello,
this is the forum for the tool {forum:id=260}. Please mark this question as answered, so others know that they can ignore it.
Then post again in {forum:id=75}
Regards
Marcus -
How to validate a file given the file name and the path
hi ,
is their any function module which can validate a file present in the presentation server given its filename and path nameHi,
Refer Sample Code Below:
Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : rb_pc RADIOBUTTON GROUP r1 DEFAULT 'X', "For Presentation
p_f1 LIKE rlgrap-filename,
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN SKIP.
AT SELECTION-SCREEN ON p_f1.
IF p_f1 IS INITIAL.
MESSAGE e000(zmm) WITH text-002. ' Enter File Path
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_f1.
*-- Browse Presentation Server
PERFORM f1000_browse_presentation_file.
FORM f1000_browse_presentation_file .
CONSTANTS: lcl_path TYPE char20 VALUE 'C:\Migration Files\'.
CALL FUNCTION<b> 'WS_FILENAME_GET'</b>
EXPORTING
def_path = lcl_path
mask = c_mask "',.,..'
mode = c_mode
title = text-006
IMPORTING
filename = p_f1
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE s000 WITH 'No file Selected'.
flg_pre = c_x.
ENDIF.
ENDFORM. " f1000_browse_presentation_file
*& Form f1001_browse_appl_file
Select file from Application Server
FORM f1001_browse_appl_file.
DATA: lcl_directory TYPE char128,
lcl_file TYPE char10.
lcl_directory = p_direct.
CALL FUNCTION <b>'/SAPDMC/LSM_F4_SERVER_FILE'</b>
EXPORTING
directory = lcl_directory
filemask = c_mask
IMPORTING
serverfile = p_f2
EXCEPTIONS
canceled_by_user = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e000(zmm) WITH text-039.
flg_app = 'X'.
ENDIF.
ENDFORM. " f1001_browse_appl_file
*& Form f1003_pre_file
Open Presentation Server file
FORM f1003_pre_file .
DATA: lcl_filename TYPE string.
CONSTANTS: lc_codepage(3) TYPE c VALUE 'IBM', " Code page
lc_filetype TYPE char10 VALUE 'ASC'.
lcl_filename = p_f1.
CHECK p_f1 IS NOT INITIAL.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lcl_filename
filetype = lc_filetype
has_field_separator = c_x
TABLES
data_tab = i_reg_grp
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.
<b>Reward points if this helps.
Manish</b> -
How to print file name and date on document
How can we print the file name and date, like in the old days, on a document as a header or footer?
Not the print dialog for iWork but in the app itself. Here is Pages:
Regards,
Colin R. -
How to set file name and destination folder without user interaction
how can I set the file name and destination folder to generate a pdf file like "c:\myfolder\document.pdf" in this folder automatically.
Is there a tag in .joboptions ?
Goal: User click print button. In the background a pdf will be generated in e.g. "C:\myfolder\document.pdf".
that`s it.
I know that the query dialog for save as can be turned off. But the file name depends on the application.
Thanks for your help.
TKHello,
Please post this in PI forums
Regards, Anil -
File adapter - How to pass File name and path at runtime
Hi gurus,
We want to use PI 7.0 as an ftp server and expose the config as a webservice where the service consumer can pass one or more file names and the path to pick them and drop them on a fixed ftp server.
So precisely, I need to be able to set the file name, target directory parameters in both sender and receiver file/ftp adapters at runtime. is this possible at all ?
I am aware of passing Adapter specific parameters from sender file adapter to receiver file adapter to create the same folder structure and file names. But my requirement is different. I hope I am clear.
Could I please get some advise on this .
Thanks & Kind Regards,
Jhansi.Hi Jhansi,
Either you can go ahead with dynamic configuration as said by other SDN'ers. Else can go with Java Mapping:
Here is the code for Java Mapping:
import com.sap.aii.mapping.api.*;
import java.io.*;
import java.text.*;
import java.util.*;
public class GetDynamicConfiguration implements StreamTransformation {
private Map param;
public void setParameter(Map map1) {
this.param = map1;
public void execute(InputStream inputstream, OutputStream outputstream) throws StreamTransformationException {
try {
AbstractTrace trace = null;
// a) Set ouput File name
String directory=null;
trace = (AbstractTrace)param.get(StreamTransformationConstants.MAPPING_TRACE );
param.put(DynamicConfigurationKey.create("http://sap.com/xi/XI/Dynamic", StreamTransformationConstants.DYNAMIC_CONFIGURATION), "");
DynamicConfiguration conf = (DynamicConfiguration) param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
String filename =conf.get(key);
conf.put(key, filename);
trace.addInfo("File name is "+filename);
if(filename.equals("in.txt"))
directory = "/home/ftpxi/in";
if(filename.equals("test.txt"))
directory = "/home/ftpxi/in/test";
if(filename.equals("shweta27.txt"))
directory = "/home/ftpxi/in/test";
trace.addInfo("Directory name is "+directory);
conf.put(key1, directory);
// b) Just copy input file to output file
byte[] b = new bytehttp://inputstream.available();
inputstream.read(b);
outputstream.write(b);
} catch (Exception exception) {
exception.printStackTrace(); -
How to get uploaded file name and path in BefExportToDat event script
I would like to get hold of the uploaded file name and full path in the event script "BefExportToDat", as I need to extract values from particular fields. However I have not yet found a way to do this.
- The input variable "strFile" returns the .Dat file path in the Outbox, to which it is about to export the data. This is no use to me.
- The API variable RES.PstrFilename is returning nothing
I am using RES.PstrFilename in the "BefFileImport" event script in a different FDM application and it works fine, however I need to find a way to get this to work in the "BefExportToDat" event script.
Please let me know how this might be achieved.I am looking through the API calls in FDM Workbench, but cannot see the table (tPOVPartitions) you mentioned listed. Is this the correct name? And do I just use the function listed in the object browser to run the query?
Furthermore (going back to my initial thoughts of using strFile), it appears that although the variable contains the .Dat filename and path, the actual file is non-existent when "BefExportToDat" is executed:
Error:
Error: Export failed.
Detail: File not found.
This would make sense, but it does make the variable "strFile" a little pointless since one cannot make use of the file in this particular event script. Do you please have any thoughts on this?
Maybe you are looking for
-
Upgrade 11.1.1.5 to 11.1.1.6 Linux X86 64
Hi, Just upgraded from 11.1.1.5 to 11.1.1.6. Here you have my detailed upgrade procedure based on links below. Hope it will help some of you. Guides: http://www.oracle.com/technetwork/middleware/bi-enterprise-edition/downloads http://docs.oracle.com/
-
Tasks display fine in iCal, but not in Mail
In iCal I have my task list on the right which is showing all my tasks just fine. However, in Mail I have an IMAP account with a Apple Mail To Do folder instead of a special entry in the source list for tasks. I used to have a special entry for that,
-
Iphone4 no longer connecting to itunes
All of a sudden it has stopped syncing and connecting to itunes. It is not listed in the display like normal. I tried restarting the phone, restarting the computer and reinstalling itunes, all according to the help screens. This is what I get when
-
Problem in Creating new row & inserting data using CreateInsert and Commit
Hello All, I have created a page there are few input text and i want to insert the data into a database table. I have created an Application Module I am using CreateInsert and Commit operation but there is one problem. At first it created a row in da
-
After the IOS7 Upgrade my phone now randomly types.
I have already restored the iphone 5. The screen twitches, the apps randomly open, and phone freezes.