Read Text Parameters
Hi All ;
I have problem with read text parameters.
Now Im using the parameters like below;
name = belnr + gjahr + buzei
call function 'READ_TEXT'
exporting
client = sy-mandt
id = '01'
language = sy-langu
name = name
object = 'AKKP'
tables
lines = tab_line[]
But I want to add bukrs to the name variable like that;
name = bukrs + belnr + gjahr + buzei
If I use the name parameter with bukrs the read_text function doesnt work.
Could you help about that ?
Regards
Fırtına
Hello Yigit ,
Add zeros to bukrs , belnr , gjahr and buzei and concatenate into name.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = bukrs
IMPORTING
OUTPUT = bukrs
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = belnr
IMPORTING
OUTPUT = belnr..
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = gjahr
IMPORTING
OUTPUT = gjahr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = buzei
IMPORTING
OUTPUT = buzei.
Concatenate bukrs belnr gjahr buzei into name.
Please pass NAME filed to the READ_TEXT FM.
Thanks
Similar Messages
-
What is use of Read-Text command in Sapscript plz replay
What is use of Read-Text command in Sapscript plz replay
i m geting problem with read-text command in sapscript as will as
perform and endperform .Hi Majid,
It's a function module to read the texts from a text file. Generally it is used to retrieve the long texts.
The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options.
After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES.
If a reference text is used, SAPscript automatically processes the reference chain and provides the text lines found in the text at the end of the chain. If an error occurs, the system leaves the function module and triggers the exception REFERENCE_CHECK.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
OBJECT = ?...
NAME = ?...
ID = ?...
LANGUAGE = ?...
ARCHIVE_HANDLE = 0
IMPORTING HEADER =
TABLES LINES = ?...
EXCEPTIONS ´
ID =
LANGUAGE =
NAME =
NOT_FOUND =
OBJECT =
REFERENCE_CHECK =
WRONG_ACCESS_TO_ARCHIVE =
Export parameters
Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.
Reference field: SY-MANDT
Default value: SY-MANDT
OBJECT
Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.
Reference field: THEAD-TDOBJECT
NAME
Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.
Reference field: THEAD-TDNAME
ID
Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.
Reference field: THEAD-TDID
LANGUAGE
Enter the language key of the text module. The system accepts only languages that are defined in table T002.
Reference field: THEAD-TDSPRAS
ARCHIVE_HANDLE
If you want to read the text from the archive, you must enter a handle here. The system uses it to access the archive. You can create the handle using the function module ACHIVE_OPEN_FOR_READ.
The value '0' indicates that you do not want to read the text from the archive.
Reference field: SY-TABIX
Default value: 0
Import parameters:
HEADER
If the system finds the desired text, it returns the text header in this parameter.
Structure: THEAD
Table parameters:
LINES
The table contains all text lines that belong to the text read.
Structure: TLINE
Exceptions:
ID
The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.
LANGUAGE
The parameter LANGUAGE contains a language key that does not exist in table T002.
NAME
The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.
Possible errors:
The field contains only blanks.
The field contains the invalid characters * or ,.
OBJECT
The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.
NOT_FOUND
The system did not find the specified text module.
REFERENCE_CHECK
The text module to be read has no text lines of its own but refers to the lines of another text module. This reference chain can include several levels. For the current text, the chain is interrupted, that is, one of the text modules referred to in the chain no longer exists.
WRONG_ACCESS_ TO_ARCHIVE
The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).
Br,
laxmi. -
Reading Texts longer than 132 Characters
Hello Seniors,
I am working on Reading Texts more that 132 characters long.Texts should include Symbols also.I want to <b>Create and Save</b>the texts and then <b>read</b> them wherever I want from ABAP functions.
I want to know the Transports information relating to this.
Could there be any function modules (with relevant parameter passing)to create long texts and then read them where ever I need.
Thank You,
cnc.HI
Check the fun module <b>READ_TEXT</b>, CREATE_TEXT and SAVE_TEXT and EDIT_TEXT etc related to the Std texts
Have to pass the parameters like OBJECT,ID, OBJECTNAME,LANGUAGE
You can transport these texts using the program <b>RSTXTRAN</b>
see the doc
READ_TEXT
READ_TEXT provides a text for the application program in the specified work areas.
The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options.
After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES.
If a reference text is used, SAPscript automatically processes the reference chain and provides the text lines found in the text at the end of the chain. If an error occurs, the system leaves the function module and triggers the exception REFERENCE_CHECK.
Function call:
CALL FUNCTION 'READ_TEXT'
EXPORTING CLIENT = SY-MANDT
OBJECT = ?...
NAME = ?...
ID = ?...
LANGUAGE = ?...
ARCHIVE_HANDLE = 0
IMPORTING HEADER =
TABLES LINES = ?...
EXCEPTIONS ID =
LANGUAGE =
NAME =
NOT_FOUND =
OBJECT =
REFERENCE_CHECK =
WRONG_ACCESS_TO_ARCHIVE =
Export parameters:
CLIENT
Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.
Reference field: SY-MANDT
Default value: SY-MANDT
OBJECT
Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.
Reference field: THEAD-TDOBJECT
NAME
Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.
Reference field: THEAD-TDNAME
ID
Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.
Reference field: THEAD-TDID
LANGUAGE
Enter the language key of the text module. The system accepts only languages that are defined in table T002.
Reference field: THEAD-TDSPRAS
ARCHIVE_HANDLE
If you want to read the text from the archive, you must enter a handle here. The system uses it to access the archive. You can create the handle using the function module ACHIVE_OPEN_FOR_READ.
The value '0' indicates that you do not want to read the text from the archive.
Reference field: SY-TABIX
Default value: 0
Import parameters:
HEADER
If the system finds the desired text, it returns the text header in this parameter.
Structure: THEAD
Table parameters:
LINES
The table contains all text lines that belong to the text read.
Structure: TLINE
Exceptions:
ID
The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.
LANGUAGE
The parameter LANGUAGE contains a language key that does not exist in table T002.
NAME
The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.
Possible errors:
The field contains only blanks.
The field contains the invalid characters * or ,.
OBJECT
The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.
NOT_FOUND
The system did not find the specified text module.
REFERENCE_CHECK
The text module to be read has no text lines of its own but refers to the lines of another text module. This reference chain can include several levels. For the current text, the chain is interrupted, that is, one of the text modules referred to in the chain no longer exists.
WRONG_ACCESS_ TO_ARCHIVE
The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).
<b>Reward points for useful Answers</b>
Regards
Anji -
Read Scripting Parameters within a Filter
Hello,
I'd like to have a Plug In which can read Scripting Parameters and run accordignly.
One of the code samples in the SDK is called "PoorMansTypeTool".
In its documentation it is said to be able to "Read scripting parameters".
I look into its code yet I couldn't figure how it does it.
Let's say I have a script with a variable 'a'.
The script launches a filter from the filter lists and want to pass the valu of the parameter 'a' to the filter.
How could that be done?
Are there any constraints on the parameter type, size, etc?
Has anyone tried it before?
If someone could guide me through the plug in code I'd be happy.
Thank You.// make this a function so we can hide these from harness script
main();
function main() {
// Save the current preferences
var startRulerUnits = preferences.rulerUnits;
var startTypeUnits = preferences.typeUnits;
var startDisplayDialogs = displayDialogs;
// Set Photoshop to use pixels and display no dialogs
preferences.rulerUnits = Units.PIXELS;
preferences.typeUnits = TypeUnits.PIXELS;
displayDialogs = DialogModes.NO;
// make this stuff controlled by the harness
var maxTime = 1 * 60;
var iterations = 5;
var percIncrease = 20;
var timeIt = new Timer();
var tests = 0;
var errors = 0;
var eArray = new Array();
var dissolveLog = new File( "~/Desktop/Dissolve.log" );
dissolveLog.open( "w", "TEXT", "????" );
dissolveLog.writeln( "width,\theight,\tdepth,\tpercent,\tdoc create time,\tdissolve time" );
var maxWidth = 30000;
var minWidth = 256;
var incWidth = parseInt( (maxWidth - minWidth) / iterations );
if ( incWidth == 0 )
incWidth = 1;
var maxHeight = 30000;
var minHeight = 256;
var incHeight = parseInt( (maxHeight - minHeight) / iterations );
if ( incHeight == 0 )
incHeight = 1;
// start clean
while (documents.length) {
activeDocument.close(SaveOptions.DONOTSAVECHANGES);
var d = BitsPerChannelType.EIGHT;
for ( var w = minWidth; w < maxWidth; w += incWidth ) {
for ( var h = minHeight; h < maxHeight; h += incHeight ) {
try {
var timeImport = new Timer();
if ( d == BitsPerChannelType.EIGHT )
d = BitsPerChannelType.SIXTEEN;
else
d = BitsPerChannelType.EIGHT;
app.documents.add(UnitValue(w, "px"), UnitValue(h,"px"), undefined, "Dissolve Test", undefined, undefined, undefined, d);
timeImport.stop();
if ( activeDocument.width != w )
error++; // alert( activeDocument.width + ", " + w );
if ( activeDocument.height != h )
error++; // alert( activeDocument.height + ", " + h );
if ( d == 16 && activeDocument.bitsPerChannel != BitsPerChannelType.SIXTEEN )
error++; // alert( activeDocument.bitsPerChannel + ", " + d );
if ( d == 8 && activeDocument.bitsPerChannel != BitsPerChannelType.EIGHT )
error++; // alert( activeDocument.bitsPerChannel + ", " + d );
if ( activeDocument.bitsPerChannel == BitsPerChannelType.ONE )
error++; // alert( activeDocument.bitsPerChannel + ", " + d );
FitOnScreen(); // this makes everything really slow
var historyState = activeDocument.activeHistoryState;
for ( var dPerc = 0; dPerc <= 100; dPerc += percIncrease ) {
tests++;
var timeDissolve = new Timer();
Dissolve(dPerc);
timeDissolve.stop();
// WaitForRedraw(); // guess what this does to our slowness ness er
dissolveLog.write(w + ",\t" + h + ",\t" + d + ", " + dPerc );
dissolveLog.writeln(",\t" + timeImport.getTime() + ", " + timeDissolve.getTime() );
WaitForRedraw();
activeDocument.activeHistoryState = historyState;
if ( timeIt.getElapsed() > maxTime ) {
w = maxWidth + 1;
h = maxHeight + 1;
dPerc = 101;
catch(e) {
alert(e + ":" + e.line);
if ( e.message.search(/cancel/i) != -1 ) {
w = maxWidth + 1;
h = maxHeight + 1;
eArray[eArray.length] = e;
errors++;
// debugger;
} // end catch
} // end for height
} // end for width
dissolveLog.writeln( errors + " errors. " + tests + " tests in " + timeIt.getElapsed() + " seconds. " + tests/timeIt.getElapsed() + " tests/sec.");
dissolveLog.close();
dissolveLog.execute();
// end clean
while (documents.length) {
activeDocument.close(SaveOptions.DONOTSAVECHANGES);
// Reset the application preferences
preferences.rulerUnits = startRulerUnits;
preferences.typeUnits = startTypeUnits;
displayDialogs = startDisplayDialogs;
// 1) " FAIL" for failures
// 2) " PASS" for test results OK
// 3) " BUG" for known bugs, have the file name give the bug number
// 4) "ERROR" this comes from the harness if the script barfed/exception,
return errors == 0 ? ' PASS' : ' FAIL';
} // end function main
Function WaitForRedraw
Usage: Use it to force Photoshop to redraw the screen before continuing
Example:
WaitForRedraw();
function WaitForRedraw() {
var keyID = charIDToTypeID( "Stte" );
var desc = new ActionDescriptor();
desc.putEnumerated( keyID, keyID, charIDToTypeID( "RdCm" ) );
executeAction( charIDToTypeID( "Wait" ), desc, DialogModes.NO );
// WaitNSeconds, slow the script down so you can watch and figure out issues
function WaitNSeconds(seconds) {
startDate = new Date();
endDate = new Date();
while ((endDate.getTime() - startDate.getTime()) < (1000 * seconds))
endDate = new Date();
// FitOnScreen, fits the document and redraws the screen
function FitOnScreen() {
var id45 = charIDToTypeID( "slct" );
var desc7 = new ActionDescriptor();
var id46 = charIDToTypeID( "null" );
var ref1 = new ActionReference();
var id47 = charIDToTypeID( "Mn " );
var id48 = charIDToTypeID( "MnIt" );
var id49 = charIDToTypeID( "FtOn" );
ref1.putEnumerated( id47, id48, id49 );
desc7.putReference( id46, ref1 );
executeAction( id45, desc7, DialogModes.NO );
// Dissolve, given a percentage
function Dissolve( dPercent ) {
var id18 = stringIDToTypeID( "d9543b0c-3c91-11d4-97bc-00b0d0204936" );
var desc3 = new ActionDescriptor();
var id19 = charIDToTypeID( "Amnt" );
var id20 = charIDToTypeID( "#Prc" );
desc3.putUnitDouble( id19, id20, dPercent );
var id21 = charIDToTypeID( "disP" );
var id22 = charIDToTypeID( "mooD" );
var id23 = charIDToTypeID( "moD1" );
desc3.putEnumerated( id21, id22, id23 );
executeAction( id18, desc3, DialogModes.NO );
// DissolveOld, our old scripting params was this
// an interesting test would be to see the old plug-in vs the current one
function DissolveOld( dPercent ) {
var id12 = charIDToTypeID( "disS" );
var desc3 = new ActionDescriptor();
var id13 = charIDToTypeID( "Amnt" );
var id14 = charIDToTypeID( "#Prc" );
desc3.putUnitDouble( id13, id14, dPercent );
var id15 = charIDToTypeID( "disP" );
var id16 = charIDToTypeID( "mooD" );
var id17 = charIDToTypeID( "moD1" );
desc3.putEnumerated( id15, id16, id17 );
executeAction( id12, desc3, DialogModes.NO );
// Library for timing things in JavaScript
function Timer() {
// member variables
this.startTime = new Date();
this.endTime = new Date();
// member functions
// reset the start time to now
this.start = function () { this.startTime = new Date(); }
// reset the end time to now
this.stop = function () { this.endTime = new Date(); }
// get the difference in milliseconds between start and stop
this.getTime = function () { return (this.endTime.getTime() - this.startTime.getTime()) / 1000; }
// get the current elapsed time from start to now, this sets the endTime
this.getElapsed = function () { this.endTime = new Date(); return this.getTime(); }
// end Dissolve.jsx -
So I am creating a generator with (3) boxes of text. I published the generator and all of the text parameters. In FCPX when I select and change a text parameter, it also changes the other two text parameters. "Course I don't want that. What step did I miss? I will appreciate your thoughts. Thanks!
Revert to Saved lets you reopen your last saved version and erase all changes you have made since the last time you saved. It is very useful if you're experimenting and the experiment failed
Save as Template (actually: Publish Template) allows you to save your project as a Final Cut Pro generator if you created a New "Motion Project" from the startup dialog.
You can use a Motion Project to create a Final Cut Generator, or you can start a new Final Cut Generator from the beginning. They are *exactly* the same kind of project. The only difference is that the Final Cut Generator will be saved in a location specific for use in Final Cut, whereas a "plain" Motion Project can be saved anywhere on your system. The "other types" (Effects, Titles, and Transitions) will also be saved automatically in their respective locations required by Final Cut. The convenience is: you don't have to always find the appropriate path for yourself, Motion handles it.
Motion has other startup project types: Effects, which should be picked if you plan to alter the storyline images is some way (colorizing effects, for example); Titles, which should be picked if you are dealing with editable text for the storyline (your project could be developed as a Title effect); and Transitions, which should be chosen if creating an effect that moves from one scene to another. What sets these three other types of project apart from a regular project or a generator is that you get "placeholders" that represent what is in the Final Cut Storyline when used as a template in that app. The applied placeholder (which looks like a Drop Zone, but is actually a different type of entity) is an interactive object with whatever else you develop. One difference between a Title and a Generator that uses text is: A Light object can actually cast light and shadows on the Title placeholder (the storyline in FCPX) whereas the use of a Light in a generator will have absolutely no effect on the storyline media — it will only affect the other objects in the generator (if applicable).
Don't be afraid to develop in these other types even if you are just starting out. (You can do whatever you like to the placeholders, just don't plug in any media -- they are meant to be filled with the storyline media in FCPX.) Picking the right type will make your development projects a lot more easy. -
How to download / read text attachment in Sender Mail Adapter IN XI
Hi
I would like to know how to download / read text attachment in sender mail Adapter & sent same attachment to target system using file adapter.
Please help how to design / resolve this concept.
Regards
DSRI would like to know how to download / read text attachment in sender mail Adapter & sent same
attachment to target system using file adapter.
Take help from this blog:
/people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
From the blog:
However in most cases
our message will not be a part of the e-mail's payload but will be sent as a file attachment.
Can XI's mail adapter handle such scenarios? Sure it can but with a little help
from the PayloadSwapBean adapter module
Once your message (attachment) is read by the sender CC, you can perform the basic mapping requirement (if any) to convert the mail message fromat to the file format.....configure a receiver FILE CC and send the message...this should be the design...
Regards,
Abhishek. -
How to read text from a web page
I want to read text from a web page. Can any body tell me how to do it.
Ok i tell you detail. visit the site " http://seriouswheels.com/" you will a index from A to Z which are basically car name index i want to read each page get car name and its model and store it in data base. I you can provide me the code i will be very thankful.
-
How to read text from PDF and HTML
I have got solution to read text form .txt file but did'nt get code for PDF and HTML.
I dont want to convert PDF to txt.
Please help me ...reading from a file is always the same. using the same strategy used for a .txt will allow you to read a .pdf file.
Offcourse in itself it will be useless becuase pdf files have a special internal structure.
html files are identical to txt files.
What are you trying to accomplisch with the files you are reading ? -
Reading text from server socket stream
I have a basic cd input program i've been trying to figure out the following problem for a while now, the user enters the artist and title etc and then a DOM (XML) file is created in memory this is then sent to the server. The server then echos back the results which is later printed on a html page by reading the replys from the server line by line.
The server must be run it listens for clients connecting the clients connect and send DOM documents through the following jsp code.
<%@page import="java.io.*"%>
<%@page import="java.net.*"%>
<%@page import="javax.xml.parsers.*"%>
<%@page import="org.w3c.dom.*"%>
<%@page import="org.apache.xml.serialize.*"%>
<%!
public static final String serverHost = "cdserver";
public static final int serverPort = 10151;
%>
<hr />
<pre>
<%
Socket mySocket = null; // socket object
PrintWriter sockOut = null; // to send data to the socket
BufferedReader sockIn = null; // to receive data from the socket
try {
// #1 add line that creates a client socket
mySocket = new Socket(serverHost, serverPort);
// #2 add lines that create input and output streams
// attached to the socket you just created
sockOut = new PrintWriter(mySocket.getOutputStream(), true);
sockIn = new BufferedReader(new InputStreamReader(mySocket.getInputStream()));
} catch (UnknownHostException e) {
throw e; // This time the JSP can handle the exception, not us
} catch (IOException e) {
throw e; // This time the JSP can handle the exception, not us
String cdTitle, cdArtist, track1Title, track1Time, track1Rating;
// Retrieve the HTML form field values
cdTitle = request.getParameter("cdtitle");
cdArtist = request.getParameter("cdartist");
track1Title = request.getParameter("track1title");
track1Time = request.getParameter("track1time");
track1Rating = request.getParameter("track1rating");
// Create a new DOM factory, and from that a new DOM builder object
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
// Note that we are creating a new (empty) document
Document document = builder.newDocument();
// The root element of our document wil be <cd>
// It gets stored as the child node of the whole document (it is the root)
Element rootElement = document.createElement("cd");
document.appendChild(rootElement);
// Create an element for the CD title called <title>
Element cdTitleElement = document.createElement("title");
// Add a text code under the <title> element with the value that
// the user entered into the title field of the web form (cdTitle)
cdTitleElement.appendChild(document.createTextNode(cdTitle));
// Place the <title> element underneath the <cd> element in the tree
rootElement.appendChild(cdTitleElement);
// Create an <artist> element with the form data, place underneath <cd>
Element cdArtistElement = document.createElement("artist");
cdArtistElement.appendChild(document.createTextNode(cdArtist));
rootElement.appendChild(cdArtistElement);
// Create a <tracklist> element and place it underneath <cd> in the tree
// Note that it has no text node associated with it (it not a leaf node)
Element trackListElement = document.createElement("tracklist");
rootElement.appendChild(trackListElement);
// In this example we only have one track, so it is not necessary to
// use a loop (in fact it is quite silly)
// But the code below is included to demonstrate how you could loop
// through and add a set of different tracks one by one if you
// needed to (although you would need to have the track data already
// stored in an array or a java.util.Vector or similar
int numTracks = 1;
for (int i=0; i<numTracks; i++) {
String trackNum = Integer.toString(i+1);
Element trackElement = document.createElement("track");
trackElement.setAttribute("id", trackNum);
trackListElement.appendChild(trackElement);
// Track title element called <title>, placed underneath <track>
Element trackTitleElement = document.createElement("title");
trackTitleElement.appendChild(document.createTextNode(track1Title));
trackElement.appendChild(trackTitleElement);
// Track time element called <time>, placed underneath <track>
Element trackTimeElement = document.createElement("time");
trackTimeElement.appendChild(document.createTextNode(track1Time));
trackElement.appendChild(trackTimeElement);
// Track rating element called <rating>, placed underneath <track>
Element trackRatingElement = document.createElement("rating");
trackRatingElement.appendChild(document.createTextNode(track1Rating));
trackElement.appendChild(trackRatingElement);
OutputFormat format = new OutputFormat();
format.setIndenting(true);
// Create a new XMLSerializer that will be used to write out the XML
// This time we will serialize it to the socket
// #3 change this line so that it serializes to the socket,
// not to the "out" object
XMLSerializer serializer = new XMLSerializer(writer, format);
serializer.serialize(document);
// Print out a message to indicate the end of the data, and
// flush the stream so all the data gets sent now
sockOut.println("<!--QUIT-->");
sockOut.flush();
BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
String fromServer;
String fromUser;
#4 add a while loop that reads text from the
server socket input stream, line by line, and prints
it out to the web page, using out.println(...);
Note that because the reply from the server will contain
XML, you will need to call upon the toHTMLString() method
defined below to escape the < and > symbols so that they
will display correctly in the web browser.
Also note that as you receive the reply back from the
server, you should look out for the special <!--QUIT-->
string that will indicate when there is no more data
to receive.
while ((fromServer = sockIn.readLine()) != null) {
out.println(sockIn.readLine());
// If the reply from the server said "QUIT", exit from the
// while loop by using a break statement.
if (fromServer.equals("QUIT")) {
out.println("Connection closed - good bye ...");
// Print the text from the server out to the user's screen
out.println("Reply from Server: " + fromServer);
// Now read a line of text from the keyboard (typed by user)
fromUser = stdIn.readLine();
// If it wasn't null, print it out to the screen, and also
// print a copy of it out to the socket
if (fromUser != null) {
out.println("Client: " + fromUser);
sockOut.println(fromUser);
// Close all the streams we have open, and then close the socket
sockOut.close();
sockIn.close();
mySocket.close();
%>
I'm suppose to modify the commented sections labled with #.
#1,2 are correct but i have doubts on the 3rd and 4th modification.
for #3 i changed so i serializes to the socket not to the "out" object:
from
XMLSerializer serializer = new XMLSerializer(out, format);
to
XMLSerializer serializer = new XMLSerializer(writer, format);
with "out" it prints out some of the results entered but it just hangs i'm thinking it might be the while loop that i added in #4. If i changed it to serialize the socket XMLSerializer serializer = new XMLSerializer(writer, format); it doesn't print out nothing at all; just a blank screen where it hangs.
I can post the rest of the code (server thats in java and cdinput.html) but since i want to keep my post short and if required i'll post it later on i also omitted some of the code where it creates the DOM textnodes etc to keep my post short.On your previous thread, why did you say the server was using http POST and application/xml content type when it quite obviously isn't, but a direct socket communication that abuses XML comments for message end delimiters?
The comments imply you need to wait for "<!--QUIT-->" on a line by itself, but your loop is waiting for "QUIT".
Pete -
Is there a way to have the iPad 2 "read" text from iBooks as with web sites or pages?
is there a way to have the iPad 2 "read" text from iBooks as with web sites or pages? A different App perhaps?
Isn't that you asking how to get it (undefined) back?
If you never had Pages '09, you can buy it from Amazon very cheaply:
http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=432&sid=f68e84cd2ec6 123bd2ed93806c7e7fb6&mforum=iworktipsntrick
Peter -
Reading text file to make a list
Hello ,
I want to read a specific column from the text file if the columns are separated by a space.
When the whole file (as shown here http://imageshack.com/a/img834/6321/k55hx.jpg
) is read its column1 names should be visible in a drop list and whenever a name is selected from the list it should select its respective value from column2 in the text file and display the value in indicator.
I tried as shown here(http://imageshack.com/a/img829/6821/x4h0.jpg ) and got the output like this(http://imageshack.com/a/img840/1431/ior7.jpg ) but I am unable to get the required.
Can someone help me out with this.
Thanks.Hi stefan57.
If I understand you correctly, you are trying to make a dropdown list with the values from the first coloum, and when the user changes this values, you want the data to be shown.
I have made a small exampled that demostrates how this can be done.
(please note, that this code should be further improved, eg. by implementing proper error handling)
Best Regards
Alex E. Petersen
Certified LabVIEW Developer (CLD)
Application Engineer
Image House PantoInspect
Attachments:
Read Text.vi 25 KB
File.txt 1 KB -
Reading text file to JEditorPane
Hi,
I'm trying to read text file to JEditorPane and it works but first line is always missing. Here is the code for reading:
try {
in = new BufferedReader(new FileReader(filePathIn));
while ((lineIn = in.readLine()) != null) {
editorPane.read(in, new Object());
} catch (IOException ie)...Any suggestions?in.readLine is changing the input stream position.
Do this instead:
FileInputStream in = new FileInputStream(filePathIn);
while (in.available() != 0)
editorPane.read(in, new Object()); -
Read text from purchase order.
I have few queries regarding texts in a document.
1. How do i identify the id for a text of a line item in any PO document?
2. Secondly a pgm is using read_text to get this text. before which 'stxh' is queried. But when i debugged i found that for a particular document there is no entry in this table though there is a text in the document and hence doesnot perform a read_text. The text is auto generated through info records. How to retrieve this text?
Ans wil be appreciated and rewardedHi Ravikumar thanks for u quick reply.
This is wht is currently coded.
concatenate values to get item text for read text function
invar3+0(10) = invar1. "PO number
invar3+10(5) = invar2. "PO line number
SELECT SINGLE * FROM stxh WHERE tdobject = 'EKPO'
AND tdname = invar3
AND tdid = 'F01'
AND tdspras = sy-langu.
IF sy-subrc = 0.
invar4 = invar3.
reading the text for the document items.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F01'
language = sy-langu
name = invar4
object = 'EKPO'
TABLES
lines = it_itab.
I have seen some PO's which have info rec texts in that, which gets pulled by the above code...first thing is its id is F02 which exist in STXH table also there is other text with F01 id, and hence the table it_itab gets both these text hence no pbm.
but i came across a PO which has only one text which is info rec text with id F05 and is not store in stxh and hence doesnot get pulled by read_text fm. How do i change my cod to get this text which should not hamper other PO's as well.
As mentioned in above msgs, this F05 could be retrieved by providing object name as EINE.
anyhelp will be appreciated and rewarded.
thanks -
Indesign CS3-JS - Problem in reading text from a text file
Can anyone help me...
I have an problem with reading text from an txt file. By "readln" methot I can read only the first line of the text, is there any method to read the consecutive lines from the text file.
Currently I am using Indesign CS3 with Java Script (for PC).
My Java Script is as follows........
var myNewLinksFile = myFindFile("/Links/NewLinks.txt")
var myNewLinks = File(myNewLinksFile);
var a = myNewLinks.open("r", undefined, undefined);
myLine = myNewLinks.readln();
alert(myLine);
function myFindFile(myFilePath){
var myScriptFile = myGetScriptPath();
var myScriptFile = File(myScriptFile);
var myScriptFolder = myScriptFile.path;
myFilePath = myScriptFolder + myFilePath;
if(File(myFilePath).exists == false){
//Display a dialog.
myFilePath = File.openDialog("Choose the file containing your find/change list");
return myFilePath;
function myGetScriptPath(){
try{
myFile = app.activeScript;
catch(myError){
myFile = myError.fileName;
return myFile;
Thanks,
Bharath Raja GHi Bharath Raja G,
If you want to use readln, you'll have to iterate. I don't see a for loop in your example, so you're not iterating. To see how it works, take a closer look at FindChangeByList.jsx--you'll see that that script iterates to read the text file line by line (until it reaches the end of the file).
Thanks,
Ole -
How to read URL Parameters in ABAP WebDynpro ?
Hi,
How and where (which class, method) in ABAP WebDynpro we can read URL Parameters ? I found answers for WebDynpro JAVA but nothing for ABAP.
Thanks
MeenalHi Meenal,
Please see a post by Sanjay Agarwal titled 'Sequencing Problem in Web Dynpro ABAP'. I believe you will find your answer there.
Cheers,
Rich
Maybe you are looking for
-
Add fields to Existing DSO and DS in R/3
Hi Friends, I have got to change my LO datasource which is running on production, 2lis_va_vatim, i need to add 2 fields to the exisitng DS from Comm Stru, so could anyone point me inthe right direction, Hoow to Add the fields with out disturbing the
-
HT1386 What's wrong with my iTunes/ iPhone?
Today, I decided to grab some CDs and put them on my iTunes. That worked just fine, I could listen to my music then i just out into the library with no problems. I them decided to out the songs on my phone, I have all the correct settings for iTunes
-
USB to Firewire adapter for MacBook Air?
I would like to switch to a MacBook Air, but I still need to use my video camera via firewire. I found out that there is no direct way to connect firewire to MacBook Air, isn't it? Then I have found PCMCIA cards supporting firewire connections. The r
-
How to Create report in Material Master that outputs stock
Hi, How to Create report in Material Master that outputs stock, grouped by Material Type and Plant. The output shows Material No, Storage location, Unit of Measure and Description in addition to group totals. Data was extracted from MARA, MARC,
-
Hi, I am developing application for recording the video in mp4 format with h.264 codec and I am able to record video in mp4 format with h.264 codec, but when I am compiling the Swf by "CTRL+Enter" at that time I am facing error "VerifyError: Error #1