HRRCF_MDL_CAND_ATT_CREATE - Read file and covert to 'content'
Hi,
We are trying to use FM u2018HRRCF_MDL_CAND_ATT_CREATEu2019 to upload attachment for Candidate (Candidate already in E-Recruiting system). This FM has import parameter u2018CONTENTu2019 (Data Type u2018RAWSTRINGu2019).
I want to know how to read file (File type can be any) from drive and covert into u2018Contentsu2019. Is there any FM to do this?
Regards,
...Naddy
I'm getting type cpmpatiable error.
This is my code,
REPORT zhr_test_ngo_attachment.
PARAMETERS: p_cand TYPE hrobject DEFAULT '01NA50000305'
, p_head TYPE rcf_attachment_header
, p_fname TYPE string.
DATA: v_record TYPE rcf_s_mdl_cand_attachment,
v_content TYPE rcf_attachment_content,
v_messages TYPE bapirettab,
v_records TYPE rcf_t_mdl_cand_attachment,
v_size TYPE i,
v_string TYPE xstring.
DATA: BEGIN OF xml_tab OCCURS 0,
raw TYPE x,
END OF xml_tab .
v_record-att_type = '0012'.
v_record-language = 'E'.
v_record-att_header = p_head.
*Get file
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_fname
filetype = 'BIN'
has_field_separator = ' '
header_length = 0
IMPORTING
filelength = v_size
TABLES
data_tab = xml_tab
EXCEPTIONS
OTHERS = 1.
v_content = xml_tab[].
CALL FUNCTION 'HRRCF_MDL_CAND_ATT_CREATE'
EXPORTING
record = v_record
cand_hrobject = p_cand
content = v_content
filename = p_fname
IMPORTING
messages = v_messages.
IF sy-subrc <> 0.
WRITE 'Attachment Error'.
ENDIF.
Similar Messages
-
Read from .txt file and output the content as two arrays
I am using the contoured move to control the x-y stage. The trajectory datas for x and y axis are generated using my interpolation program and it is stored in a .txt file as two columns. What I want to do is read .txt file and output the content of this file as two arrays. Is there anyone has any ideas? Thanks, the .txt file is attached.
Attachments:
R.75.txt 172 KBHi Awen,
This is quite easy to do, you can merely use the "read from spreadsheet file" function to get a 2D array (2 columns and n rows) and then use the index array function to get whatever row/colums you want..
Hope the attached VI helps you
When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
Attachments:
read sprdsheet file.vi 27 KB -
Can a servlet read a jsp file and display its contents?
Hi,
I would like to know if Servlets can read a Jsp file and display its contents.. Right now for our website, I am using a html file to be displayed after a successful post operation through the Servlets...
-Thanks!I posted this in another thread.
Here's some code that reads using a URL. This doesn't work with JSPs as the server executes JSP when it connects but it's useful for other file types. Note that the filename is a URI</h1>This is <code>show.jsp</code></h1>
<hr>
<%! String file = null; %>
<%! java.io.InputStream is = null; %>
<%
file = request.getParameterValues("filename")[0];
try {
is = (new java.net.URL(file)).openStream();
} catch (java.io.IOException ioe) { out.write(file + " not found!<br>"); }
java.io.BufferedReader in = new java.io.BufferedReader(new java.io.InputStreamReader(is));
String line = "";
%>
<pre>
<%
while((line = in.readLine()) != null) {
%>
<%=line%>
<%
%>
</pre> -
Reading files and converting into xml structure
Hi,
In my application a client requests for the folder structure information to a server through RMI. The server needs to read files and folders on local machine and convert it into some structure (I am thinking of using xml) and send it back. For eg: I am planning to have Server send back something like:
<directory name = "parentdirectory">
<file name = "abc.jpg"/>
<file name = "def.bmp"/>
<directory" name = "subdirectory">
<file name = "hij.jpg"/>
<file name = "klm.bmp"/>
</directory>
</directory>
It is just the names of the files I am interested in and not the contents. Is this a good approach of sending back the data as a string containg xml definition. Is there any better appproach in terms of performance, memory etc? I am currently planning on using DOM for construction of this structure. Is there a source code for reading and converting the folder structure into xml. Just for your information, the clients gets this information and shows it as a tree structure on the GUI.
Thanks!!!!Is this a good approach of sending back the data as a string containg xml definition. It'll work.
An alternative, more direct approach is to build a memory representation and send this as argument/return value of an RMI call. You'd need to write classes MyDirectory and MyFile; MyFile has just a name; MyDirectory has a name and a collection of MyDirectory and one of MyFile. Make these classes implement Serializable and you can send them over RMI.
The effort to write those trivial classes would be less than to implement XML encoding/decoding, and also in terms of runtime performance and memory it will be hard to beat Java's serialization with anything XML-based. In this case I doubt performance/memory are relevant considerations though.
If for some reason I'd go for sending XML Strings anyway, I wouldn't do the encoding/decoding myself; I'd use XStream to convert Java classes to/from XML and still end up writing the above two classes and be done.
Sorry if you wanted a simple yes or no :-) -
How to create a file and store its contents into another file?
Hi,
I'm having some trouble trying to create a code where I have to to create a file and store its contents into another file?
I read the API, but I'm not certain how this file thing works.
Here's my code so far:
public static void main(String[] args) throws Exception
File file = new File("tasks.txt");
if (file.exists())
System.out.println("File already exists");
System.exit(0);
Scanner scan = new Scanner(System.in);
Scanner scan2 = new Scanner(System.in);
//Scans the input line by line
scan.useDelimiter("\\n");
//Scans the input by tabs
scan2.useDelimiter("\\t");
PrintWriter outputs = new PrintWriter("newtasks.txt");
outputs.print("ok");
outputs.println(3);
outputs.close();
}I managed to change my text into uppercase, but how do I store the uppercase content into another file.
-So this is what I did so far, I took a text file and modified its strings to uppercase.
-Now I need to put those modified strings into another text file, is there a way where I can do that with my current code?
-I already tried printwriter, but it doesn't seem to work
public static void main(String[] args)throws IOException
//Task[] oneHundredTasks = new Task[100];
String uppercase;
String combine;
Scanner scan = null;
FileInputStream in = null;
FileOutputStream out = null;
PrintWriter output = null;
try
scan = new Scanner(new BufferedReader(new FileReader("tasks.txt")));
scan.useDelimiter("\\n");
scan.useDelimiter("\\t");
while (scan.hasNext())
if(!scan.hasNext())
scan.next();
combine = scan.next();
uppercase = combine.toUpperCase();
System.out.println(uppercase);
finally
if (scan != null)
scan.close();
//The program will try the input and output files
try
in = new FileInputStream("tasks.txt");
out = new FileOutputStream("newtasks.txt");
int c;
//The number "-1" is used to indicate that it has reached the end of the stream.
while ((c = in.read()) != -1)
out.write(c);
finally
if (in != null)
in.close();
if (out != null)
out.close();
} -
How to browse a file and extract its contents
i want to browse a file and extract its contents.My code is given below but its not working .Can anybody help me please
JFileChooser fc = new JFileChooser();
int returnVal = fc.showOpenDialog(jfrm);
if (returnVal == JFileChooser.APPROVE_OPTION)
File file = fc.getSelectedFile();
//This is where a real application would open the file.
fileName=file.getName();
//This is a file function to extract data from a file.
//It reads data from a file that can be viewed on cmd
jlab3.setText(fileName);
try
// Open the file that is the first
// command line parameter
FileInputStream fstream = new FileInputStream(fileName);
// Convert our input stream to a
// DataInputStream
DataInputStream in =new DataInputStream(fstream);
// Continue to read lines while
// there are still some left to read
// while (in.available() !=0)
// Print file line to screen
fileName1=in.readLine();
jlab3.setText(fileName1);
in.close();
catch (Exception e)
System.err.println("File input error");
}JFileChooser fc = new JFileChooser();
int returnVal = fc.showOpenDialog(jfrm);
if (returnVal == JFileChooser.APPROVE_OPTION)
File file = fc.getSelectedFile();
//This is where a real application would open the file.
fileName=file.getName();
//This is a file function to extract data from a file.
//It reads data from a file that can be viewed on cmd
jlab3.setText(fileName);
try
// Open the file that is the first
// command line parameter
FileInputStream fstream = new FileInputStream(fileName);
// Convert our input stream to a
// DataInputStream
DataInputStream in =new DataInputStream(fstream);
// Continue to read lines while
// there are still some left to read
// while (in.available() !=0)
// Print file line to screenHere you are reading the first line of the file
fileName1=in.readLine();
//}and here you are displaying the line in a (I suppose) JLabel. A JLabel is not very suitable for displaying a file content, except is the file contain few characters !!!
jlab3.setText(fileName1);
in.close();
catch (Exception e)
System.err.println("File input error");
}If you want to read the complete file content you must uncomment lines inside while instruction, like this
while (in.available() > 0) { // I prefer to test in.available like this, instead of !=
// append text to a StringBuffer (variable named sb here) or directly in a textarea.
sb.append(in.readLine());
... -
I am working with a network analyzer. I have arrays made of 5 columns the first consisting of an integer and the next four consisting of complex numbers. I am converting the array into a spreadsheet string and then saving the file using the write characters to a file VI. That seems to work well as when I open the file in Excel all the data is there. However when I try to reverse the process, open file and convert back to array, I loose some of the data. Specifically the imaginary parts of my complex numbers are all going to zero. I have narrowed down the problem to be in the conversion from spreadsheet string to array and vice versa. I
think the problem may be with the 'format' input to the VI. I do not have an adequate resource for this so I am not sure what to put in to accomplish my task. Any takers?Hi Biz
I don't think there is a direct way of converting a complex number to a
string, so when you convert the array to a spreadsheet string, the
numbers would be converted to real data.
However, you could try separating the real and imaginary parts using the
"Numeric: Complex to Re/Im" function, and then store these - either in
separate files or in adjacent columns/rows in the same file. Then, when
you read in the data again, use the "Numeric: Re/Im to Complex" function
to put the two "halves" together.
If you actually want Excel to interpret the numbers as imaginary, then
you'll probably want to create a string for each complex number of the
form "Re + Im*i" (after separating the Re and Im parts), by using
"String:Format into String" with 2 numeric inputs and the format string
"%f+%fi".
Reading the data back into Labview then would require splitting the
string into the 2 pieces by using "Stringcan from String" with 2
numeric outputs (smae precision as original numbers specified by the 2
Default Value inputs) and the same format string "%f+%fi", and then using
the above-mentioned "Numeric: Re/Im to Complex" function. It worked for
me, so if you can't follow what I am describing, send me an email and I
can email you what I did (LV 5.1.1).
Paul
Biz wrote:
> Having trouble converting array to spreadsheet string, storing the
> file and coverting back to array with complex numbers
>
> I am working with a network analyzer. I have arrays made of 5 columns
> the first consisting of an integer and the next four consisting of
> complex numbers. I am converting the array into a spreadsheet string
> and then saving the file using the write characters to a file VI. That
> seems to work well as when I open the file in Excel all the data is
> there. However when I try to reverse the process, open file and
> convert back to array, I loose some of the data. Specifically the
> imaginary parts of my complex numbers are all going to zero. I have
> narrowed down the problem to be in the conversion from spreadsheet
> string to array and vice versa. I think the problem may be with the
> 'format' input to the VI. I do not have an adequate resource for this
> so I am not sure what to put in to accomplish my task. Any takers?
Research Assistant
School of Physiotherapy, Curtin University of Technology
Selby Street, Shenton Park, Western Australia, Australia. 6008
email: [email protected]
Tel. +61 8 9266 4657 Fax. +61 8 9266 3699
"Everyone who calls on the name of the Lord will be saved." Romans 10:12
"For all have sinned and fall short of the glory of God, and are
justified freely by his grace through the redemption that came by Christ
Jesus." Romans 3:23-4 -
I just stared having problems with importing files from nikon D810 into LR 5.7 it pop a window saying it can not read files on working on a imac 27" running yosemite on my mac pro after a few times it finally was able to read files and import them into LR I never had this problem before was there some kind of update that could of cause this?
-
Reading from a text file and displaying the contents with in a frame
Hi All,
I am trying to read some data from a text file and display it on a AWT Frame. The contents of the text file are as follows:
pcode1,pname1,price1,sname1,
pcode2,pname2,price2,sname1,
I am writing a method to read the contents from a text file and store them into a string by using FileInputStream and InputStreamReader.
Now I am dividing the string(which has the contents of the text file) into tokens using the StringTokenizer class. The method is as show below
void ReadTextFile()
FileInputStream fis=new FileInputStream(new File("nieman.txt"));
InputStreamReader isr=new InputStreamReader(fis);
char[] buf=new char[1024];
isr.read(buf,0,1024);
fstr=new String(buf);
String Tokenizer st=new StringTokenizer(fstr,",");
while(st.hasMoreTokens())
pcode1=st.nextToken();
pname1=st.nextToken();
price1=st.nextToken();
sname1=st.nextToken();
} //close of while loop
} //close of methodHere goes my problem: I am unable to display the values of pcode1,pname1,price1,sname1 when I am trying to access them from outside the ReadTextFile method as they are storing "null" values . I want to create a persistent string variable so that I can access the contents of the string variable from anywhere with in the java file. Please provide your comments for this problem as early as possible.
Thanks in advance.If pcode1,pname1,price1,sname1 are global variables, which I assume they are, then simply put the word static in front of them. That way, any class in your file can access those values by simply using this notation:
MyClassName.pcode1;
MyClassName.pname1;
MyClassName.price1;
MyClassName.sname1 -
How To read lib*.so files and verbose its content
Hi
Is there any command with which we can read shared library files and see whats its contents are i.e. whats are the functions available inside it and how its control flow.
Regards
JeetI know of none that shows flow control but you can do a man against nm(1) to see what is in the library (nm libc.so.1).
-
Hi,
I have a senario:
* Read text file from a directory.
* Post the content to MQ.
I dont have any schema for the content of the txt file.
So I used the opaque type in my FileAdapter while reading the text file and posted the data to MQ by using the MQAdapter.
But since content is opaque, data in the MQ is not understandable.
So I want to understand , how I can send the text data to MQ so that it can be understood.Hi All,
I found the solution for the error which I was mentioning.
I had to import below classes to make it work.
<bpelx:exec import="java.util.*"/>
<bpelx:exec import="java.lang.*"/>
<bpelx:exec import="java.math.*"/>
<bpelx:exec import="java.io.*"/>
<bpelx:exec import="oracle.soa.common.util.Base64Decoder"/>
After importing it my compilation problem is solved.
Now I have new problem :)
I have written below code in Java Embedding for the purpose of decoding
try
String messagePayload =(String)getVariableData("inputMessage");
// decode the message
byte[] decodedBytes = Base64Decoder.decode(messagePayload.getBytes());
String decoded = new String(decodedBytes);
setVariableData("tempBase64EncodedData",decoded);
catch(Exception e)
addAuditTrailEntry(e.toString());
But after this if, I am trying to copy message from "tempBase64EncodedData" to any other variable, it is coming as Empty.
So, my question is
* Am I doing correct thing to assign the decoded message into variable called "tempBase64EncodedData" ?
or
* Decoding iteslef is having some issues ? -
I downloaded a file to open a owners manual for a camera I needed. I had difficulty getting it down loaded and never could get the manual. I tried using my Safari browser and started getting this Goggle Quick Search file which opened in place of my Safari….I tried to close it and I can't. I did manage to get ride of the reader file.
You may have installed one of the common types of ad-injection malware. Follow the instructions on this Apple Support page to remove it. It's been reported that some variants of the "VSearch" malware block access to the page. If that happens, start in safe mode by holding down the shift key at the startup chime, then try again.
Back up all data before making any changes.
One of the steps in the article is to remove malicious Safari extensions. Do the equivalent in the Chrome and Firefox browsers, if you use either of those. If Safari crashes on launch, skip that step and come back to it after you've done everything else.
If you don't find any of the files or extensions listed, or if removing them doesn't stop the ad injection, ask for further instructions.
Make sure you don't repeat the mistake that led you to install the malware. It may have come from an Internet cesspit such as "Softonic" or "CNET Download." Never visit either of those sites again. You might also have downloaded it from an ad in a page on some other site. The ad would probably have included a large green button labeled "Download" or "Download Now" in white letters. The button is designed to confuse people who intend to download something else on the same page. If you ever download a file that isn't obviously what you expected, delete it immediately.
Malware is also found on websites that traffic in pirated content such as video. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow. Never install any software that you downloaded from a bittorrent, or that was downloaded by someone else from an unknown source.
In the Security & Privacy pane of System Preferences, select the General tab. The radio button marked Anywhere should not be selected. If it is, click the lock icon to unlock the settings, then select one of the other buttons. After that, don't ignore a warning that you are about to run or install an application from an unknown developer.
Still in System Preferences, open the App Store or Software Update pane and check the box marked
Install system data files and security updates
if it's not already checked. -
Upload 2 files and compare its contents
Hi guys,
I want to upload 2 files in SAP and compare its contents.
How am i going to do that?
Please provide sample code... Thanks a lot!
rgds,
MarkHi Mark,
I expected to use this code, once u can try this code.
OPEN DATASET lv_filename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc = 0.
LOOP AT gi_output1 INTO gwa_output1.
CLEAR lv_string.
CONCATENATE gwa_output1-matnr
gwa_output1-maktx
gwa_output1-werks
gwa_output1-bmeng
gwa_output1-posnr
gwa_output1-idnrk
gwa_output1-ojtxp
gwa_output1-mngko
gwa_output1-mmein
gwa_output1-flag
INTO lv_string
SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
TRANSFER lv_string TO lv_filename.
IF sy-subrc <> 0.
MESSAGE e006(zpdm).
ENDIF. "if sy-subrc <> 0.
ENDLOOP.
OPEN DATASET lv_filename FOR appending IN TEXT MODE ENCODING DEFAULT.
IF gi_output2[] is not initial.
LOOP AT gi_output2 INTO gwa_output2.
CLEAR lv_string.
CONCATENATE gwa_output2-matnr
gwa_output2-ojtxb
gwa_output2-werks
gwa_output2-bmeng
gwa_output2-posnr
gwa_output2-idnrk
gwa_output2-ojtxp
gwa_output2-mngko
gwa_output2-mmein
gwa_output2-flag
INTO lv_string
SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
TRANSFER lv_string TO lv_filename.
IF sy-subrc <> 0.
MESSAGE e007(zpdm). " WITH text-006.
ENDIF. "if sy-subrc <> 0.
ENDLOOP.
ENDIF. -
Synchronous read file and status update
Hi,
CSV file to be loaded into the database table. ASP used as front end and ESB should be used for backend processing!
A csv file is placed in a fileshare by an asp page. After that a button is clicked on the asp page which inserts a record into a database table(A) with the file details. There is a flag field in the table which will be set to 'F' initially.
Now there should be an esb service which will be polling for any new records inserted into the database table(A).
Once it finds any new record, the esb service should update the flag status to 'RF' from 'F' and read the records in the csv file(I think synchronous read file should be used inthe file adapter) and insert them into a database table(B). The flag field is updated to 'RF' so that the asp page informs the user that the csv file is being inserted into the table(B).
After all the records are inserted, the esb service should once again update the flag in table(A) to 'Y' from 'RF' so that the asp page will indicate the user that the csv file is loaded into the data base table.
The challenges that I have here are:
1) I need to have the ESB service with such a sequence of execution that updates the table(A) at each stage so that the asp page can display the status to the USER.
2) The csv file size can be huge. It can contain as many as 100 thousand records with over 50 fields in each record. I will have to probably debatch the file. Once we debatch, seperate instance would be created for each batch. Now we should see to that flag in table(A) is updated to 'Y' only when the last batch of the records are processed.
I am using jdev10134 and oracle SOA suite ESB10134
Someone please advice on how to go ahead.
Cheers,
RVHi,
CSV file to be loaded into the database table. ASP used as front end and ESB should be used for backend processing!
A csv file is placed in a fileshare by an asp page. After that a button is clicked on the asp page which inserts a record into a database table(A) with the file details. There is a flag field in the table which will be set to 'F' initially.
Now there should be an esb service which will be polling for any new records inserted into the database table(A).
Once it finds any new record, the esb service should update the flag status to 'RF' from 'F' and read the records in the csv file(I think synchronous read file should be used inthe file adapter) and insert them into a database table(B). The flag field is updated to 'RF' so that the asp page informs the user that the csv file is being inserted into the table(B).
After all the records are inserted, the esb service should once again update the flag in table(A) to 'Y' from 'RF' so that the asp page will indicate the user that the csv file is loaded into the data base table.
The challenges that I have here are:
1) I need to have the ESB service with such a sequence of execution that updates the table(A) at each stage so that the asp page can display the status to the USER.
2) The csv file size can be huge. It can contain as many as 100 thousand records with over 50 fields in each record. I will have to probably debatch the file. Once we debatch, seperate instance would be created for each batch. Now we should see to that flag in table(A) is updated to 'Y' only when the last batch of the records are processed.
I am using jdev10134 and oracle SOA suite ESB10134
Someone please advice on how to go ahead.
Cheers,
RV -
How to read file and output base64 string?
im having a hard time reading binary file and converting it to base64.
is there a parameter in extendscript like file.read('base64') ??It is possible in HTML:
var path = "/tmp/test";
result = window.cep.fs.readFile(path, cep.encoding.Base64);
if (0 == result.err) {
//success
var base64Data = result.data;
var data = cep.encoding.convertion.b64_to_utf8(base64Data);
else {
...// fail
You can also refer to the following samples for more examples:
https://github.com/Adobe-CEP/Samples/tree/master/Flickr
https://github.com/Adobe-CEP/Samples/tree/master/Collage
Maybe you are looking for
-
Error in loading standard item
Hello friends, As i posted the same thread already i need your helps again; When i execute the web template i am getting an error : Error in loading item standard. When i execute in RSRT2 transaction i can get the chart display. Also when i execute
-
Forms 4.5 fmb's cannot be opened in 6i
I got 100 Forms4.5 fmb's and cannot open them on my Windows XP Forms 6i notebook... Error: Cannot open file, when doubleclicking in the Open-File Dialog. I thought Forms 6i can open 4.5, 5.0 and 6.0 files ?
-
Exchange Server 2013: Installation failed while installing Mailbox role.
Hi, Mailbox role installation failed. I tried to remove and reinstall so many times but it still fails. (but the uninstall is complete) Below is log from the lastest installation. Could you please help to veify the problem. Error: The following error
-
Spellcheck not working/options missing.
I recently updated to 20 and my spellcheck context menu has vanished. What if you aren't even given the check spelling or languages menu option yet the broken red line under mispelled words occurs and no spelling suggestions made when right clicking
-
Call a PAL function within a view in HANA?
Hi community! Does anyone know how you can integrate the call of a PAL function (e.g tripple exponential smoothing) into a HANA view? I guess this must be achievable in a CE Script? Business scenario: we would like to show a time series based predic