How can we read the contents of a textfile that is stored in the KM

Hi All
We are doing a Webdynpro application and we need to access the data of a textfile which is stored in the KM.
The actual problem is :I have a textfile in Knowledege Management(KM) , /documents folder .Now i need to access the contents of that textfile.
Please kindly help me in this regards as its urgent requirement for us.
Thanks in Advance
Thanks and Regards
Nishita Salver

Hi,
Try the following
RID rid = RID.getRID("/documents/testext.txt");
try {
com.sapportals.wcm.repository.IResource resource = ResourceFactory.getInstance().getResource(rid, resourceContext);
if (resource != null) {
String text = "";
BufferedReader in = new BufferedReader(new InputStreamReader(resource.getContent().getInputStream()));
while ((text = in.readLine()) != null) {
wdContext.currentTextElement().setText(text);
} catch (RuntimeException e2) {
// TODO Auto-generated catch block
/thread/90181 [original link is broken]
Regards
Ayyapparaj

Similar Messages

  • How can we read the screen field values from the report selection screen wi

    Hi expart,
    How can we read the screen field values from the report selection screen with out having an ENTER button pressed  .
    Regards
    Razz

    use this code...
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
    **Read the Values of the SCREEN FIELDs
    CALL FUNCTION 'DYNP_VALUES_READ'

  • How can I read the bootstrap files and extract the fragment-URLs and fragment-numbers in plain text?

    How can I read the bootstrap files of any HDS Live stream and extract the fragment-URLs and fragment-numbers in plain text?
    Could it be that it is some kind of compressed format in the bootstrap? Can I uncompress it wirh  f4fpackager.exe? Could not find any download for f4fpackager.exe. I would prefere less code to do so. Is there something in Java of JavaScript, that can extract the fragment-numbers?
    Thank you!

    Doesn't sound too hard to me. Your class User (the convention says to capitalize class names) will have an ArrayList or Vector in it to represent the queue, and a method to store a Packet object into the List. An array or ArrayList or Vector will hold the 10 user objects. You will find the right user object from packet.user_id and call the method.
    Please try to write some code yourself. You won't learn anything from having someone else write it for you. Look at sample code using ArrayList and Vector, there's plenty out there. Post in the forum again if your code turns out not to behave.

  • How can I read the printer snapshot file printers.xml

    How can I read the printer snapshot file printers.xml

    XML files are typically viewed using a web browser.
    Open the XML file and the default program should open it automatically.  If you are prompted to select a program, use the option that lets you choose a program and brows through the directories for your browser (for example, use Internet Explorer, Firefox, etc.).
    If need be, you should be able to right-click the file and select open with to choose the program to open it with.
    There are other XML viewers out ther, but web browsers are typically the default as XML is a web language.
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • How can I read the EXCEL file while Program is running in background.

    Hi all Expert,
    How can I read the EXCEL file while Program is running in background.
    Thanks

    you need to place ur excel file on application server and follow this thread: Reading an Excel file from the application server?
    loots of information if you can search forum.. thanks

  • How can I customize each content page separately, so that if I change one chapter, it won't affect the next?

    how can I customize each content page separately, so that if I change one chapter, it won't affect the next?

    I don't think you can do what you want to do, sorry.
    See: Publishing With iBooks Author
    http://shop.oreilly.com/product/0636920025597.do

  • How can i read the data fromtext fieldsin the form of bytes??

    Hi friends,
    How can i read the data fromtext fieldsin the form of byte string while using Socket connection.
    I have two text fields. i need to send the data from the textfeilds to the server using a byte string.
    Can anyboday help me???
    KK

    Does <cfdbinfo> work for Access DBs?
    You might be better off asking this on a MS Access forum.  It's more of an Access issue than a CF one.
    Adam

  • How can I read the trace data into LabVIEW for E5071B

    HI 
    I am setting up the measurement using vector network analyzer (VNA) E5071B controlled by NI 488.2. How can I read the trace data into LabVIEW and display on the graph? If anyone having an idea or know well about this process please give me the suggestion, I will much appreciate it.
    Many Thanks

    You want to start with the driver
     In case you do not know it, you can do the driver search in LabVIEW from Tools>Instrumentation>Find Instrument Drivers. You might also want to bookmark the Instrument Driver Network for information on what a driver is and how to use it.

  • How can I read the image from database into form

    hi everyone
    if I have table like this
    create table test
    (id number(10),
    pic long raw);
    in this table record
    in form If I have block non database
    how can i read the image into non database item
    I try with this code but no good
    select pic into :photo from test where id=5;
    photo its non database item kind image
    how can i invoke image into item
    thanks alooooooot

    Hello,
    You can't select image with select query. You need to create another database block from test table which has item binds with database pic column. Now in where condition in test block's property you have to write id=5. Change test block's properties UPDATE ALLOWED, INSERT ALLOWED, DELETE ALLOWED to NO. Only Query allowed property set to YES.
    Now in your particular trigger write the code
    GO_BLOCK('test');
    Execute_Query;
    please mark if it help you or correct
    Regards,
    Danish

  • How can I read the PXI-Chassis-Type (LabWindows/CVI)?

    How can I read the PXI-Chassis-Type?
    I use in different test-stands different PXI/SCXI-Chassis for the same project. For example: Some test-stands have a PXI/SCXI-1052-Chassis, others have a PXI-1033 and a SCXI-1000 Chassis. Because I have to use different DIO-Ports (Ports 0.0, 0.1... are reserved for internal communication between the 1033 and the 1000-Chassis) I want to read the used devices.
    I think one way is to use the registry-entries, but I'm not sure...
    My current LabWindows/CVI- version is 8.5.1.
    Thanks for your ideas!
    Jagger_HKG

    Hello Jagger_HKG,
    you could use the NI System Configuration API.
    Kind regards,
    Robert H
    NI Germany 

  • How can I read and write text in rings that are inside an array?

    Hello All!!!
    How can I read and write text in rings that are inside an array?
    Regards and thanks in advance.

    Use a Property Node linked to the Ring inside the array.
    Of course, all elements in the array will have the same text values.
    B-)
    Message Edited by LabViewGuruWannabe on 12-13-2007 09:47 AM
    Message Edited by LabViewGuruWannabe on 12-13-2007 09:48 AM
    Message Edited by LabViewGuruWannabe on 12-13-2007 09:49 AM
    Attachments:
    Strings-BD.PNG ‏17 KB
    Strings-FP1.PNG ‏23 KB

  • HT201272 How can I read a book in my PC that I purchased on my iphone? (no an Apple PC)

    How can I read a book in my PC that I purchased on my iphone? (no an Apple PC)

    jofly wrote:
    How can I read a book in my PC that I purchased on my iphone? (no an Apple PC)
    It depends where you bought the book...
    If it came from the Kindle Store, you can read it on your PC by using the Kindle for PC app.
    If it is an iBook that you bought from Apple, it can only be read on an iOS device.  Not only can you not read it on a PC, you can't even read it on a Mac!!!

  • How can I read the internet speed in a MAC?

    How can I find the INTERNET SPEED in a MAC?

    You typically use a free Internet Speed test. It does an upload and a download from a known site, bypassing certain configuration problems. Just do a search to find a dozen services eager to test with you (in exchange for the Ads on their pages).
    Do not pay for this service, and DO NOT accept any CR@P they suggest you download to "fix" your speed. They cannot tell from outside whether you have problems, and none of the things you can download ever makes anything better.
    If using Wi-Fi, one generally finds that the Wi-Fi part of the connection is the limiting factor.

  • How can I read the complete text I see in spotlight?

    Hey just here to ask a quick question. I just noticed that I can still see messages that i deleted (or so I thought) on spotlight. Now, I would like to know how I can see the complete message. On spotlight you can only see a few words of the text but I would like to read the complete message if possible. I don't sync my phone at all but I do have the icloud on. I tried restoring my phone but I don't have any space left on it. Also, the details show that my phone was last backed up on March or so, does that mean I can view all the deleted messages since March or only the messages I deleted before March?? Please help. Hope I'm very clear and understandable.
    Thanks.
    Luis V.

    Do you happen to know if there is any other way I can view the complete message with outside sources (apps, programs, etc.)? Thanks for the help.

  • How can I read the voltage from a serial port

    I am fairly new to LabView and I am having trouble figuring out how to read the DC voltage coming out of an RF Power Supply through a serial port so that I can monitor the voltage every few seconds. In order to do this do I need to purchase a DAQ card or anything like that?

    You would not need a DAQ card to read data over the serial port. You would, however, need a serial port. That may sound sarcastic, but it's not, since many manufacturers are ditching serial ports on computers. If you don't have a serial port then you would need to get something like a USB<->serial adapter or a serial port card that you plug into an expansion slot in your computer.
    Assuming you've got that then you need to find the command set for the RF Power Supply, and write drivers for it so you can send the command to read the voltage, and then read the resposen. I would suggest looking in the Instrument Driver Network to see if a driver for your supply has already been written. 

Maybe you are looking for

  • Zen Vision:M 30GB Keeps Crash

    I've had my 30GB Vision:M for about 8 months now, and recently, it's been starting to crash a lot. Often, it will not start up and when it does, I'm often greeted with a "hardware error" or "rebuilding." Usually, it will seem to be working fine, but

  • Need help in displaying XML in JSP

    Hi there, i'm a newbi in XML and Java - I have the following prob, think for most of u nothing very difficult (or better thought so, I've posted this question in different forums here, but nobody answers :) I get an XML response from a search engine,

  • How to Create, Save and Restore a Custom Catalog in PE 6?

    I am having great difficulty in trying to create a custom catalog using the organizer function of PE 6. Upon opening the organizer I have many photos already depicted in it. So, I highlight them all and delete them obtaining a blank screen with no ph

  • How many types of projects exist in sap bw

    i heard that there are two types of projects 1.implementation project 2.support project and what about up gradation project, migration project, and i want to know what all the projects exists and there processes.. if not possible please provide the l

  • OM-PA Integration

    Dear All I have a genuiene problem. When I hire a person for a particular position, that position is stored in the infotype 0001 of the employee. But when I go to tabble HRP1001 there is no person to position relationship visible for the particular p